r103376 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103375‎ | r103376 | r103377 >
Date:20:38, 16 November 2011
Author:aaron
Status:ok
Tags:
Comment:
Fixed totally broken --file parameter (running the sha1 for one file)
Modified paths:
  • /trunk/phase3/maintenance/populateImageSha1.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/populateImageSha1.php
@@ -39,6 +39,14 @@
4040 return 'img_sha1 column of image table already populated.';
4141 }
4242
 43+ public function execute() {
 44+ if ( $this->getOption( 'file' ) ) {
 45+ $this->doDBUpdates(); // skip update log checks/saves
 46+ } else {
 47+ parent::execute();
 48+ }
 49+ }
 50+
4351 public function doDBUpdates() {
4452 $method = $this->getOption( 'method', 'normal' );
4553 $file = $this->getOption( 'file' );
@@ -46,10 +54,10 @@
4755 $t = -microtime( true );
4856 $dbw = wfGetDB( DB_MASTER );
4957 if ( $file ) {
50 - $res = $dbw->selectRow(
 58+ $res = $dbw->select(
5159 'image',
5260 array( 'img_name' ),
53 - array( 'img_name' => $dbw->addQuotes( $file ) ),
 61+ array( 'img_name' => $file ),
5462 __METHOD__
5563 );
5664 if ( !$res ) {

Status & tagging log