X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%22id_auteur=%24connect_id_auteur%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUndelete.php;h=efac6153246bd46b9ad52456392518d8017fa53f;hb=dcdb8e463e3b2be121c61c91df13ea36d270a602;hp=65f0680d814ee09669f36d2af85170b300198b2d;hpb=c64cbee7fcc4a4c46b82185038b11f29f4b40f50;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 65f0680d81..efac615324 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -20,6 +20,7 @@ * @file * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; /** * Used to show archived pages and eventually restore them. @@ -46,7 +47,7 @@ class PageArchive { $this->title = $title; if ( $config === null ) { wfDebug( __METHOD__ . ' did not have a Config object passed to it' ); - $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); + $config = MediaWikiServices::getInstance()->getMainConfig(); } $this->config = $config; } @@ -63,7 +64,7 @@ class PageArchive { * @return ResultWrapper */ public static function listAllPages() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); return self::listPages( $dbr, '' ); } @@ -77,7 +78,7 @@ class PageArchive { * @return ResultWrapper */ public static function listPagesByPrefix( $prefix ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $title = Title::newFromText( $prefix ); if ( $title ) { @@ -127,7 +128,7 @@ class PageArchive { * @return ResultWrapper */ function listRevisions() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $tables = [ 'archive' ]; @@ -179,7 +180,7 @@ class PageArchive { return null; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); return $dbr->select( 'filearchive', ArchivedFile::selectFields(), @@ -197,7 +198,7 @@ class PageArchive { * @return Revision|null */ function getRevision( $timestamp ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $fields = [ 'ar_rev_id', @@ -244,7 +245,7 @@ class PageArchive { * @return Revision|null Null when there is no previous revision */ function getPreviousRevision( $timestamp ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); // Check the previous deleted revision... $row = $dbr->selectRow( 'archive', @@ -300,7 +301,7 @@ class PageArchive { } // New-style: keyed to the text storage backend. - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $text = $dbr->selectRow( 'text', [ 'old_text', 'old_flags' ], [ 'old_id' => $row->ar_text_id ], @@ -318,7 +319,7 @@ class PageArchive { * @return string|null */ function getLastRevisionText() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $row = $dbr->selectRow( 'archive', [ 'ar_text', 'ar_flags', 'ar_text_id' ], [ 'ar_namespace' => $this->title->getNamespace(), @@ -339,7 +340,7 @@ class PageArchive { * @return bool */ function isDeleted() { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $n = $dbr->selectField( 'archive', 'COUNT(ar_title)', [ 'ar_namespace' => $this->title->getNamespace(), 'ar_title' => $this->title->getDBkey() ], @@ -1247,7 +1248,7 @@ class SpecialUndelete extends SpecialPage { $minor = $rev->isMinor() ? ChangesList::flag( 'minor' ) : ''; - $tags = wfGetDB( DB_SLAVE )->selectField( + $tags = wfGetDB( DB_REPLICA )->selectField( 'tag_summary', 'ts_tags', [ 'ts_rev_id' => $rev->getId() ],