index.php 1.1 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. if (!file_exists(__DIR__ . '/install.lock.php')) {
  8. header('Location: ./install');
  9. exit(0);
  10. }
  11. error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
  12. header("access-control-allow-headers: Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With");
  13. header("access-control-allow-methods: GET, POST, PUT, DELETE, HEAD, OPTIONS");
  14. header("access-control-allow-credentials: true");
  15. header("access-control-allow-origin: *");
  16. // comment out the following two lines when deployed to production
  17. defined('YII_DEBUG') or define('YII_DEBUG', true);
  18. defined('YII_ENV') or define('YII_ENV', 'dev'); // dev or prod
  19. define('RUN_MODE', 'fpm');
  20. define('DEFAULT_STORE_ID', 1);
  21. require __DIR__ . '/vendor/autoload.php';
  22. require __DIR__ . '/vendor/yiisoft/yii2/Yii.php';
  23. require __DIR__ . '/librarys/WebApplication.php';
  24. $config = require __DIR__ . '/config/web.php';
  25. (new app\librarys\WebApplication($config))->run();