本文整理汇总了PHP中Profiler::group_stats方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::group_stats方法的具体用法?PHP Profiler::group_stats怎么用?PHP Profiler::group_stats使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::group_stats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<style type="text/css">
.kohana-waper {
position: fixed; bottom: 0; left: 0;
z-index: 1000;
background: #fff;width: 100%;
}
.kohana-waper .kohana {
height: 320px; overflow-x: hidden; overflow-y: auto;display: none;
}
<?php
include Kohana::find_file('views', 'profiler/style', 'css');
?>
</style>
<?php
$group_stats = Profiler::group_stats();
$group_cols = array('min', 'max', 'average', 'total');
$application_cols = array('min', 'max', 'average', 'current');
?>
<div class="kohana-waper">
<div style="height:30px;background:#999" id="kohana-stats-btn"></div>
<div class="kohana" id="kohana-stats">
<?php
foreach (Profiler::groups() as $group => $benchmarks) {
?>
<table class="profiler">
<tr class="group">
<th class="name" rowspan="2"><?php
echo __(ucfirst($group));
?>
示例2: _load
/**
*
* @param <type> $limit
* @param <type> $offset
*/
protected function _load($limit = NULL, $offset = NULL)
{
var_dump('Load');
//$this->_params = array();
var_dump($this->_state);
$build = TRUE;
if (isset($this->_queries['load']) and $this->_state === 'loaded') {
$build = isset($limit) !== $this->_limited;
}
var_dump($build);
var_dump($this->_limited);
if ($build) {
$this->_init_query('load');
if (!empty($limit)) {
$offset = is_null($offset) ? 0 : $offset;
$this->_queries['load']['limit'] = $this->_add_param('load', $limit, 'limit');
$this->_queries['load']['offset'] = $this->_add_param('load', $offset, 'offset');
$this->_limited == TRUE;
} else {
$this->_limited == FALSE;
}
if (!$this->_filtered['load']->contains($this->_model)) {
// $exclude = $this->_exclude();
// $exclude = $exclude->offsetExists($model)
// ? $exclude->offsetGet($model)
// : new ArrayObject(array());
$exclude = new ArrayObject(array());
$this->_build_select($this->_fields($this->_model), $this->_select($this->_model), $exclude);
$this->_process_joins('load');
$this->_filtered['load']->attach($this->_model);
$related = $this->_related();
if (isset($related['subquery'])) {
var_dump('Process Related: sub');
foreach ($related['subquery'] as $values) {
var_dump($values);
list($field, $related) = $values;
$sub = $related->model;
$expr = array();
$expr[] = $field->column();
$expr[] = 'IN (';
$expr[] = $sub->sub($related);
$expr[] = ')';
$this->_queries['load']['where'][] = implode(' ', $expr);
$this->_params['load'] += $sub->params('sub');
}
} else {
$this->_process_model('load', $this->_model);
}
}
$sql = $this->_build_select_query('load');
$this->_queries['load'] = $this->_prepare($sql);
} else {
if (!is_null($limit)) {
$offset = is_null($offset) ? 0 : $offset;
$this->_add_param('load', $limit, 'limit');
$this->_add_param('load', $offset, 'offset');
}
}
ini_set('xdebug.var_display_max_data', 2048);
var_dump($this->_queries['load']);
var_dump($this->_params['load']);
foreach ($this->_params['load'] as $key => $value) {
$this->_bind_value($this->_queries['load'], $key, $value);
}
$this->_execute($this->_queries['load']);
$this->_queries['load']->setFetchMode(PDO::FETCH_ASSOC);
$result = $this->_queries['load']->fetchAll();
ini_set('xdebug.var_display_max_depth', 4);
var_dump($result);
var_dump(Profiler::group_stats('yada pdo (default), prepare:'));
var_dump(Profiler::group_stats('yada pdo (default), execute:'));
return TRUE;
}