X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fstorage%2FfixBug20757.php;h=e926f56baebd709b71fd32a411ec2d99e44af68e;hb=44cebea941236e165bf55e80565d6679529c7280;hp=d2fe3b42b84a33427946eb978600fd3e1e3a258e;hpb=2e040b99eda6c99cf472b3896f62d2f21315e808;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/storage/fixBug20757.php b/maintenance/storage/fixBug20757.php index d2fe3b42b8..e926f56bae 100644 --- a/maintenance/storage/fixBug20757.php +++ b/maintenance/storage/fixBug20757.php @@ -42,8 +42,8 @@ class FixBug20757 extends Maintenance { } function execute() { - $dbr = wfGetDB( DB_SLAVE ); - $dbw = wfGetDB( DB_MASTER ); + $dbr = $this->getDB( DB_SLAVE ); + $dbw = $this->getDB( DB_MASTER ); $dryRun = $this->getOption( 'dry-run' ); if ( $dryRun ) { @@ -213,7 +213,7 @@ class FixBug20757 extends Maintenance { if ( !$dryRun ) { // Reset the text row to point to the original copy - $dbw->begin( __METHOD__ ); + $this->beginTransaction( $dbw, __METHOD__ ); $dbw->update( 'text', // SET @@ -241,7 +241,7 @@ class FixBug20757 extends Maintenance { ), __METHOD__ ); - $dbw->commit( __METHOD__ ); + $this->commitTransaction( $dbw, __METHOD__ ); $this->waitForSlaves(); } @@ -283,7 +283,7 @@ class FixBug20757 extends Maintenance { unset( $this->mapCache[$key] ); } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = $this->getDB( DB_SLAVE ); $map = array(); $res = $dbr->select( 'revision', array( 'rev_id', 'rev_text_id' ), @@ -312,9 +312,9 @@ class FixBug20757 extends Maintenance { $text = $secondaryRow->old_text; if ( in_array( 'external', $flags ) ) { $url = $text; - wfSuppressWarnings(); + MediaWiki\suppressWarnings(); list( /* $proto */, $path ) = explode( '://', $url, 2 ); - wfRestoreWarnings(); + MediaWiki\restoreWarnings(); if ( $path == "" ) { return false;