X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdeleteOrphanedRevisions.php;h=f0a969280543a52b04c8a92dfe6fb61e6ab722fb;hb=e7651f865d31dd6203828cf509383da2ea7515c3;hp=dcbf739991cdafe533d43996225ab890824dd161;hpb=b31e2ee6d99b68ec58089eb9e66ce93da7d0cdc2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index dcbf739991..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,12 +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;