예제 #1
0
파일: Profiler.php 프로젝트: ycheukf/debug
 /**
  * @return Profiler
  */
 public function profilerFinish()
 {
     $aReturn = parent::profilerFinish();
     $oProfile = end($this->profiles);
     $aInfo = $oProfile->toArray();
     $aDebugInfo = array("type" => __FUNCTION__, "connection_dsn" => $this->aConnectionParameters['dsn'], "time" => $aInfo['elapsed'], "sql" => $aInfo['sql'], "datas" => is_object($aInfo['parameters']) ? $aInfo['parameters']->getNamedArray() : $aInfo['parameters']);
     \YcheukfDebug\Model\Debug::dump($aDebugInfo, "[inline]---[db]---" . __CLASS__);
     return $aReturn;
 }
예제 #2
0
 public function profilerFinish()
 {
     parent::profilerFinish();
     /** @var Query $lastQuery */
     $lastQuery = end($this->profiles);
     $this->getLogger()->log($this->getPriority(), 'Query finished', array_intersect_key($lastQuery->toArray(), array_flip($this->getParametersFinish())));
     $maxProfiles = $this->getMaxProfiles();
     if ($maxProfiles > -1) {
         if (count($this->profiles) > $maxProfiles) {
             $this->profiles = array();
         }
     }
 }