本文整理汇总了PHP中Profiler::Display方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::Display方法的具体用法?PHP Profiler::Display怎么用?PHP Profiler::Display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::Display方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preg_replace
<?php
if (file_exists("../include/elation.php")) {
require_once "../include/elation.php";
} else {
require_once "elation.php";
}
$root = preg_replace("|/htdocs\$|", "", getcwd());
chdir($root);
elation_readpaths($root);
include_once "include/webapp_class.php";
include_once "lib/profiler.php";
Profiler::StartTimer("Total");
$req = array();
if (!empty($_GET)) {
if (isset($_GET["path"])) {
unset($_GET["path"]);
}
$req = array_merge($req, $_GET);
}
if (!empty($_POST)) {
$req = array_merge($req, $_POST);
}
$webapp = new WebApp($root, $req);
$webapp->Display();
Profiler::StopTimer("Total");
if (!empty($_REQUEST["_timing"])) {
print Profiler::Display();
}
示例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();
$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"]);
}
}
}
示例3: if
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<?if($layout->description!=""):?><meta name="description" content="{{$layout->description}}" /><?endif; ?>
<title>{{$layout->title}}</title>
<layout:includes />
<layout:styles />
<layout:blocks />
</head>
<body>
<div id="container">
<div id="header">
<img src="/i/logo.png" />
<a href="https://manage.slicehost.com" target="_blank">Slicehost.com</a>
</div>
<div id="nav">
<ul>
<li {{ ($loc=='') ? 'class="selected"' : '' }}><a href="/">Dashboard</a></li>
<li {{ ($loc=='slices') ? 'class="selected"' : '' }}><a href="/slices">Clouds</a></li>
<li {{ ($loc=='configs') ? 'class="selected"' : '' }}><a href="/configs">Configurations</a></li>
<li {{ ($loc=='inventories') ? 'class="selected"' : '' }}><a href="/inventory">Inventory</a></li>
<li {{ ($loc=='accounts') ? 'class="selected"' : '' }}><a href="/accounts">Accounts</a></li>
</ul>
</div>
<layout:content id="main" wrap="div" use_id="true" />
</div>
<? if (!isset($_GET['noprofiler'])) Profiler::Display(); ?>
</body>
</html>
示例4: controller_profiler
function controller_profiler($args)
{
return Profiler::Display(E_ALL);
}
示例5: 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"]);
}
}
}