本文整理汇总了PHP中Profiler::Log方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::Log方法的具体用法?PHP Profiler::Log怎么用?PHP Profiler::Log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::Log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Display
function Display($path = NULL, $args = NULL)
{
$path = any($path, $this->request["path"], "/");
$args = any($args, $this->request["args"], array());
if (!empty($this->components)) {
try {
$output = $this->components->Dispatch($path, $args, $this->request["type"]);
} catch (Exception $e) {
//print_pre($e);
$output["content"] = $this->HandleException($e);
}
$this->session->quit();
$contegargs = any($this->cfg->servers["conteg"], array());
$sitecfg = ConfigManager::get("conteg");
if (is_array($sitecfg)) {
$contegargs = array_merge($contegargs, $sitecfg);
}
if (is_array($this->sitecfg["conteg"])) {
$contegargs = array_merge($contegargs, $this->sitecfg["conteg"]);
}
if (empty($contegargs["type"])) {
$contegargs["type"] = any($this->request["contenttype"], $output["responsetype"]);
}
if (is_array($contegargs["policy"][$contegargs["type"]])) {
$contegargs = array_merge($contegargs, $contegargs["policy"][$contegargs["type"]]);
}
if (empty($contegargs["modified"])) {
// Set modified time to mtime of base directory if not set
$contegargs["modified"] = filemtime($this->rootdir);
}
if (!empty($contegargs["alloworigin"])) {
header('Access-Control-Allow-Origin: ' . $contegargs["alloworigin"]);
}
//header('Content-type: ' . any($output["type"], "text/html"));
if ($output["type"] == "ajax" || $output["type"] == "jsonp") {
print $this->tplmgr->PostProcess($output["content"], true);
} else {
print $this->tplmgr->PostProcess($output["content"]);
$showprofiler = !empty($this->request["args"]["timing"]) || $output["type"] == "text/html" && array_get($this->cfg->servers, "profiler.display");
if ($showprofiler) {
print Profiler::Display();
}
}
Profiler::StopTimer("WebApp::TimeToDisplay");
Profiler::StartTimer("WebApp::Display() - Conteg", 1);
new Conteg($contegargs);
Profiler::StopTimer("WebApp::Display() - Conteg");
if (Profiler::$log) {
Profiler::Log(DependencyManager::$locations["tmp"], $this->components->pagecfg["pagename"]);
}
}
}
示例2: Display
function Display($path = NULL, $args = NULL)
{
$path = any($path, $this->request["path"], "/");
$args = any($args, $this->request["args"], array());
if (!empty($this->components)) {
try {
$output = $this->components->Dispatch($path, $args, $this->request["type"]);
} catch (Exception $e) {
//print_pre($e);
$output["content"] = $this->HandleException($e);
}
$this->session->quit();
$headers = headers_list();
$isRedirect = false;
$ctype = null;
foreach ($headers as $header) {
list($k, $v) = explode(": ", $header, 2);
if ($k == "Location") {
$isRedirect = true;
}
if ($k == "Content-Type") {
$ctype = $v;
}
}
if (!$isRedirect) {
// Load settings from servers.ini
$contegargs = isset($this->cfg->servers["conteg"]) ? $this->cfg->servers["conteg"] : array();
$contegargs["charset"] = "UTF-8";
// FIXME - shouldn't be hardcoded, but we should also replace Conteg...
$contegargs["cache_control"]["macro"] = "public";
$contegargs["use_etags"] = true;
// And also from site config
$contegcfg = ConfigManager::get("conteg");
if (is_array($contegcfg)) {
$contegargs = array_merge($contegargs, $contegcfg);
}
if (empty($contegargs["type"])) {
$contegargs["type"] = any($ctype, $this->request["contenttype"], $output["responsetype"]);
}
// Merge type-specific policy settings from config if applicable
if (isset($contegargs["policy"]) && is_array($contegargs["policy"][$contegargs["type"]])) {
$contegargs = array_merge($contegargs, $contegargs["policy"][$contegargs["type"]]);
}
if (empty($contegargs["modified"])) {
// Set modified time to mtime of base directory if not set
$contegargs["modified"] = filemtime($this->rootdir);
}
if ($output["type"] == "ajax" || $output["type"] == "jsonp") {
print $this->tplmgr->PostProcess($output["content"], true);
} else {
print $this->tplmgr->PostProcess($output["content"]);
if (!empty($this->request["args"]["timing"])) {
print Profiler::Display();
}
}
if ($output["http_status"]) {
$contegargs["http_status"] = $output["http_status"];
}
Profiler::StopTimer("WebApp::TimeToDisplay");
Profiler::StartTimer("WebApp::Display() - Conteg", 1);
new Conteg($contegargs);
Profiler::StopTimer("WebApp::Display() - Conteg");
}
if (Profiler::$log) {
Profiler::Log(DependencyManager::$locations["tmp"], $this->components->pagecfg["pagename"]);
}
}
}