X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FdeleteOrphanedRevisions.php;h=f0a969280543a52b04c8a92dfe6fb61e6ab722fb;hb=d2254ba11c40321e09d0616d638e83ed6385f0db;hp=f0da9a82142b67013d4203527c7a2c0224f19402;hpb=cfdf23952dac41ac78dd97e670295098348604cd;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index f0da9a8214..f0a9692805 100644 --- a/maintenance/deleteOrphanedRevisions.php +++ b/maintenance/deleteOrphanedRevisions.php @@ -24,7 +24,7 @@ * @todo More efficient cleanup of text records */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Maintenance script that deletes revisions which refer to a nonexisting page. @@ -54,8 +54,9 @@ class DeleteOrphanedRevisions extends Maintenance { # Stash 'em all up for deletion (if needed) $revisions = array(); - foreach ( $res as $row ) + foreach ( $res as $row ) { $revisions[] = $row->rev_id; + } $count = count( $revisions ); $this->output( "found {$count}.\n" ); @@ -83,11 +84,12 @@ class DeleteOrphanedRevisions extends Maintenance { * @param $dbw DatabaseBase class (needs to be a master) */ private function deleteRevs( $id, &$dbw ) { - if ( !is_array( $id ) ) + if ( !is_array( $id ) ) { $id = array( $id ); + } $dbw->delete( 'revision', array( 'rev_id' => $id ), __METHOD__ ); } } $maintClass = "DeleteOrphanedRevisions"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;