| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- $file = dirname(__FILE__);
- $config = include "{$file}/protected/config/main.php";
- // remove the following lines when in production mode
- defined('YII_DEBUG') or define('YII_DEBUG', false);
- defined('LWM_ENV') or define('LWM_ENV', $config['params']['env']?? 'dev');
- // specify how many levels of call stack should be shown in each log message
- defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 5);
- defined('PROJECT_PATH') or define('PROJECT_PATH', __DIR__);
- defined('RUNTIME_PATH') or define('RUNTIME_PATH', PROJECT_PATH . '/protected/runtime');
- // 这里是与乐外卖业务相关的一些定义
- defined('LEWAIMAI_DEBUG') or define('LEWAIMAI_DEBUG', false);
- // 定义一个 request_id 用于在日志中显示
- defined('LWM_REQUEST_ID') or define('LWM_REQUEST_ID', 'xunjoy_'.bin2hex(random_bytes(16)));
- require_once("{$file}/../yii/framework/yii.php");
- require_once("{$file}/protected/include/define.php");
- require_once("{$file}/vendor/autoload.php");
- spl_autoload_register(function($class) use($file) {
- $class = str_replace('\\', '/', $class);
- $pos = strpos($class, '/');
- if ($pos) {
- if ('app' == substr($class, 0, $pos)) {
- $class = 'protected/' . substr($class, $pos);
- }
- }
- $file = "{$file}/{$class}.php";
- if (file_exists($file)) {
- include($file);
- }
- });
- error_reporting(E_ERROR);
- Yii::createWebApplication($config)->run();
|