follow-up to r74742: fix typos
[lhc/web/wiklou.git] / maintenance / storage / compressOld.inc
index fb8cc42..69964ff 100644 (file)
@@ -18,12 +18,11 @@ function compressOldPages( $start = 0, $extdb = '' ) {
                        break;
                }
                $last = $start;
-               while( $row = $dbw->fetchObject( $res ) ) {
+               foreach ( $res as $row ) {
                        # print "  {$row->old_id} - {$row->old_namespace}:{$row->old_title}\n";
                        compressPage( $row, $extdb );
                        $last = $row->old_id;
                }
-               $dbw->freeResult( $res );
                $start = $last + 1; # Deletion may leave long empty stretches
                print "$start...\n";
        } while( true );
@@ -57,7 +56,8 @@ function compressPage( $row, $extdb ) {
                        'old_text' => $compress
                ), array( /* WHERE */
                        'old_id' => $row->old_id
-               ), $fname, 'LIMIT 1'
+               ), $fname,
+               array( 'LIMIT' => 1 )
        );
        return true;
 }
@@ -104,7 +104,8 @@ function compressWithConcat( $startId, $maxChunkSize, $beginDate,
        # overwriting bulk storage concat rows. Don't compress external references, because
        # the script doesn't yet delete rows from external storage.
        $conds = array(
-               "old_flags NOT LIKE '%object%' AND old_flags NOT LIKE '%external%'");
+               'old_flags NOT ' . $dbr->buildLike( $dbr->anyString(), 'object', $dbr->anyString() ) . ' AND old_flags NOT '
+                       . $dbr->buildLike( $dbr->anyString(), 'external', $dbr->anyString() ) );
 
        if ( $beginDate ) {
                if ( !preg_match( '/^\d{14}$/', $beginDate ) ) {
@@ -168,7 +169,7 @@ function compressWithConcat( $startId, $maxChunkSize, $beginDate,
                        $revLoadOptions
                );
                $revs = array();
-               while ( $revRow = $dbw->fetchObject( $revRes ) ) {
+               foreach ( $revRes as $revRow ) {
                        $revs[] = $revRow;
                }