Index: trunk/phase3/maintenance/populateImageSha1.php |
— | — | @@ -39,6 +39,14 @@ |
40 | 40 | return 'img_sha1 column of image table already populated.'; |
41 | 41 | } |
42 | 42 | |
| 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 | + |
43 | 51 | public function doDBUpdates() { |
44 | 52 | $method = $this->getOption( 'method', 'normal' ); |
45 | 53 | $file = $this->getOption( 'file' ); |
— | — | @@ -46,10 +54,10 @@ |
47 | 55 | $t = -microtime( true ); |
48 | 56 | $dbw = wfGetDB( DB_MASTER ); |
49 | 57 | if ( $file ) { |
50 | | - $res = $dbw->selectRow( |
| 58 | + $res = $dbw->select( |
51 | 59 | 'image', |
52 | 60 | array( 'img_name' ), |
53 | | - array( 'img_name' => $dbw->addQuotes( $file ) ), |
| 61 | + array( 'img_name' => $file ), |
54 | 62 | __METHOD__ |
55 | 63 | ); |
56 | 64 | if ( !$res ) { |