pay.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. use lwmf\base\Config;
  3. //定义app id
  4. define('LWM_APP_ID', "front");
  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. //开启性能分析 - 线上关闭
  15. /*$isOpenTideways = false;
  16. if (function_exists('tideways_enable')) {
  17. $isOpenTideways = true;
  18. tideways_enable(TIDEWAYS_FLAGS_NO_SPANS);
  19. }*/
  20. require_once LWM_PROJECT_PATH .'/system/commons/Loader.php';
  21. // change the following paths if necessary
  22. //加载扩展后的YII框架
  23. require LWM_PROJECT_PATH . '/lwmf/Yii.php';
  24. defined('LEWAIMAI_VERSION') or define('LEWAIMAI_VERSION', Config::getInstance()->get('frontVersion'));
  25. defined('LEWAIMAI_CDN_DATE') or define('LEWAIMAI_CDN_DATE', Config::getInstance()->get('frontCdnDate'));
  26. //兼容旧的配置定义
  27. require LWM_PROJECT_PATH . '/protected-front/include/define.php';
  28. //初始化静态资源常量
  29. define('LWM_ASSETS_URL', Config::getInstance()->get('assetsUrl'));
  30. //初始化当前系统环境
  31. define('LWM_ENV', Config::getInstance()->get('env'));
  32. //获取默认配置
  33. $config = Config::getInstance()->get('', 'main');
  34. $app = Yii::createWebApplication($config);
  35. //记录性能分析日志 - 线上关闭
  36. /*if ($isOpenTideways) {
  37. $app->attachEventHandler('onEndRequest', function () {
  38. $data = tideways_disable();
  39. $logPath = "/alidata/log/tideways";
  40. if (file_exists($logPath)) {
  41. $app = Yii::app();
  42. $logName = $app->request->getPathInfo();
  43. if ($app instanceof \lwmf\base\WebApplication) {
  44. $logName = $app->getRoute();
  45. }
  46. if (empty($logName)) {
  47. $logName = '/';
  48. }
  49. $logName = LWM_APP_ID . "_" . $logName;
  50. $logName = $logPath . "/" . str_replace('/', '_', $logName) . "_" . uniqid() .".lewaimai.xhprof";
  51. file_put_contents(
  52. $logName,
  53. serialize($data)
  54. );
  55. }
  56. });
  57. }*/
  58. $app->run();