当前位置: 首页>>代码示例>>PHP>>正文


PHP Profiler::add方法代码示例

本文整理汇总了PHP中Profiler::add方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::add方法的具体用法?PHP Profiler::add怎么用?PHP Profiler::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiler的用法示例。


在下文中一共展示了Profiler::add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:40,代码来源:MY_Profiler.php

示例2: 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);
 }
开发者ID:bluelovers,项目名称:Kohana-Clone,代码行数:25,代码来源:Profiler.php


注:本文中的Profiler::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。