Apparently for certain (API) requests $this->getTitle() doesn't return a valid Title.
[lhc/web/wiklou.git] / maintenance / deleteImageMemcached.php
index 835de35..4799e5e 100644 (file)
@@ -60,7 +60,12 @@ class DeleteImageCache extends Maintenance {
 
                foreach ( $res as $row ) {
                        if ( $i % $this->report == 0 ) {
-                               $this->output( sprintf( "%s: %13s done (%s)\n", wfWikiID(), "$i/$total", wfPercent( $i / $total * 100 ) ) );
+                               $this->output( sprintf(
+                                       "%s: %13s done (%s)\n",
+                                       wfWikiID(),
+                                       "$i/$total",
+                                       wfPercent( $i / $total * 100 )
+                               ) );
                        }
                        $md5 = md5( $row->img_name );
                        $wgMemc->delete( wfMemcKey( 'Image', $md5 ) );
@@ -75,6 +80,7 @@ class DeleteImageCache extends Maintenance {
 
        private function getImageCount() {
                $dbr = wfGetDB( DB_SLAVE );
+
                return $dbr->selectField( 'image', 'COUNT(*)', array(), __METHOD__ );
        }
 }