X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfetchText.php;h=9dee6e530dbf69d5d104e4ddd39062141337fe4d;hb=531ed101ccd14dc7e2cf2858a67b2523ef6a79ff;hp=cf128388db7727108f8f3e359f825b7e0a7b4145;hpb=3301e78e5a2e5662952c0564f830a492743f9844;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php index cf128388db..9dee6e530d 100644 --- a/maintenance/fetchText.php +++ b/maintenance/fetchText.php @@ -32,9 +32,10 @@ require_once __DIR__ . '/Maintenance.php'; class FetchText extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Fetch the raw revision blob from an old_id.\n" . + $this->addDescription( "Fetch the raw revision blob from an old_id.\n" . "NOTE: Export transformations are NOT applied. " . - "This is left to backupTextPass.php"; + "This is left to backupTextPass.php" + ); } /** @@ -48,7 +49,7 @@ class FetchText extends Maintenance { * note that the text string itself is *not* followed by newline */ public function execute() { - $db = $this->getDB( DB_SLAVE ); + $db = $this->getDB( DB_REPLICA ); $stdin = $this->getStdin(); while ( !feof( $stdin ) ) { $line = fgets( $stdin ); @@ -70,15 +71,15 @@ 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 */ private function doGetText( $db, $id ) { $id = intval( $id ); $row = $db->selectRow( 'text', - array( 'old_text', 'old_flags' ), - array( 'old_id' => $id ), + [ 'old_text', 'old_flags' ], + [ 'old_id' => $id ], __METHOD__ ); $text = Revision::getRevisionText( $row ); if ( $text === false ) {