magento 799 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. if (PHP_SAPI !== 'cli') {
  8. echo 'bin/magento must be run as a CLI application';
  9. exit(1);
  10. }
  11. try {
  12. require __DIR__ . '/../app/bootstrap.php';
  13. } catch (\Exception $e) {
  14. echo 'Autoload error: ' . $e->getMessage();
  15. exit(1);
  16. }
  17. try {
  18. $handler = new \Magento\Framework\App\ErrorHandler();
  19. set_error_handler([$handler, 'handler']);
  20. $application = new Magento\Framework\Console\Cli('Magento CLI');
  21. $application->run();
  22. } catch (\Exception $e) {
  23. while ($e) {
  24. echo $e->getMessage();
  25. echo $e->getTraceAsString();
  26. echo "\n\n";
  27. $e = $e->getPrevious();
  28. }
  29. exit(Magento\Framework\Console\Cli::RETURN_FAILURE);
  30. }