本文整理汇总了PHP中Profiler::show方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::show方法的具体用法?PHP Profiler::show怎么用?PHP Profiler::show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::show方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cache
/**
* Cache data.
*
* @return void
*/
public static function cache()
{
if (!Profiler::show('cache')) {
return;
}
$queries = Cache::$queries;
$table = new Profiler_Table();
$table->add_column();
$table->add_column('kp-column kp-data');
$table->add_column('kp-column kp-data');
$table->add_column('kp-column kp-data');
$table->add_row(array('Cache', 'Gets', 'Sets', 'Deletes'), 'kp-title', 'background-color: #E0FFE0');
text::alternate();
$total_gets = $total_sets = $total_deletes = 0;
$total_requests = array();
foreach ($queries as $type => $requests) {
foreach ($requests as $query) {
if (!isset($total_requests[$query])) {
$total_requests[$query] = array('gets' => 0, 'sets' => 0, 'deletes' => 0);
}
$total_requests[$query][$type]++;
}
}
foreach ($total_requests as $query => $types) {
$data = array($query, $types['gets'], $types['sets'], $types['deletes']);
$class = text::alternate('', 'kp-altrow');
$table->add_row($data, $class);
$total_gets += $types['gets'];
$total_sets += $types['sets'];
$total_deletes += $types['deletes'];
}
$data = array('Total: ' . count($total_requests), $total_gets, $total_sets, $total_deletes);
$table->add_row($data, 'kp-totalrow');
Profiler::add($table);
}
示例2: isset
}
// Connect to database
require_once "core/model/DB.php";
// Redirect to the installer if no database is selected
if (!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) {
$s = isset($_SERVER['SSL']) || isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 's' : '';
$installURL = "http{$s}://" . $_SERVER['HTTP_HOST'] . BASE_URL . '/install.php';
// The above dirname() will equate to "\" on Windows when installing directly from http://localhost (not using
// a sub-directory), this really messes things up in some browsers. Let's get rid of the backslashes
$installURL = str_replace('\\', '', $installURL);
header("Location: {$installURL}");
die;
}
if (isset($_GET['debug_profile'])) {
Profiler::mark('DB::connect');
}
DB::connect($databaseConfig);
if (isset($_GET['debug_profile'])) {
Profiler::unmark('DB::connect');
}
if (isset($_GET['debug_profile'])) {
Profiler::unmark('main.php init');
}
// Direct away - this is the "main" function, that hands control to the appropriate controller
Director::direct($url);
if (isset($_GET['debug_profile'])) {
Profiler::unmark('all_execution');
if (!Director::isLive()) {
Profiler::show(isset($_GET['profile_trace']));
}
}
示例3: cookies
/**
* Cookie data.
*
* @return void
*/
public static function cookies()
{
if (empty($_COOKIE)) {
return;
}
if (!Profiler::show('cookies')) {
return;
}
$table = new Profiler_Table();
$table->add_column('kp-name');
$table->add_column();
$table->add_row(array(__('Cookies'), __('Value')), 'kp-title', 'background-color: #FFF4D7');
text::alternate();
foreach ($_COOKIE as $name => $value) {
$data = array($name, $value);
$class = text::alternate('', 'kp-altrow');
$table->add_row($data, $class);
}
Profiler::add($table);
}