Beispiel #1
0
 public static function init($app_name = null)
 {
     if (self::$isInit) {
         return false;
     }
     self::$isInit = true;
     // 初始化基础环境
     self::initBasicEnv();
     // 初始化App环境
     self::initAppEnv($app_name);
     // 初始化Ap框架
     self::initAp();
     // 初始化日志库
     self::initLog($app_name);
     // 执行产品线的auto_prepend
     self::doProductPrepend();
     return Ap_Application::app();
 }
Beispiel #2
0
<?php

/**
 * @name sampleScript
 * @desc 示例脚本
 * @author 符广森(fuguangsen@baidu.com)
 */
Bd_Init::init();
//主体功能逻辑写在这里
echo 'Hello, sample script running...';
//如果利用noah ct任务系统运行脚本,需要显示退出,设置退出码为0,否则监控系统会报警
exit(0);
Beispiel #3
0
<?php

/**
 * @name index
 * @desc 入口文件
 * @author dengfangyuan01@baidu.com
 */
try {
    $objApplication = Bd_Init::init();
    $objResponse = $objApplication->bootstrap()->run();
} catch (Exception $ex) {
    $code = $ex->getCode();
    $msg = $ex->getMessage();
    Bd_Log::warning(sprintf("CLASS[%s] get exception err[%d] msg[%s] file[%s] line[%d]", __FILE__, $code, $msg, $ex->getFile(), $ex->getLine()));
    header('Location: http://map.baidu.com/static/waimai/error/index.html');
}