X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FpopulateImageSha1.php;h=5d6a19fb2f5e8c80143feedb770f1e1bb2854f06;hp=0de9d6737ec5783155d5054278bdc94f1274a556;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hpb=cb349fb4470cc9e85e688d3784d7b5a5a1df1fd7 diff --git a/maintenance/populateImageSha1.php b/maintenance/populateImageSha1.php index 0de9d6737e..5d6a19fb2f 100644 --- a/maintenance/populateImageSha1.php +++ b/maintenance/populateImageSha1.php @@ -109,10 +109,10 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { // with the database write operation, because the writes are queued // in the pipe buffer. This can improve performance by up to a // factor of 2. - global $wgDBuser, $wgDBserver, $wgDBpassword, $wgDBname; - $cmd = 'mysql -u' . Shell::escape( $wgDBuser ) . - ' -h' . Shell::escape( $wgDBserver ) . - ' -p' . Shell::escape( $wgDBpassword, $wgDBname ); + $config = $this->getConfig(); + $cmd = 'mysql -u' . Shell::escape( $config->get( 'DBuser' ) ) . + ' -h' . Shell::escape( $config->get( 'DBserver' ) ) . + ' -p' . Shell::escape( $config->get( 'DBpassword' ), $config->get( 'DBname' ) ); $this->output( "Using pipe method\n" ); $pipe = popen( $cmd, 'w' ); } @@ -151,6 +151,8 @@ class PopulateImageSha1 extends LoggedUpdateMaintenance { } // Upgrade the old file versions... foreach ( $file->getHistory() as $oldFile ) { + /** @var OldLocalFile $oldFile */ + '@phan-var OldLocalFile $oldFile'; $sha1 = $oldFile->getRepo()->getFileSha1( $oldFile->getPath() ); if ( strval( $sha1 ) !== '' ) { // file on disk and hashed properly if ( $isRegen && $oldFile->getSha1() !== $sha1 ) {