예제 #1
0
파일: stats.php 프로젝트: noikiy/kohana
<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
0
파일: core.php 프로젝트: jerfowler/yada
 /**
  *
  * @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;
 }