Example #1
0
 /**
  * 开启Xhprof调试信息
  */
 public function xhprof_start($type = null)
 {
     if (function_exists('saeAutoLoader')) {
         sae_xhprof_start();
         return;
     }
     $profiler = $this->profiler('xhprof');
     if (true === $profiler->is_open()) {
         $xhprof_fun = 'xhprof_enable';
         if (function_exists($xhprof_fun)) {
             $xhprof_fun($type);
         }
         $profiler->start('Xhprof', $type === null ? 'default' : 'Type:' . $type);
     }
 }
Example #2
0
    {
        return false;
    }
}
if (!in_array("saekv", stream_get_wrappers())) {
    stream_wrapper_register("saekv", "SaeKVWrapper");
}
/* END *********************  KVDB Wrapper By Elmer Zhang At 12/Dec/2011 12:37 ****************/
/* START *********************  Supported for AppCookie By Elmer Zhang At 13/Jun/2010 15:49 ****************/
$appSettings = array();
if (isset($_SERVER['HTTP_APPCOOKIE']) && $_SERVER['HTTP_APPCOOKIE']) {
    $appCookie = trim($_SERVER['HTTP_APPCOOKIE']);
    $tmpSettings = array_filter(explode(';', $appCookie));
    if ($tmpSettings) {
        foreach ($tmpSettings as $setting) {
            $tmp = explode('=', $setting);
            $appSettings[$tmp[0]] = $tmp[1];
        }
    }
}
if (isset($appSettings['xhprof']) && in_array($_SERVER['HTTP_APPVERSION'], explode(',', $appSettings['xhprof']))) {
    sae_xhprof_start();
    register_shutdown_function("sae_xhprof_end");
}
if (isset($appSettings['debug']) && in_array($_SERVER['HTTP_APPVERSION'], explode(',', $appSettings['debug']))) {
    sae_set_display_errors(true);
}
unset($appSettings);
unset($appCookie);
unset($tmpSettings);
unset($tmp);