X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdeleteImageMemcached.php;h=4799e5e0d7eeda584d5ce28f24cd4429fdf9b74a;hb=3e51aeea1ca1554f033955b463c0e51f0889a47b;hp=4ac64ca822a53ac920d761fea497b243c216cec3;hpb=117424d9e57256ffb1c27f17ba6eb004d3944ce1;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteImageMemcached.php b/maintenance/deleteImageMemcached.php index 4ac64ca822..4799e5e0d7 100644 --- a/maintenance/deleteImageMemcached.php +++ b/maintenance/deleteImageMemcached.php @@ -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,9 +80,10 @@ class DeleteImageCache extends Maintenance { private function getImageCount() { $dbr = wfGetDB( DB_SLAVE ); + return $dbr->selectField( 'image', 'COUNT(*)', array(), __METHOD__ ); } } $maintClass = "DeleteImageCache"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;