index.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. use Magento\Setup\Application;
  7. use Magento\Setup\Model\ObjectManagerProvider;
  8. if (PHP_SAPI == 'cli') {
  9. echo "You cannot run this from the command line." . PHP_EOL .
  10. "Run \"php bin/magento\" instead." . PHP_EOL;
  11. exit(1);
  12. }
  13. try {
  14. require __DIR__ . '/../app/bootstrap.php';
  15. } catch (\Exception $e) {
  16. echo <<<HTML
  17. <div style="font:12px/1.35em arial, helvetica, sans-serif;">
  18. <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
  19. <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
  20. Autoload error</h3>
  21. </div>
  22. <p>{$e->getMessage()}</p>
  23. </div>
  24. HTML;
  25. exit(1);
  26. }
  27. // For Setup Wizard we are using our customized error handler
  28. $handler = new \Magento\Framework\App\ErrorHandler();
  29. set_error_handler([$handler, 'handler']);
  30. $configuration = require __DIR__ . '/config/application.config.php';
  31. $bootstrap = new Application();
  32. $application = $bootstrap->bootstrap($configuration);
  33. $application->getServiceManager()
  34. ->get(ObjectManagerProvider::class)
  35. ->setObjectManager(\Magento\Framework\App\Bootstrap::create(BP, $_SERVER)->getObjectManager());
  36. $application->run();