* @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null
* is passed.
*/
- protected function setCookie( $name, $value, $exp = 0, $secure = null, $params = array(), $request = null ) {
+ protected function setCookie(
+ $name, $value, $exp = 0, $secure = null, $params = array(), $request = null
+ ) {
if ( $request === null ) {
$request = $this->getRequest();
}
*/
private static function newFromLookup( $database, $field, $value, $ignoreInvalidDB = false ) {
global $wgSharedDB, $wgSharedTables;
- // If the user table is shared, perform the user query on it, but don't pass it to the UserRightsProxy,
+ // If the user table is shared, perform the user query on it,
+ // but don't pass it to the UserRightsProxy,
// as user rights are normally not shared.
if ( $wgSharedDB && in_array( 'user', $wgSharedTables ) ) {
$userdb = self::getDB( $wgSharedDB, $ignoreInvalidDB );
if ( $user ) {
$this->open( $server, $user, $password, $dbName );
}
-
- $isMaster = !is_null( $this->getLBInfo( 'master' ) );
- $trxProf = $this->getTransactionProfiler();
- $trxProf->recordConnection( $this->mServer, $this->mDBname, $isMaster );
}
/**
$db = $e->db;
}
+ $isMaster = !empty( $server['master'] );
+ $trxProf = Profiler::instance()->getTransactionProfiler();
+ $trxProf->recordConnection( $server['host'], $server['dbname'], $isMaster );
+
$db->setLBInfo( $server );
if ( isset( $server['fakeSlaveLag'] ) ) {
$db->setFakeSlaveLag( $server['fakeSlaveLag'] );