diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 13:00:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 13:00:47 +0200 |
commit | 72e90545454c0e014318fa3c81658e035aac58c1 (patch) | |
tree | 9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /maintenance/cleanupTable.inc | |
parent | 565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff) |
applying patch to version 1.15.0
Diffstat (limited to 'maintenance/cleanupTable.inc')
-rw-r--r-- | maintenance/cleanupTable.inc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/maintenance/cleanupTable.inc b/maintenance/cleanupTable.inc index 26b0a0e2..75699c52 100644 --- a/maintenance/cleanupTable.inc +++ b/maintenance/cleanupTable.inc @@ -61,21 +61,19 @@ abstract class TableCleanup extends FiveUpgrade { } function runTable( $table, $where, $callback ) { - $fname = 'CapsCleanup::buildTable'; - - $count = $this->dbw->selectField( $table, 'count(*)', '', $fname ); + $count = $this->dbw->selectField( $table, 'count(*)', '', __METHOD__ ); $this->init( $count, $table ); $this->log( "Processing $table..." ); $tableName = $this->dbr->tableName( $table ); $sql = "SELECT * FROM $tableName $where"; - $result = $this->dbr->query( $sql, $fname ); + $result = $this->dbr->query( $sql, __METHOD__ ); - while( $row = $this->dbr->fetchObject( $result ) ) { + foreach( $result as $row ) { call_user_func( $callback, $row ); } $this->log( "Finished $table... $this->updated of $this->processed rows updated" ); - $this->dbr->freeResult( $result ); + $result->free(); } function hexChar( $matches ) { |