index.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Public alias for the application entry point
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. use Magento\Framework\App\Bootstrap;
  9. use Magento\Framework\App\Filesystem\DirectoryList;
  10. try {
  11. require __DIR__ . '/../app/bootstrap.php';
  12. } catch (\Exception $e) {
  13. echo <<<HTML
  14. <div style="font:12px/1.35em arial, helvetica, sans-serif;">
  15. <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
  16. <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
  17. Autoload error</h3>
  18. </div>
  19. <p>{$e->getMessage()}</p>
  20. </div>
  21. HTML;
  22. exit(1);
  23. }
  24. $params = $_SERVER;
  25. $params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = array_replace_recursive(
  26. $params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] ?? [],
  27. [
  28. DirectoryList::PUB => [DirectoryList::URL_PATH => ''],
  29. DirectoryList::MEDIA => [DirectoryList::URL_PATH => 'media'],
  30. DirectoryList::STATIC_VIEW => [DirectoryList::URL_PATH => 'static'],
  31. DirectoryList::UPLOAD => [DirectoryList::URL_PATH => 'media/upload'],
  32. ]
  33. );
  34. $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
  35. /** @var \Magento\Framework\App\Http $app */
  36. $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
  37. $bootstrap->run($app);