From: jenkins-bot Date: Thu, 29 Sep 2016 02:45:39 +0000 (+0000) Subject: Merge "Replace DatabaseBase => Database in more places" X-Git-Tag: 1.31.0-rc.0~5278 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=259c79579a6a8c5b3564632b1497a4f9b9f2e9c6;hp=27e40ed740ee507fbdf095791b16e9fb3c3f4b41;p=lhc%2Fweb%2Fwiklou.git Merge "Replace DatabaseBase => Database in more places" --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5fe4b4efea..311cf25ecc 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3066,7 +3066,7 @@ function wfSplitWikiID( $wiki ) { * @todo Replace calls to wfGetDB with calls to LoadBalancer::getConnection() * on an injected instance of LoadBalancer. * - * @return DatabaseBase + * @return Database */ function wfGetDB( $db, $groups = [], $wiki = false ) { return wfGetLB( $wiki )->getConnection( $db, $groups, $wiki ); diff --git a/includes/WatchedItemQueryService.php b/includes/WatchedItemQueryService.php index c040fb1c29..4802f72ecb 100644 --- a/includes/WatchedItemQueryService.php +++ b/includes/WatchedItemQueryService.php @@ -55,7 +55,7 @@ class WatchedItemQueryService { } /** - * @return DatabaseBase + * @return Database * @throws MWException */ private function getConnection() { diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 809d5676b7..4feaac0009 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -600,7 +600,7 @@ abstract class ApiBase extends ContextSource { /** * Gets a default replica DB connection object - * @return DatabaseBase + * @return Database */ protected function getDB() { if ( !isset( $this->mSlaveDB ) ) { diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index ed229cb9f4..34c17c1ef3 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -1330,7 +1330,7 @@ class ApiPageSet extends ApiBase { /** * Get the database connection (read-only) - * @return DatabaseBase + * @return Database */ protected function getDB() { return $this->mDbSource->getDB(); diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index e8aa655aba..2f532097ee 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -168,7 +168,7 @@ class ApiQuery extends ApiBase { * @param string $name Name to assign to the database connection * @param int $db One of the DB_* constants * @param array $groups Query groups - * @return DatabaseBase + * @return Database */ public function getNamedDB( $name, $db, $groups ) { if ( !array_key_exists( $name, $this->mNamedDB ) ) { diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index 6aeee683d0..553995c781 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -44,7 +44,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { * which may not necessarily be the same as the local DB. * * TODO: allow querying non-local repos. - * @return DatabaseBase + * @return Database */ protected function getDB() { return $this->mRepo->getSlaveDB(); diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index b35eec2c39..36ad3a4be7 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -103,7 +103,7 @@ abstract class ApiQueryBase extends ApiBase { /** * Get the Query database connection (read-only) - * @return DatabaseBase + * @return Database */ protected function getDB() { if ( is_null( $this->mDb ) ) { @@ -119,7 +119,7 @@ abstract class ApiQueryBase extends ApiBase { * @param string $name Name to assign to the database connection * @param int $db One of the DB_* constants * @param array $groups Query groups - * @return DatabaseBase + * @return Database */ public function selectNamedDB( $name, $db, $groups ) { $this->mDb = $this->getQuery()->getNamedDB( $name, $db, $groups ); diff --git a/includes/cache/BacklinkCache.php b/includes/cache/BacklinkCache.php index 9dfabfd089..9e6cf1ef4c 100644 --- a/includes/cache/BacklinkCache.php +++ b/includes/cache/BacklinkCache.php @@ -139,7 +139,7 @@ class BacklinkCache { /** * Get the replica DB connection to the database * When non existing, will initialize the connection. - * @return DatabaseBase + * @return Database */ protected function getDB() { if ( !isset( $this->db ) ) { diff --git a/includes/dao/DBAccessBase.php b/includes/dao/DBAccessBase.php index ed617fe061..6a1bbd6e31 100644 --- a/includes/dao/DBAccessBase.php +++ b/includes/dao/DBAccessBase.php @@ -53,7 +53,7 @@ abstract class DBAccessBase implements IDBAccessObject { * @param int $id Which connection to use * @param array $groups Query groups * - * @return DatabaseBase + * @return Database */ protected function getConnection( $id, $groups = [] ) { $loadBalancer = wfGetLB( $this->wiki ); diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index 7b40a7ba81..21492a52be 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -454,7 +454,7 @@ class LocalRepo extends FileRepo { /** * Get a connection to the replica DB - * @return DatabaseBase + * @return Database */ function getSlaveDB() { return wfGetDB( DB_REPLICA ); @@ -462,7 +462,7 @@ class LocalRepo extends FileRepo { /** * Get a connection to the master DB - * @return DatabaseBase + * @return Database */ function getMasterDB() { return wfGetDB( DB_MASTER ); diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 2b84144a3f..331d1a1bd5 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -41,7 +41,7 @@ abstract class DatabaseInstaller { /** * The database connection. * - * @var DatabaseBase + * @var Database */ public $db = null; diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index fbdc9342ad..aece3170f0 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -57,7 +57,7 @@ abstract class DatabaseUpdater { /** * Handle to the database subclass * - * @var DatabaseBase + * @var Database */ protected $db; @@ -192,7 +192,7 @@ abstract class DatabaseUpdater { /** * Get a database connection to run updates * - * @return DatabaseBase + * @return Database */ public function getDB() { return $this->db; diff --git a/includes/installer/MssqlInstaller.php b/includes/installer/MssqlInstaller.php index 739be820c0..c5ec72b03f 100644 --- a/includes/installer/MssqlInstaller.php +++ b/includes/installer/MssqlInstaller.php @@ -182,7 +182,7 @@ class MssqlInstaller extends DatabaseInstaller { return $status; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; @@ -240,7 +240,7 @@ class MssqlInstaller extends DatabaseInstaller { return; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; $conn->selectDB( $this->getVar( 'wgDBname' ) ); diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 812742c6d0..5ff47e94f0 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -124,7 +124,7 @@ class MysqlInstaller extends DatabaseInstaller { return $status; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; @@ -168,7 +168,7 @@ class MysqlInstaller extends DatabaseInstaller { return; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; $conn->selectDB( $this->getVar( 'wgDBname' ) ); @@ -226,7 +226,7 @@ class MysqlInstaller extends DatabaseInstaller { $status = $this->getConnection(); /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; diff --git a/includes/installer/OracleInstaller.php b/includes/installer/OracleInstaller.php index 8610834349..b8fc4e75d5 100644 --- a/includes/installer/OracleInstaller.php +++ b/includes/installer/OracleInstaller.php @@ -150,7 +150,7 @@ class OracleInstaller extends DatabaseInstaller { } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 7a2794d0a4..33e1a1f89d 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -114,7 +114,7 @@ class PostgresInstaller extends DatabaseInstaller { return $status; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; @@ -181,7 +181,7 @@ class PostgresInstaller extends DatabaseInstaller { if ( $status->isOK() ) { /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; $conn->clearFlag( DBO_TRX ); @@ -233,7 +233,7 @@ class PostgresInstaller extends DatabaseInstaller { $status = $this->openPgConnection( 'create-schema' ); if ( $status->isOK() ) { /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; $safeRole = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) ); @@ -287,7 +287,7 @@ class PostgresInstaller extends DatabaseInstaller { return false; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; $superuser = $this->getVar( '_InstallUser' ); @@ -588,7 +588,7 @@ class PostgresInstaller extends DatabaseInstaller { } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; @@ -638,7 +638,7 @@ class PostgresInstaller extends DatabaseInstaller { return $status; } /** - * @var $conn DatabaseBase + * @var $conn Database */ $conn = $status->value; diff --git a/includes/libs/lockmanager/DBLockManager.php b/includes/libs/lockmanager/DBLockManager.php index 64a2916721..b17b1a0b0d 100644 --- a/includes/libs/lockmanager/DBLockManager.php +++ b/includes/libs/lockmanager/DBLockManager.php @@ -58,7 +58,7 @@ abstract class DBLockManager extends QuorumLockManager { * - user : DB user * - password : DB user password * - tablePrefix : DB table prefix - * - flags : DB flags (see DatabaseBase) + * - flags : DB flags; bitfield of IDatabase::DBO_* constants * - dbsByBucket : Array of 1-16 consecutive integer keys, starting from 0, * each having an odd-numbered list of DB names (peers) as values. * - lockExpiry : Lock timeout (seconds) for dropped connections. [optional] diff --git a/includes/user/BotPassword.php b/includes/user/BotPassword.php index eae57f40dc..57610fc9e4 100644 --- a/includes/user/BotPassword.php +++ b/includes/user/BotPassword.php @@ -68,7 +68,7 @@ class BotPassword implements IDBAccessObject { /** * Get a database connection for the bot passwords database * @param int $db Index of the connection to get, e.g. DB_MASTER or DB_REPLICA. - * @return DatabaseBase + * @return Database */ public static function getDB( $db ) { global $wgBotPasswordsCluster, $wgBotPasswordsDatabase; diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index e1a4dc6e3e..1cb5eefe87 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1316,7 +1316,7 @@ abstract class Maintenance { /** * Lock the search index - * @param DatabaseBase &$db + * @param Database &$db */ private function lockSearchindex( $db ) { $write = [ 'searchindex' ]; @@ -1334,7 +1334,7 @@ abstract class Maintenance { /** * Unlock the tables - * @param DatabaseBase &$db + * @param Database &$db */ private function unlockSearchindex( $db ) { $db->unlockTables( __CLASS__ . '::' . __METHOD__ ); @@ -1343,7 +1343,7 @@ abstract class Maintenance { /** * Unlock and lock again * Since the lock is low-priority, queued reads will be able to complete - * @param DatabaseBase &$db + * @param Database &$db */ private function relockSearchindex( $db ) { $this->unlockSearchindex( $db ); @@ -1354,7 +1354,7 @@ abstract class Maintenance { * Perform a search index update with locking * @param int $maxLockTime The maximum time to keep the search index locked. * @param string $callback The function that will update the function. - * @param DatabaseBase $dbw + * @param Database $dbw * @param array $results */ public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) { @@ -1390,7 +1390,7 @@ abstract class Maintenance { /** * Update the searchindex table for a given pageid - * @param DatabaseBase $dbw A database write handle + * @param Database $dbw A database write handle * @param int $pageId The page ID to update. * @return null|string */ diff --git a/maintenance/archives/upgradeLogging.php b/maintenance/archives/upgradeLogging.php index cf5a19ca13..0beff7caec 100644 --- a/maintenance/archives/upgradeLogging.php +++ b/maintenance/archives/upgradeLogging.php @@ -32,7 +32,7 @@ require __DIR__ . '/../commandLine.inc'; class UpdateLogging { /** - * @var DatabaseBase + * @var Database */ public $dbw; public $batchSize = 1000; diff --git a/maintenance/benchmarks/bench_delete_truncate.php b/maintenance/benchmarks/bench_delete_truncate.php index e9cdb5891d..2a8d79a944 100644 --- a/maintenance/benchmarks/bench_delete_truncate.php +++ b/maintenance/benchmarks/bench_delete_truncate.php @@ -69,7 +69,7 @@ class BenchmarkDeleteTruncate extends Benchmarker { } /** - * @param DatabaseBase $dbw + * @param Database $dbw * @return void */ private function insertData( $dbw ) { @@ -82,7 +82,7 @@ class BenchmarkDeleteTruncate extends Benchmarker { } /** - * @param DatabaseBase $dbw + * @param Database $dbw * @return void */ private function delete( $dbw ) { @@ -90,7 +90,7 @@ class BenchmarkDeleteTruncate extends Benchmarker { } /** - * @param DatabaseBase $dbw + * @param Database $dbw * @return void */ private function truncate( $dbw ) { diff --git a/maintenance/convertUserOptions.php b/maintenance/convertUserOptions.php index 14557f42f9..b8001a4d21 100644 --- a/maintenance/convertUserOptions.php +++ b/maintenance/convertUserOptions.php @@ -74,7 +74,7 @@ class ConvertUserOptions extends Maintenance { /** * @param ResultWrapper $res - * @param DatabaseBase $dbw + * @param Database $dbw * @return null|int */ function convertOptionBatch( $res, $dbw ) { diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index 507a494304..df496d435b 100644 --- a/maintenance/deleteOrphanedRevisions.php +++ b/maintenance/deleteOrphanedRevisions.php @@ -83,7 +83,7 @@ class DeleteOrphanedRevisions extends Maintenance { * Do this inside a transaction * * @param array $id Array of revision id values - * @param DatabaseBase $dbw DatabaseBase class (needs to be a master) + * @param Database $dbw Database class (needs to be a master) */ private function deleteRevs( $id, &$dbw ) { if ( !is_array( $id ) ) { diff --git a/maintenance/dumpIterator.php b/maintenance/dumpIterator.php index 31272bcaa6..9f983c1a04 100644 --- a/maintenance/dumpIterator.php +++ b/maintenance/dumpIterator.php @@ -117,7 +117,7 @@ abstract class DumpIterator extends Maintenance { /** * Callback function for each revision, child classes should override * processRevision instead. - * @param DatabaseBase $rev + * @param Database $rev */ public function handleRevision( $rev ) { $title = $rev->getTitle(); diff --git a/maintenance/dumpTextPass.php b/maintenance/dumpTextPass.php index d0bda4ed3a..d8661c1a3b 100644 --- a/maintenance/dumpTextPass.php +++ b/maintenance/dumpTextPass.php @@ -86,7 +86,7 @@ class TextPassDumper extends BackupDumper { protected $checkpointFiles = []; /** - * @var DatabaseBase + * @var Database */ protected $db; diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php index 2ed1efaed5..9dee6e530d 100644 --- a/maintenance/fetchText.php +++ b/maintenance/fetchText.php @@ -71,7 +71,7 @@ class FetchText extends Maintenance { /** * May throw a database error if, say, the server dies during query. - * @param DatabaseBase $db + * @param Database $db * @param int $id The old_id * @return string */ diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index 506bc9c2b9..b705500945 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -37,7 +37,7 @@ require_once __DIR__ . '/Maintenance.php'; class NamespaceConflictChecker extends Maintenance { /** - * @var DatabaseBase + * @var Database */ protected $db; diff --git a/maintenance/orphans.php b/maintenance/orphans.php index 7b8f2cd96a..e4f3e91354 100644 --- a/maintenance/orphans.php +++ b/maintenance/orphans.php @@ -56,7 +56,7 @@ class Orphans extends Maintenance { /** * Lock the appropriate tables for the script - * @param DatabaseBase $db + * @param Database $db * @param string $extraTable The name of any extra tables to lock (eg: text) */ private function lockTables( $db, $extraTable = [] ) { diff --git a/maintenance/populateContentModel.php b/maintenance/populateContentModel.php index 401ef12a2a..c6bd794e23 100644 --- a/maintenance/populateContentModel.php +++ b/maintenance/populateContentModel.php @@ -57,7 +57,7 @@ class PopulateContentModel extends Maintenance { } } - private function updatePageRows( DatabaseBase $dbw, $pageIds, $model ) { + private function updatePageRows( Database $dbw, $pageIds, $model ) { $count = count( $pageIds ); $this->output( "Setting $count rows to $model..." ); $dbw->update( @@ -70,7 +70,7 @@ class PopulateContentModel extends Maintenance { $this->output( "done.\n" ); } - protected function populatePage( DatabaseBase $dbw, $ns ) { + protected function populatePage( Database $dbw, $ns ) { $toSave = []; $lastId = 0; $nsCondition = $ns === 'all' ? [] : [ 'page_namespace' => $ns ]; @@ -102,7 +102,7 @@ class PopulateContentModel extends Maintenance { } } - private function updateRevisionOrArchiveRows( DatabaseBase $dbw, $ids, $model, $table ) { + private function updateRevisionOrArchiveRows( Database $dbw, $ids, $model, $table ) { $prefix = $table === 'archive' ? 'ar' : 'rev'; $model_column = "{$prefix}_content_model"; $format_column = "{$prefix}_content_format"; @@ -120,7 +120,7 @@ class PopulateContentModel extends Maintenance { $this->output( "done.\n" ); } - protected function populateRevisionOrArchive( DatabaseBase $dbw, $table, $ns ) { + protected function populateRevisionOrArchive( Database $dbw, $table, $ns ) { $prefix = $table === 'archive' ? 'ar' : 'rev'; $model_column = "{$prefix}_content_model"; $format_column = "{$prefix}_content_format"; diff --git a/maintenance/populateRecentChangesSource.php b/maintenance/populateRecentChangesSource.php index 05098ac0a9..ac87cf3ecb 100644 --- a/maintenance/populateRecentChangesSource.php +++ b/maintenance/populateRecentChangesSource.php @@ -83,7 +83,7 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance { return __CLASS__; } - protected function buildUpdateCondition( DatabaseBase $dbw ) { + protected function buildUpdateCondition( Database $dbw ) { $rcNew = $dbw->addQuotes( RC_NEW ); $rcSrcNew = $dbw->addQuotes( RecentChange::SRC_NEW ); $rcEdit = $dbw->addQuotes( RC_EDIT ); diff --git a/maintenance/rebuildImages.php b/maintenance/rebuildImages.php index 31571866c7..6aa1f37a8c 100644 --- a/maintenance/rebuildImages.php +++ b/maintenance/rebuildImages.php @@ -40,7 +40,7 @@ require_once __DIR__ . '/Maintenance.php'; class ImageBuilder extends Maintenance { /** - * @var DatabaseBase + * @var Database */ protected $dbw; diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index ec99d84a4c..37636c85a8 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -36,7 +36,7 @@ class RebuildTextIndex extends Maintenance { const RTI_CHUNK_SIZE = 500; /** - * @var DatabaseBase + * @var Database */ private $db; diff --git a/maintenance/refreshImageMetadata.php b/maintenance/refreshImageMetadata.php index aea966ffb2..df4ce56330 100644 --- a/maintenance/refreshImageMetadata.php +++ b/maintenance/refreshImageMetadata.php @@ -37,7 +37,7 @@ require_once __DIR__ . '/Maintenance.php'; class RefreshImageMetadata extends Maintenance { /** - * @var DatabaseBase + * @var Database */ protected $dbw; @@ -197,7 +197,7 @@ class RefreshImageMetadata extends Maintenance { } /** - * @param DatabaseBase $dbw + * @param Database $dbw * @return array */ function getConditions( $dbw ) { diff --git a/maintenance/storage/recompressTracked.php b/maintenance/storage/recompressTracked.php index a0efcb8f66..c5dd53b111 100644 --- a/maintenance/storage/recompressTracked.php +++ b/maintenance/storage/recompressTracked.php @@ -640,7 +640,7 @@ class RecompressTracked { /** * Gets a DB master connection for the given external cluster name * @param string $cluster - * @return DatabaseBase + * @return Database */ function getExtDB( $cluster ) { $lb = wfGetLBFactory()->getExternalLB( $cluster ); diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index e754e3c3ab..e70a176909 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -242,7 +242,7 @@ TEXT * Return an SQL expression selecting rows which sort above the given row, * assuming an ordering of cl_collation, cl_to, cl_type, cl_from * @param stdClass $row - * @param DatabaseBase $dbw + * @param Database $dbw * @return string */ function getBatchCondition( $row, $dbw ) {