Esempio n. 1
0
 /**
  * Roll back a transaction and return to autocommit mode.
  *
  * @return Zend_Db_Adapter_Abstract
  */
 public function rollBack()
 {
     $this->_connect();
     $q = $this->_profiler->queryStart('rollback', Zend_Db_Profiler::TRANSACTION);
     $this->_rollBack();
     $this->_profiler->queryEnd($q);
     return $this;
 }
Esempio n. 2
0
 /**
  * Obsługa rozpoczęcia kwerendy .
  * 
  * @param type $queryText
  * @param type $queryType
  * @return type 
  */
 public function queryStart($queryText, $queryType = null)
 {
     $queryId = parent::queryStart($queryText);
     if ($this->getEnabled()) {
         $message = "SQL({$queryId}): " . $queryText;
         // log the message as INFO message
         $this->_log->info($message);
     }
     return $queryId;
 }
Esempio n. 3
0
 /**
  * Starts a query. Creates a new query profile object (Zend_Db_Profiler_Query)
  *
  * @param string $queryText SQL statement
  * @param integer|null $queryType OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants
  * @return integer|null
  */
 public function queryStart($queryText, $queryType = null)
 {
     $this->_lastQueryId = parent::queryStart($queryText, $queryType);
     return $this->_lastQueryId;
 }
 /**
  * Starts a query.  Creates a new query profile object (Zend_Db_Profiler_Query)
  * and returns the "query profiler handle".  Run the query, then call
  * queryEnd() and pass it this handle to make the query as ended and
  * record the time.  If the profiler is not enabled, this takes no
  * action and immediately returns null.
  *
  * @param  string  $queryText   SQL statement
  * @param  integer $queryType   OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants
  * @return integer|null
  */
 public function queryStart($queryText, $queryType = null)
 {
     //        file_put_contents('/var/www/query.log',$queryText."\n\n",FILE_APPEND);
     return parent::queryStart($queryText, $queryType);
 }
Esempio n. 5
0
 public function getLastQueryProfile()
 {
     $queryId = parent::queryStart($this->_lastQueryText, $this->_lastQueryType);
     return parent::getLastQueryProfile();
 }
Esempio n. 6
0
 public function queryStart($queryText, $queryType = null)
 {
     Zend_Registry::get('logger')->log("DB QUERY: {$queryText}", Zend_Log::DEBUG);
     return parent::queryStart($queryText, $queryType);
 }