* Fail function, takes a Database as a parameter
* Set to false for default, 1 for ignore errors
*/
- function failFunction( $function = NULL ) {
+ function failFunction( $function = null ) {
return wfSetVar( $this->mFailFunction, $function );
}
/**
* Boolean, controls output of large amounts of debug information
*/
- function debug( $debug = NULL ) {
+ function debug( $debug = null ) {
return wfSetBit( $this->mFlags, DBO_DEBUG, $debug );
}
* Turns buffering of SQL result sets on (true) or off (false).
* Default is "on" and it should not be changed without good reasons.
*/
- function bufferResults( $buffer = NULL ) {
+ function bufferResults( $buffer = null ) {
if ( is_null( $buffer ) ) {
return !(bool)( $this->mFlags & DBO_NOBUFFER );
} else {
* code should use lastErrno() and lastError() to handle the
* situation as appropriate.
*/
- function ignoreErrors( $ignoreErrors = NULL ) {
+ function ignoreErrors( $ignoreErrors = null ) {
return wfSetBit( $this->mFlags, DBO_IGNORE, $ignoreErrors );
}
* The current depth of nested transactions
* @param $level Integer: , default NULL.
*/
- function trxLevel( $level = NULL ) {
+ function trxLevel( $level = null ) {
return wfSetVar( $this->mTrxLevel, $level );
}
/**
* Number of errors logged, only useful when errors are ignored
*/
- function errorCount( $count = NULL ) {
+ function errorCount( $count = null ) {
return wfSetVar( $this->mErrorCount, $count );
}
/**
* Properties passed down from the server info array of the load balancer
*/
- function getLBInfo( $name = NULL ) {
+ function getLBInfo( $name = null ) {
if ( is_null( $name ) ) {
return $this->mLBInfo;
} else {
if ( array_key_exists( $name, $this->mLBInfo ) ) {
return $this->mLBInfo[$name];
} else {
- return NULL;
+ return null;
}
}
}
- function setLBInfo( $name, $value = NULL ) {
+ function setLBInfo( $name, $value = null ) {
if ( is_null( $value ) ) {
$this->mLBInfo = $name;
} else {
global $wgOut, $wgDBprefix, $wgCommandLineMode;
# Can't get a reference if it hasn't been set yet
if ( !isset( $wgOut ) ) {
- $wgOut = NULL;
+ $wgOut = null;
}
$this->mFailFunction = $failFunction;
$table = $this->tableName( $table );
$res = $this->query( 'DESCRIBE '.$table, $fname );
if ( !$res ) {
- return NULL;
+ return null;
}
$found = false;
function indexExists( $table, $index, $fname = 'Database::indexExists' ) {
$info = $this->indexInfo( $table, $index, $fname );
if ( is_null( $info ) ) {
- return NULL;
+ return null;
} else {
return $info !== false;
}
$sql = 'SHOW INDEX FROM '.$table;
$res = $this->query( $sql, $fname );
if ( !$res ) {
- return NULL;
+ return null;
}
$result = array();
function indexUnique( $table, $index ) {
$indexInfo = $this->indexInfo( $table, $index );
if ( !$indexInfo ) {
- return NULL;
+ return null;
}
return !$indexInfo[0]->Non_unique;
}
* subclass will return an integer, and save the value for insertId()
*/
function nextSequenceValue( $seqName ) {
- return NULL;
+ return null;
}
/**