/** * @brief 开始监控,记录时间 * * @return public function * @retval * @see * @note * @author luhaixia * @date 2012/05/02 17:57:35 **/ public static function start() { if (!self::_enableProfiling()) { return; } $beg = intval(microtime(true) * 1000); $arrInfo = array('begTime' => $beg, 'module' => Bd_AppEnv::getCurrApp()); array_push(self::$callStack, $arrInfo); }
public static function getLogPrefix() { if (defined('IS_ODP') && IS_ODP == true) { return Bd_AppEnv::getCurrApp(); } else { if (defined('MODULE')) { return MODULE; } else { return 'unknow'; } } }
/** * @brief 取得app相关配置文档 * * @param $confItem 配置所在路径 * @return success-array或者string failed-false * @retval array/boolean * @author chenyijie * @date 2012/09/27 17:20:22 **/ protected function _getConf($confRoute) { $conf = Bd_Conf::getAppConf($confRoute, Bd_AppEnv::getCurrApp()); if ($conf === false) { $arrErr = array('caller' => 'CacheProxy', 'class' => get_class($this->objClass)); Bd_Log::warning("Get config from config file: " . $confRoute . " failed.", self::GET_CONF_FAILED, $arrErr); self::$errCode = self::GET_CONF_FAILED; } return $conf; }
protected function _ralExecute($arrInput) { //ral_set_logid(LOG_ID); ral_set_log(4, Bd_AppEnv::getCurrApp()); ral_set_pathinfo($arrInput['pathinfo']); ral_set_querystring($arrInput['querystring']); ral_set_useragent('ral spider'); /* //ral_set_header("Cookie:".$strCookie);这个接口不会reset出出现head过大而报错问题,有需要再升级 $arrCookie = array(); if (is_array($_COOKIE) && count($_COOKIE) > 0) { foreach($_COOKIE as $key => $value) { if ($key != "LITE_DEBUG") { $arrCookie[] = "$key=".$value; } } } $strCookie = implode(";", $arrCookie); ral_set_header("Cookie:".$strCookie); */ if (count($arrInput['post']) <= 0) { $arrInput['post']['time'] = time(); } $content = ral($this->service, __FUNCTION__, http_build_query($arrInput['post']), rand()); if ($content == false) { Bd_Log::warning("ral execute [" . $this->service . "] failed param[" . var_export($arrInput, true) . "]"); } return $content; }
public static function getAppConf($strItem, $strValuePath) { $strItemPath = '/app/' . Bd_AppEnv::getCurrApp() . '/' . $strItem; $arrRes = self::getConf($strItemPath, $strValuePath); return $arrRes; }