index.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use lwmf\base\Config;
  3. //定义app id
  4. define('LWM_APP_ID', "api");
  5. //定义项目根目录
  6. define('LWM_PROJECT_PATH', dirname(dirname(__FILE__)));
  7. //YII框架路径
  8. define('YII_PATH', dirname(LWM_PROJECT_PATH) . '/yii/framework');
  9. // remove the following lines when in production mode
  10. defined('YII_DEBUG') or define('YII_DEBUG', true);
  11. // specify how many levels of call stack should be shown in each log message
  12. defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',5);
  13. defined('LEWAIMAI_DEBUG') or define('LEWAIMAI_DEBUG', true);
  14. require_once LWM_PROJECT_PATH .'/system/commons/Loader.php';
  15. // change the following paths if necessary
  16. //加载扩展后的YII框架
  17. require LWM_PROJECT_PATH . '/lwmf/Yii.php';
  18. //兼容旧的配置定义
  19. require LWM_PROJECT_PATH . '/protected/include/define/define.php';
  20. //初始化静态资源常量
  21. define('LWM_ASSETS_URL', Config::getInstance()->get('assetsUrl'));
  22. //初始化当前系统环境
  23. define('LWM_ENV', Config::getInstance()->get('env'));
  24. //获取默认配置
  25. $config = Config::getInstance()->get('', 'main');
  26. $app = Yii::createWebApplication($config);
  27. $app->run();