}
}
-
/**
* Intended to be compatible with the PEAR::DB wrapper functions.
* http://pear.php.net/manual/en/package.database.db.intro-execute.php
}
// Support 'NOT IN' by suffixing fieldname with an exclamation mark
- $not = false;
+ $not = false;
if( substr($field,-1) == '!' ) {
$not = true;
$field = substr($field, 0, -1 );
* when calling query() directly.
*
* @param $name String: database table name
- * @param $quoted Boolean: Automatically pass the table name through
+ * @param $quoted Boolean: Automatically pass the table name through
* addIdentifierQuotes() so that it can be used in a query.
* @return String: full database name
*/
$database = ( !$quoted || $this->isQuotedIdentifier( $database ) ? $database : $this->addIdentifierQuotes( $database ) );
$prefix = '';
}
-
+
$table = "{$prefix}{$table}";
if ( $quoted && !$this->isQuotedIdentifier( $table ) ) {
$table = $this->addIdentifierQuotes( "{$table}" );
}
/**
- * Returns if the given identifier looks quoted or not according to
+ * Returns if the given identifier looks quoted or not according to
* the database convention for quoting identifiers .
*
* @param $name string
* Note that unlike most database abstraction functions, this function does not
* automatically append database prefix, because it works at a lower
* abstraction level.
- * The table names passed to this function shall not be quoted (this
+ * The table names passed to this function shall not be quoted (this
* function calls addIdentifierQuotes when needed).
*
* @param $oldName String: name of table whose structure should be copied
$this->mLaggedSlaveMode = false;
$this->mErrorConnection = false;
$this->mAllowLagged = false;
- $this->mLoadMonitorClass = isset( $params['loadMonitor'] )
+ $this->mLoadMonitorClass = isset( $params['loadMonitor'] )
? $params['loadMonitor'] : 'LoadMonitor_MySQL';
foreach( $params['servers'] as $i => $server ) {
if ( $i === false ) {
# pickRandom() returned false
- # This is permanent and means the configuration or the load monitor
+ # This is permanent and means the configuration or the load monitor
# wants us to return false.
wfDebugLog( 'connect', __METHOD__.": pickRandom() returned false\n" );
wfProfileOut( __METHOD__ );
}
// Perform post-connection backoff
- $threshold = isset( $this->mServers[$i]['max threads'] )
+ $threshold = isset( $this->mServers[$i]['max threads'] )
? $this->mServers[$i]['max threads'] : false;
$backoff = $this->getLoadMonitor()->postConnectionBackoff( $conn, $threshold );
if ( $wiki !== false ) {
$this->reuseConnection( $conn );
}
-
+
if ( $backoff ) {
# Post-connection overload, don't use this server for now
$totalThreadsConnected += $backoff;
}
wfProfileOut( __METHOD__ );
}
-
+
/**
* Set the master wait position and wait for ALL slaves to catch up to it
*/
/**
* Get a connection by index
* This is the main entry point for this class.
- *
+ *
* @param $i Integer: server index
* @param $groups Array: query groups
* @param $wiki String: wiki ID
- *
+ *
* @return DatabaseBase
*/
public function &getConnection( $i, $groups = array(), $wiki = false ) {
* Results are cached for a short time in memcached, and indefinitely in the process cache
*
* @param $wiki
- *
+ *
* @return array
*/
function getLagTimes( $wiki = false ) {