Apparently for certain (API) requests $this->getTitle() doesn't return a valid Title.
[lhc/web/wiklou.git] / maintenance / deleteImageMemcached.php
index 5d967a0..4799e5e 100644 (file)
@@ -24,7 +24,7 @@
  * @ingroup Maintenance
  */
 
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
 
 /**
  * Maintenance script that deletes image information from the object cache.
@@ -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__ );
        }
 }