Пример #1
0
 /**
  * Initializate variables
  *
  * @param mysqli $connId
  */
 function __construct(&$connId)
 {
     $this->connId =& $connId;
     $this->resultId = 0;
     $this->queries = array();
     $this->queryTimes = array();
     $this->queryCount = 0;
     $this->errorLevel = 0;
     $this->errorDesc = "";
     $this->aSelect = array();
     $this->aFrom = array();
     $this->aJoin = array();
     $this->aWhere = array();
     $this->aLike = array();
     $this->aGroupby = array();
     $this->aHaving = array();
     $this->aLimit = false;
     $this->aOffset = false;
     $this->aOrder = false;
     $this->aOrderby = array();
     $this->aWherein = array();
     if (OSC_DEBUG_DB || OSC_DEBUG_DB_EXPLAIN) {
         $this->log = LogDatabase::newInstance();
     }
 }
Пример #2
0
 /**
  * At the end of the execution it prints the database debug if it's necessary
  * 
  * @since 2.3
  * @access private
  */
 function debug()
 {
     $log = LogDatabase::newInstance();
     if (OSC_DEBUG_DB_EXPLAIN) {
         $log->writeExplainMessages();
     }
     if (!OSC_DEBUG_DB) {
         return false;
     }
     if (defined('IS_AJAX') && !OSC_DEBUG_DB_LOG) {
         return false;
     }
     if (OSC_DEBUG_DB_LOG) {
         $log->writeMessages();
     } else {
         $log->printMessages();
     }
     unset($log);
     return true;
 }