Merge "Localisation updates from https://translatewiki.net."
authorTranslation updater bot <l10n-bot@translatewiki.net>
Mon, 5 Oct 2015 20:03:08 +0000 (20:03 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 5 Oct 2015 20:03:08 +0000 (20:03 +0000)
27 files changed:
RELEASE-NOTES-1.27
autoload.php
includes/Block.php
includes/DefaultSettings.php
includes/Export.php
includes/Revision.php
includes/RevisionList.php
includes/SiteStats.php
includes/Title.php
includes/UserRightsProxy.php
includes/api/ApiBase.php
includes/api/ApiPageSet.php
includes/cache/BacklinkCache.php
includes/cache/LinkBatch.php
includes/changetags/ChangeTagsLogList.php
includes/changetags/ChangeTagsRevisionList.php
includes/db/Database.php
includes/db/DatabasePostgres.php
includes/deferred/SiteStatsUpdate.php
includes/externalstore/ExternalStoreDB.php
includes/filerepo/file/LocalFile.php
includes/logging/LogEventsList.php
includes/objectcache/SqlBagOStuff.php
includes/page/WikiPage.php
includes/search/SearchDatabase.php
includes/utils/BatchRowIterator.php
includes/utils/BatchRowWriter.php

index 1670552..65e0799 100644 (file)
@@ -14,6 +14,8 @@ production.
   $wgResourceLoaderMinifierMaxLineLength, because there was little value in
   making the behavior configurable. The default values (`false` for the former,
   1000 for the latter) are now hard-coded.
+* $wgDebugDumpSqlLength was removed (deprecated in 1.24).
+* $wgDebugDBTransactions was removed (deprecated in 1.20).
 
 === New features in 1.27 ===
 * $wgDataCenterId and $wgDataCenterRoles where added, which will serve as
index 9c859b7..413a0f1 100644 (file)
@@ -933,7 +933,6 @@ $wgAutoloadLocalClasses = array(
        'PostgresBlob' => __DIR__ . '/includes/db/DatabasePostgres.php',
        'PostgresField' => __DIR__ . '/includes/db/DatabasePostgres.php',
        'PostgresInstaller' => __DIR__ . '/includes/installer/PostgresInstaller.php',
-       'PostgresTransactionState' => __DIR__ . '/includes/db/DatabasePostgres.php',
        'PostgresUpdater' => __DIR__ . '/includes/installer/PostgresUpdater.php',
        'Preferences' => __DIR__ . '/includes/Preferences.php',
        'PreferencesForm' => __DIR__ . '/includes/Preferences.php',
index c5a16fc..0ec4ad1 100644 (file)
@@ -452,7 +452,7 @@ class Block {
         * Insert a block into the block table. Will fail if there is a conflicting
         * block (same name and options) already in the database.
         *
-        * @param DatabaseBase $dbw If you have one available
+        * @param IDatabase $dbw If you have one available
         * @return bool|array False on failure, assoc array on success:
         *      ('id' => block ID, 'autoIds' => array of autoblock IDs)
         */
@@ -556,7 +556,7 @@ class Block {
 
        /**
         * Get an array suitable for passing to $dbw->insert() or $dbw->update()
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return array
         */
        protected function getDatabaseArray( $db = null ) {
index 339ae9b..deb85f5 100644 (file)
@@ -5453,13 +5453,6 @@ $wgDebugRawPage = false;
  */
 $wgDebugComments = false;
 
-/**
- * Extensive database transaction state debugging
- *
- * @since 1.20
- */
-$wgDebugDBTransactions = false;
-
 /**
  * Write SQL queries to the debug log.
  *
@@ -5470,13 +5463,6 @@ $wgDebugDBTransactions = false;
  */
 $wgDebugDumpSql = false;
 
-/**
- * Trim logged SQL queries to this many bytes. Set 0/false/null to do no
- * trimming.
- * @since 1.24
- */
-$wgDebugDumpSqlLength = 500;
-
 /**
  * Performance expectations for DB usage
  *
index adab21c..b4d7737 100644 (file)
@@ -79,7 +79,7 @@ class WikiExporter {
         * make additional queries to pull source data while the
         * main query is still running.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param int|array $history One of WikiExporter::FULL, WikiExporter::CURRENT,
         *   WikiExporter::RANGE or WikiExporter::STABLE, or an associative array:
         *   - offset: non-inclusive offset at which to start the query
index a7a87e8..24c025f 100644 (file)
@@ -223,7 +223,7 @@ class Revision implements IDBAccessObject {
         * Load a page revision from a given revision ID number.
         * Returns null if no such revision can be found.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param int $id
         * @return Revision|null
         */
@@ -236,7 +236,7 @@ class Revision implements IDBAccessObject {
         * that's attached to a given page. If not attached
         * to that page, will return null.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param int $pageid
         * @param int $id
         * @return Revision|null
@@ -256,7 +256,7 @@ class Revision implements IDBAccessObject {
         * that's attached to a given page. If not attached
         * to that page, will return null.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param Title $title
         * @param int $id
         * @return Revision|null
@@ -281,7 +281,7 @@ class Revision implements IDBAccessObject {
         * WARNING: Timestamps may in some circumstances not be unique,
         * so this isn't the best key to use.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param Title $title
         * @param string $timestamp
         * @return Revision|null
@@ -333,7 +333,7 @@ class Revision implements IDBAccessObject {
         * Given a set of conditions, fetch a revision from
         * the given database connection.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param array $conditions
         * @param int $flags (optional)
         * @return Revision|null
@@ -375,7 +375,7 @@ class Revision implements IDBAccessObject {
         * which will return matching database rows with the
         * fields necessary to build Revision objects.
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param array $conditions
         * @param int $flags (optional)
         * @return ResultWrapper
@@ -519,7 +519,7 @@ class Revision implements IDBAccessObject {
 
        /**
         * Do a batched query to get the parent revision lengths
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param array $revIds
         * @return array
         */
@@ -1206,7 +1206,7 @@ class Revision implements IDBAccessObject {
         * Get previous revision Id for this page_id
         * This is used to populate rev_parent_id on save
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return int
         */
        private function getPreviousRevisionId( $db ) {
@@ -1359,7 +1359,7 @@ class Revision implements IDBAccessObject {
         * Insert a new revision into the database, returning the new revision ID
         * number on success and dies horribly on failure.
         *
-        * @param DatabaseBase $dbw (master connection)
+        * @param IDatabase $dbw (master connection)
         * @throws MWException
         * @return int
         */
@@ -1596,7 +1596,7 @@ class Revision implements IDBAccessObject {
         * Such revisions can for instance identify page rename
         * operations and other such meta-modifications.
         *
-        * @param DatabaseBase $dbw
+        * @param IDatabase $dbw
         * @param int $pageId ID number of the page to read from
         * @param string $summary Revision's summary
         * @param bool $minor Whether the revision should be considered as minor
@@ -1746,7 +1746,7 @@ class Revision implements IDBAccessObject {
        /**
         * Get count of revisions per page...not very efficient
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param int $id Page id
         * @return int
         */
@@ -1762,7 +1762,7 @@ class Revision implements IDBAccessObject {
        /**
         * Get count of revisions per page...not very efficient
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param Title $title
         * @return int
         */
@@ -1782,7 +1782,7 @@ class Revision implements IDBAccessObject {
         * @since 1.20
         * @deprecated since 1.24
         *
-        * @param DatabaseBase|int $db The Database to perform the check on. May be given as a
+        * @param IDatabase|int $db The Database to perform the check on. May be given as a
         *        Database object or a database identifier usable with wfGetDB.
         * @param int $pageId The ID of the page in question
         * @param int $userId The ID of the user in question
index e417473..1df0ca0 100644 (file)
@@ -121,7 +121,7 @@ abstract class RevisionListBase extends ContextSource {
 
        /**
         * Do the DB query to iterate through the objects.
-        * @param DatabaseBase $db DatabaseBase object to use for the query
+        * @param IDatabase $db DatabaseBase object to use for the query
         */
        abstract public function doQuery( $db );
 
@@ -264,7 +264,7 @@ class RevisionList extends RevisionListBase {
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return mixed
         */
        public function doQuery( $db ) {
index 81172a1..64e5ea0 100644 (file)
@@ -98,7 +98,7 @@ class SiteStats {
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return bool|ResultWrapper
         */
        static function doLoad( $db ) {
@@ -364,7 +364,7 @@ class SiteStatsInit {
         * Do all updates and commit them. More or less a replacement
         * for the original initStats, but without output.
         *
-        * @param DatabaseBase|bool $database
+        * @param IDatabase|bool $database
         * - Boolean: whether to use the master DB
         * - DatabaseBase: database connection to use
         * @param array $options Array of options, may contain the following values
index 9e78e10..aef696f 100644 (file)
@@ -4430,7 +4430,7 @@ class Title {
        /**
         * Get the last touched timestamp
         *
-        * @param DatabaseBase $db Optional db
+        * @param IDatabase $db Optional db
         * @return string Last-touched timestamp
         */
        public function getTouched( $db = null ) {
index 2c7032f..0d1708f 100644 (file)
@@ -31,7 +31,7 @@ class UserRightsProxy {
         *
         * @see newFromId()
         * @see newFromName()
-        * @param DatabaseBase $db Db connection
+        * @param IDatabase $db Db connection
         * @param string $database Database name
         * @param string $name User name
         * @param int $id User ID
index f5ceb33..1465543 100644 (file)
@@ -2820,7 +2820,7 @@ abstract class ApiBase extends ContextSource {
 
        /**
         * @deprecated since 1.25, always returns empty string
-        * @param DatabaseBase|bool $db
+        * @param IDatabase|bool $db
         * @return string
         */
        public function getModuleProfileName( $db = false ) {
index ceb0905..17c148e 100644 (file)
@@ -701,7 +701,7 @@ class ApiPageSet extends ApiBase {
         * Note that the query result must include the columns returned by
         * $this->getPageTableFields().
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param ResultWrapper $queryResult Query result object
         */
        public function populateFromQueryResult( $db, $queryResult ) {
index 1296c13..549ac84 100644 (file)
@@ -133,7 +133,7 @@ class BacklinkCache {
        /**
         * Set the Database object to use
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         */
        public function setDB( $db ) {
                $this->db = $db;
index 698b304..d98888f 100644 (file)
@@ -231,7 +231,7 @@ class LinkBatch {
         * Construct a WHERE clause which will match all the given titles.
         *
         * @param string $prefix The appropriate table's field name prefix ('page', 'pl', etc)
-        * @param DatabaseBase $db DatabaseBase object to use
+        * @param IDatabase $db DatabaseBase object to use
         * @return string|bool String with SQL where clause fragment, or false if no items.
         */
        public function constructSet( $prefix, $db ) {
index 4526ee3..3bffbdf 100644 (file)
@@ -29,7 +29,7 @@ class ChangeTagsLogList extends ChangeTagsList {
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return mixed
         */
        public function doQuery( $db ) {
index ec401bc..f0dfc0f 100644 (file)
@@ -29,7 +29,7 @@ class ChangeTagsRevisionList extends ChangeTagsList {
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return mixed
         */
        public function doQuery( $db ) {
index 05d1934..2bd436e 100644 (file)
@@ -479,11 +479,7 @@ abstract class DatabaseBase implements IDatabase {
         *   - DBO_PERSISTENT: use persistant database connection
         */
        public function setFlag( $flag ) {
-               global $wgDebugDBTransactions;
                $this->mFlags |= $flag;
-               if ( ( $flag & DBO_TRX ) && $wgDebugDBTransactions ) {
-                       wfDebug( "Implicit transactions are now enabled.\n" );
-               }
        }
 
        /**
@@ -498,11 +494,7 @@ abstract class DatabaseBase implements IDatabase {
         *   - DBO_PERSISTENT: use persistant database connection
         */
        public function clearFlag( $flag ) {
-               global $wgDebugDBTransactions;
                $this->mFlags &= ~$flag;
-               if ( ( $flag & DBO_TRX ) && $wgDebugDBTransactions ) {
-                       wfDebug( "Implicit transactions are now disabled.\n" );
-               }
        }
 
        /**
@@ -607,7 +599,7 @@ abstract class DatabaseBase implements IDatabase {
         * @param array $params Parameters passed from DatabaseBase::factory()
         */
        function __construct( array $params ) {
-               global $wgDBprefix, $wgDBmwschema, $wgCommandLineMode, $wgDebugDBTransactions;
+               global $wgDBprefix, $wgDBmwschema, $wgCommandLineMode;
 
                $server = $params['host'];
                $user = $params['user'];
@@ -622,14 +614,8 @@ abstract class DatabaseBase implements IDatabase {
                if ( $this->mFlags & DBO_DEFAULT ) {
                        if ( $wgCommandLineMode ) {
                                $this->mFlags &= ~DBO_TRX;
-                               if ( $wgDebugDBTransactions ) {
-                                       wfDebug( "Implicit transaction open disabled.\n" );
-                               }
                        } else {
                                $this->mFlags |= DBO_TRX;
-                               if ( $wgDebugDBTransactions ) {
-                                       wfDebug( "Implicit transaction open enabled.\n" );
-                               }
                        }
                }
 
@@ -926,7 +912,7 @@ abstract class DatabaseBase implements IDatabase {
         *     for a successful read query, or false on failure if $tempIgnore set
         */
        public function query( $sql, $fname = __METHOD__, $tempIgnore = false ) {
-               global $wgUser, $wgDebugDBTransactions, $wgDebugDumpSqlLength;
+               global $wgUser;
 
                $this->mLastQuery = $sql;
 
@@ -956,9 +942,6 @@ abstract class DatabaseBase implements IDatabase {
                $commentedSql = preg_replace( '/\s|$/', " /* $fname $userName */ ", $sql, 1 );
 
                if ( !$this->mTrxLevel && $this->getFlag( DBO_TRX ) && $this->isTransactableQuery( $sql ) ) {
-                       if ( $wgDebugDBTransactions ) {
-                               wfDebug( "Implicit transaction start.\n" );
-                       }
                        $this->begin( __METHOD__ . " ($fname)" );
                        $this->mTrxAutomatic = true;
                }
@@ -990,15 +973,7 @@ abstract class DatabaseBase implements IDatabase {
                }
 
                if ( $this->debug() ) {
-                       static $cnt = 0;
-
-                       $cnt++;
-                       $sqlx = $wgDebugDumpSqlLength ? substr( $commentedSql, 0, $wgDebugDumpSqlLength )
-                               : $commentedSql;
-                       $sqlx = strtr( $sqlx, "\t\n", '  ' );
-
-                       $master = $isMaster ? 'master' : 'slave';
-                       wfDebug( "Query {$this->mDBname} ($cnt) ($master): $sqlx\n" );
+                       wfDebugLog( 'queries', sprintf( "%s: %s", $this->mDBname, $sql ) );
                }
 
                $queryId = MWDebug::query( $sql, $fname, $isMaster );
@@ -1754,7 +1729,7 @@ abstract class DatabaseBase implements IDatabase {
         *
         * @return string
         */
-       static function generalizeSQL( $sql ) {
+       protected static function generalizeSQL( $sql ) {
                # This does the same as the regexp below would do, but in such a way
                # as to avoid crashing php on some large strings.
                # $sql = preg_replace( "/'([^\\\\']|\\\\.)*'|\"([^\\\\\"]|\\\\.)*\"/", "'X'", $sql );
@@ -3438,8 +3413,6 @@ abstract class DatabaseBase implements IDatabase {
         * @throws DBError
         */
        final public function begin( $fname = __METHOD__ ) {
-               global $wgDebugDBTransactions;
-
                if ( $this->mTrxLevel ) { // implicit commit
                        if ( $this->mTrxAtomicLevels ) {
                                // If the current transaction was an automatic atomic one, then we definitely have
@@ -3460,9 +3433,8 @@ abstract class DatabaseBase implements IDatabase {
                                        ) )
                                );
                        } else {
-                               // if the transaction was automatic and has done write operations,
-                               // log it if $wgDebugDBTransactions is enabled.
-                               if ( $this->mTrxDoneWrites && $wgDebugDBTransactions ) {
+                               // if the transaction was automatic and has done write operations
+                               if ( $this->mTrxDoneWrites ) {
                                        wfDebug( "$fname: Automatic transaction with writes in progress" .
                                                " (from {$this->mTrxFname}), performing implicit commit!\n"
                                        );
index aaa1c6e..e7e16e8 100644 (file)
@@ -128,89 +128,6 @@ SQL;
        }
 }
 
-/**
- * Used to debug transaction processing
- * Only used if $wgDebugDBTransactions is true
- *
- * @since 1.19
- * @ingroup Database
- */
-class PostgresTransactionState {
-       private static $WATCHED = array(
-               array(
-                       "desc" => "%s: Connection state changed from %s -> %s\n",
-                       "states" => array(
-                               PGSQL_CONNECTION_OK => "OK",
-                               PGSQL_CONNECTION_BAD => "BAD"
-                       )
-               ),
-               array(
-                       "desc" => "%s: Transaction state changed from %s -> %s\n",
-                       "states" => array(
-                               PGSQL_TRANSACTION_IDLE => "IDLE",
-                               PGSQL_TRANSACTION_ACTIVE => "ACTIVE",
-                               PGSQL_TRANSACTION_INTRANS => "TRANS",
-                               PGSQL_TRANSACTION_INERROR => "ERROR",
-                               PGSQL_TRANSACTION_UNKNOWN => "UNKNOWN"
-                       )
-               )
-       );
-
-       /** @var array */
-       private $mNewState;
-
-       /** @var array */
-       private $mCurrentState;
-
-       public function __construct( $conn ) {
-               $this->mConn = $conn;
-               $this->update();
-               $this->mCurrentState = $this->mNewState;
-       }
-
-       public function update() {
-               $this->mNewState = array(
-                       pg_connection_status( $this->mConn ),
-                       pg_transaction_status( $this->mConn )
-               );
-       }
-
-       public function check() {
-               global $wgDebugDBTransactions;
-               $this->update();
-               if ( $wgDebugDBTransactions ) {
-                       if ( $this->mCurrentState !== $this->mNewState ) {
-                               $old = reset( $this->mCurrentState );
-                               $new = reset( $this->mNewState );
-                               foreach ( self::$WATCHED as $watched ) {
-                                       if ( $old !== $new ) {
-                                               $this->log_changed( $old, $new, $watched );
-                                       }
-                                       $old = next( $this->mCurrentState );
-                                       $new = next( $this->mNewState );
-                               }
-                       }
-               }
-               $this->mCurrentState = $this->mNewState;
-       }
-
-       protected function describe_changed( $status, $desc_table ) {
-               if ( isset( $desc_table[$status] ) ) {
-                       return $desc_table[$status];
-               } else {
-                       return "STATUS " . $status;
-               }
-       }
-
-       protected function log_changed( $old, $new, $watched ) {
-               wfDebug( sprintf( $watched["desc"],
-                       $this->mConn,
-                       $this->describe_changed( $old, $watched["states"] ),
-                       $this->describe_changed( $new, $watched["states"] )
-               ) );
-       }
-}
-
 /**
  * Manage savepoints within a transaction
  * @ingroup Database
@@ -252,11 +169,7 @@ class SavepointPostgres {
        }
 
        protected function query( $keyword, $msg_ok, $msg_failed ) {
-               global $wgDebugDBTransactions;
                if ( $this->dbw->doQuery( $keyword . " " . $this->id ) !== false ) {
-                       if ( $wgDebugDBTransactions ) {
-                               wfDebug( sprintf( $msg_ok, $this->id ) );
-                       }
                } else {
                        wfDebug( sprintf( $msg_failed, $this->id ) );
                }
@@ -307,9 +220,6 @@ class DatabasePostgres extends DatabaseBase {
        /** @var string Connect string to open a PostgreSQL connection */
        private $connectString;
 
-       /** @var PostgresTransactionState */
-       private $mTransactionState;
-
        /** @var string */
        private $mCoreSchema;
 
@@ -428,7 +338,6 @@ class DatabasePostgres extends DatabaseBase {
                }
 
                $this->mOpened = true;
-               $this->mTransactionState = new PostgresTransactionState( $this->mConn );
 
                global $wgCommandLineMode;
                # If called from the command-line (e.g. importDump), only show errors
@@ -486,12 +395,10 @@ class DatabasePostgres extends DatabaseBase {
                if ( function_exists( 'mb_convert_encoding' ) ) {
                        $sql = mb_convert_encoding( $sql, 'UTF-8' );
                }
-               $this->mTransactionState->check();
                if ( pg_send_query( $this->mConn, $sql ) === false ) {
                        throw new DBUnexpectedError( $this, "Unable to post new query to PostgreSQL\n" );
                }
                $this->mLastResult = pg_get_result( $this->mConn );
-               $this->mTransactionState->check();
                $this->mAffectedRows = null;
                if ( pg_result_error( $this->mLastResult ) ) {
                        return false;
index ae75a75..d135a80 100644 (file)
@@ -125,7 +125,7 @@ class SiteStatsUpdate implements DeferrableUpdate {
        }
 
        /**
-        * @param DatabaseBase $dbw
+        * @param IDatabase $dbw
         * @return bool|mixed
         */
        public static function cacheUpdate( $dbw ) {
index 952bf63..cc70960 100644 (file)
@@ -156,7 +156,7 @@ class ExternalStoreDB extends ExternalStoreMedium {
        /**
         * Get the 'blobs' table name for this database
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return string Table name ('blobs' by default)
         */
        function getTable( $db ) {
index d146708..1bccf81 100644 (file)
@@ -433,7 +433,7 @@ class LocalFile extends File {
        }
 
        /**
-        * @param DatabaseBase $dbr
+        * @param IDatabase $dbr
         * @param string $fname
         * @return array|bool
         */
index 1b56584..4c0bd8e 100644 (file)
@@ -646,7 +646,7 @@ class LogEventsList extends ContextSource {
        /**
         * SQL clause to skip forbidden log types for this user
         *
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param string $audience Public/user
         * @param User $user User to check, or null to use $wgUser
         * @return string|bool String on success, false on failure.
index e08fec9..91189c8 100644 (file)
@@ -131,8 +131,6 @@ class SqlBagOStuff extends BagOStuff {
         * @throws MWException
         */
        protected function getDB( $serverIndex ) {
-               global $wgDebugDBTransactions;
-
                if ( !isset( $this->conns[$serverIndex] ) ) {
                        if ( $serverIndex >= $this->numServers ) {
                                throw new MWException( __METHOD__ . ": Invalid server index \"$serverIndex\"" );
@@ -147,9 +145,6 @@ class SqlBagOStuff extends BagOStuff {
 
                        # If server connection info was given, use that
                        if ( $this->serverInfos ) {
-                               if ( $wgDebugDBTransactions ) {
-                                       $this->logger->debug( "Using provided serverInfo for SqlBagOStuff" );
-                               }
                                $info = $this->serverInfos[$serverIndex];
                                $type = isset( $info['type'] ) ? $info['type'] : 'mysql';
                                $host = isset( $info['host'] ) ? $info['host'] : '[unknown]';
@@ -173,9 +168,7 @@ class SqlBagOStuff extends BagOStuff {
                                        $db = wfGetDB( $index );
                                }
                        }
-                       if ( $wgDebugDBTransactions ) {
-                               $this->logger->debug( sprintf( "Connection %s will be used for SqlBagOStuff", $db ) );
-                       }
+                       $this->logger->debug( sprintf( "Connection %s will be used for SqlBagOStuff", $db ) );
                        $this->conns[$serverIndex] = $db;
                }
 
index 409e7ea..98cc80a 100644 (file)
@@ -298,7 +298,7 @@ class WikiPage implements Page, IDBAccessObject {
 
        /**
         * Fetch a page record with the given conditions
-        * @param DatabaseBase $dbr
+        * @param IDatabase $dbr
         * @param array $conditions
         * @param array $options
         * @return object|bool Database result resource, or false on failure
@@ -319,7 +319,7 @@ class WikiPage implements Page, IDBAccessObject {
         * Fetch a page record matching the Title object's namespace and title
         * using a sanitized title string
         *
-        * @param DatabaseBase $dbr
+        * @param IDatabase $dbr
         * @param Title $title
         * @param array $options
         * @return object|bool Database result resource, or false on failure
@@ -333,7 +333,7 @@ class WikiPage implements Page, IDBAccessObject {
        /**
         * Fetch a page record matching the requested ID
         *
-        * @param DatabaseBase $dbr
+        * @param IDatabase $dbr
         * @param int $id
         * @param array $options
         * @return object|bool Database result resource, or false on failure
@@ -1194,7 +1194,7 @@ class WikiPage implements Page, IDBAccessObject {
         * or else the record will be left in a funky state.
         * Best if all done inside a transaction.
         *
-        * @param DatabaseBase $dbw
+        * @param IDatabase $dbw
         * @return int|bool The newly created page_id key; false if the title already existed
         */
        public function insertOn( $dbw ) {
@@ -1228,7 +1228,7 @@ class WikiPage implements Page, IDBAccessObject {
        /**
         * Update the page record to point to a newly saved revision.
         *
-        * @param DatabaseBase $dbw
+        * @param IDatabase $dbw
         * @param Revision $revision For ID number, and text used to set
         *   length and redirect status fields
         * @param int $lastRevision If given, will not overwrite the page field
@@ -1295,7 +1295,7 @@ class WikiPage implements Page, IDBAccessObject {
        /**
         * Add row to the redirect table if this is a redirect, remove otherwise.
         *
-        * @param DatabaseBase $dbw
+        * @param IDatabase $dbw
         * @param Title $redirectTitle Title object pointing to the redirect target,
         *   or NULL if this is not a redirect
         * @param null|bool $lastRevIsRedirect If given, will optimize adding and
@@ -1334,7 +1334,7 @@ class WikiPage implements Page, IDBAccessObject {
         *
         * @deprecated since 1.24, use updateRevisionOn instead
         *
-        * @param DatabaseBase $dbw
+        * @param IDatabase $dbw
         * @param Revision $revision
         * @return bool
         */
index 82d0907..5b18b7c 100644 (file)
  */
 class SearchDatabase extends SearchEngine {
        /**
-        * @var DatabaseBase Slave database for reading from for results
+        * @var IDatabase Slave database for reading from for results
         */
        protected $db;
 
        /**
         * Constructor
-        * @param DatabaseBase $db The database to search from
+        * @param IDatabase $db The database to search from
         */
-       public function __construct( DatabaseBase $db = null ) {
+       public function __construct( IDatabase $db = null ) {
                if ( $db ) {
                        $this->db = $db;
                } else {
index fb2ae2a..59350e6 100644 (file)
@@ -78,13 +78,13 @@ class BatchRowIterator implements RecursiveIterator {
        private $key;
 
        /**
-        * @param DatabaseBase $db         The database to read from
+        * @param IDatabase $db The database to read from
         * @param string       $table      The name of the table to read from
         * @param string|array $primaryKey The name or names of the primary key columns
         * @param integer      $batchSize  The number of rows to fetch per iteration
         * @throws MWException
         */
-       public function __construct( DatabaseBase $db, $table, $primaryKey, $batchSize ) {
+       public function __construct( IDatabase $db, $table, $primaryKey, $batchSize ) {
                if ( $batchSize < 1 ) {
                        throw new MWException( 'Batch size must be at least 1 row.' );
                }
index 04c00a3..377ed85 100644 (file)
@@ -37,11 +37,11 @@ class BatchRowWriter {
        protected $clusterName;
 
        /**
-        * @param DatabaseBase $db          The database to write to
+        * @param IDatabase $db The database to write to
         * @param string       $table       The name of the table to update
         * @param string|bool  $clusterName A cluster name valid for use with LBFactory
         */
-       public function __construct( DatabaseBase $db, $table, $clusterName = false ) {
+       public function __construct( IDatabase $db, $table, $clusterName = false ) {
                $this->db = $db;
                $this->table = $table;
                $this->clusterName = $clusterName;