當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Console::getQueries方法代碼示例

本文整理匯總了PHP中Console::getQueries方法的典型用法代碼示例。如果您正苦於以下問題:PHP Console::getQueries方法的具體用法?PHP Console::getQueries怎麽用?PHP Console::getQueries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Console的用法示例。


在下文中一共展示了Console::getQueries方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __destruct

 public function __destruct()
 {
     $this->logs = Console::getLogs();
     $this->queries = Console::getQueries();
     // log the time the application took to execute
     $start_time = $this->startTime;
     $end_time = $this->endTime = microtime();
     $start_time_array = explode(' ', $start_time);
     $end_time_array = explode(' ', $end_time);
     $time = ($end_time_array[1] + $end_time_array[0] - ($start_time_array[1] + $start_time_array[0])) * 1000;
     // make time readable
     $ret = $time;
     $formatter = 0;
     $formats = array('ms', 's', 'm');
     if ($time >= 1000 && $time < 60000) {
         $formatter = 1;
         $ret = $time / 1000;
     }
     if ($time >= 60000) {
         $formatter = 2;
         $ret = $time / 1000 / 60;
     }
     $this->executionTime = $ret = number_format($ret, 3, '.', '') . ' ' . $formats[$formatter];
     if ($this->appOptions['PRINT_APP_INFO_ON_LOAD'] == true && !$this->isProduction() && !$this->isTesting()) {
         echo '<pre>';
         print_r($this);
         echo '</pre>';
     }
 }
開發者ID:Jsnrkd,項目名稱:Walleye,代碼行數:29,代碼來源:walleye.php

示例2: __destruct

 /**
  * Print out the walleye object
  */
 public function __destruct()
 {
     if ($this->appOptions['PRINT_APP_INFO_ON_LOAD'] == true && $this->isProduction() == false && $this->isTesting() == false) {
         $this->logs = Console::getLogs();
         $this->queries = Console::getQueries();
         // log the time the application took to execute
         $start_time = $this->startTime;
         $end_time = $this->endTime = microtime();
         $start_time_array = explode(' ', $start_time);
         $end_time_array = explode(' ', $end_time);
         $time = ($end_time_array[1] + $end_time_array[0] - ($start_time_array[1] + $start_time_array[0])) * 1000;
         // make time readable
         $ret = $time;
         $formatter = 0;
         $formats = array('ms', 's', 'm');
         if ($time >= 1000 && $time < 60000) {
             $formatter = 1;
             $ret = $time / 1000;
         }
         if ($time >= 60000) {
             $formatter = 2;
             $ret = $time / 1000 / 60;
         }
         $this->executionTime = $ret = number_format($ret, 3, '.', '') . ' ' . $formats[$formatter];
         function convert($size)
         {
             $unit = array('b', 'kb', 'mb', 'gb', 'tb', 'pb');
             return @round($size / pow(1024, $i = floor(log($size, 1024))), 2) . ' ' . $unit[$i];
         }
         $this->peak_memory_usage = convert(memory_get_peak_usage(true));
         print_object($this);
     }
 }
開發者ID:Jmayhak,項目名稱:Walleye,代碼行數:36,代碼來源:walleye.php


注:本文中的Console::getQueries方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。