コード例 #1
0
ファイル: Exception.php プロジェクト: vbo/DB_Adapter
 private function _processTrace()
 {
     require_once 'DB/Adapter/ErrorTracker.php';
     $this->smartTrace = DB_Adapter_ErrorTracker::findCaller($this->getTrace());
     $this->file = isset($this->smartTrace[0]['file']) ? $this->smartTrace[0]['file'] : $this->file;
     $this->line = isset($this->smartTrace[0]['line']) ? $this->smartTrace[0]['line'] : $this->line;
 }
コード例 #2
0
ファイル: Exception.php プロジェクト: simbajoe/DB_Adapter
 public function __toString()
 {
     $context = "unknown";
     require_once 'DB/Adapter/ErrorTracker.php';
     $c = DB_Adapter_ErrorTracker::findCaller($this->getTrace(), true);
     if ($c) {
         $context = isset($c['file']) ? $c['file'] : '?';
         $context .= ' on line ' . (isset($c['line']) ? $c['line'] : '?');
     }
     $errmsg = get_class($this) . ($context ? " in {$context}" : "");
     $errmsg .= "\n" . rtrim($this->message);
     $errmsg .= "\n" . "Error occurred in {$this->primary_info}";
     return $errmsg;
 }
コード例 #3
0
ファイル: DB.php プロジェクト: vbo/DB_Adapter
 /**
  * Must be called on each query.
  * If $noTrace is true, library caller is not solved (speed improvement).
  * @todo Fix it
  * @return void
  */
 protected function _logQuery($query, $noTrace = false)
 {
     if (!$this->_logger) {
         return;
     }
     $this->_expandPlaceholders($query, $useNative = false);
     $message = $query[0];
     $context = null;
     if (!$noTrace) {
         require_once 'DB/Adapter/ErrorTracker.php';
         $context = DB_Adapter_ErrorTracker::findCaller($trace = null, $returnCaller = true);
     }
     $this->_logger->log($context, $message);
 }