Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/db/db_connection.php
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
* @var mysqli_result | * @var mysqli_result | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected $queryID = null; | protected $queryID = null; | ||||
/** | /** | ||||
* Function to handle sql errors | * Function to handle sql errors | ||||
* | * | ||||
* @var Array|string | * @var callable | ||||
* @access public | |||||
*/ | */ | ||||
public $errorHandler = ''; | protected $errorHandler = ''; | ||||
/** | /** | ||||
* Error code | * Error code | ||||
* | * | ||||
* @var int | * @var int | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected $errorCode = 0; | protected $errorCode = 0; | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | |||||
if ( class_exists('kApplication') ) { | if ( class_exists('kApplication') ) { | ||||
// prevents "Fatal Error" on 2nd installation step (when database is empty) | // prevents "Fatal Error" on 2nd installation step (when database is empty) | ||||
parent::__construct(); | parent::__construct(); | ||||
} | } | ||||
$this->serverIndex = $server_index; | $this->serverIndex = $server_index; | ||||
if ( !$error_handler ) { | if ( !$error_handler ) { | ||||
$this->errorHandler = Array(&$this, 'handleError'); | $this->setErrorHandler(array(&$this, 'handleError')); | ||||
} | } | ||||
else { | else { | ||||
$this->errorHandler = $error_handler; | $this->setErrorHandler($error_handler); | ||||
} | } | ||||
$this->_captureStatistics = defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !(defined('ADMIN') && ADMIN); | $this->_captureStatistics = defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !(defined('ADMIN') && ADMIN); | ||||
} | } | ||||
/** | /** | ||||
* Set's custom error | * Set's custom error | ||||
* | * | ||||
▲ Show 20 Lines • Show All 729 Lines • ▼ Show 20 Line(s) | |||||
// this is it, return the time (except -ve) | // this is it, return the time (except -ve) | ||||
return $process['Time'] > 0x7fffffff ? false : $process['Time']; | return $process['Time'] > 0x7fffffff ? false : $process['Time']; | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
/** | |||||
* Sets an error handler. | |||||
* | |||||
* @param callable $error_handler Error handler. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function setErrorHandler(callable $error_handler) | |||||
{ | |||||
$this->errorHandler = $error_handler; | |||||
} | |||||
} | } | ||||
Lint: CodingStandard.Classes.ClassDeclaration.NewlinesAfterCloseBrace: Closing brace of a class must be followed by a single blank line; found 2 | |||||
Expected 0 spaces before closing brace; 4 found Lint: CodingStandard.Classes.ClassDeclaration.SpaceBeforeCloseBrace: Expected 0 spaces before closing brace; 4 found | |||||
class kDBConnectionDebug extends kDBConnection { | class kDBConnectionDebug extends kDBConnection { | ||||
protected $_profileSQLs = false; | protected $_profileSQLs = false; | ||||
/** | /** | ||||
* Info about this database connection to show in debugger report | * Info about this database connection to show in debugger report | ||||
▲ Show 20 Lines • Show All 487 Lines • Show Last 20 Lines |
Closing brace of a class must be followed by a single blank line; found 2