X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FLocalFile.php;h=51b5ab8a093230053548b4f68dedeec23281fe9a;hb=778b36d3d9e7946bc1ddbe897c5de3fbcc846383;hp=24beb30f34aa54df0d1b925f38d85a7ebebd2928;hpb=4f1764f7a0203e3723361d84203719f1ea630278;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 24beb30f34..51b5ab8a09 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -32,9 +32,10 @@ class LocalFile extends File { /**#@+ * @private */ - var $fileExists, # does the file file exist on disk? (loadFromXxx) - $historyLine, # Number of line to return by nextHistoryLine() (constructor) - $historyRes, # result of the query for the file's history (nextHistoryLine) + var + $fileExists, # does the file file exist on disk? (loadFromXxx) + $historyLine, # Number of line to return by nextHistoryLine() (constructor) + $historyRes, # result of the query for the file's history (nextHistoryLine) $width, # \ $height, # | $bits, # --- returned by getimagesize (loadFromXxx) @@ -53,7 +54,7 @@ class LocalFile extends File { $upgraded, # Whether the row was upgraded on load $locked, # True if the image row is locked $missing, # True if file is not present in file system. Not to be cached in memcached - $deleted; # Bitfield akin to rev_deleted + $deleted; # Bitfield akin to rev_deleted /**#@-*/ @@ -712,7 +713,7 @@ class LocalFile extends File { $res = $dbr->select( $tables, $fields, $conds, __METHOD__, $opts, $join_conds ); $r = array(); - while ( $row = $dbr->fetchObject( $res ) ) { + foreach ( $res as $row ) { if ( $this->repo->oldFileFromRowFactory ) { $r[] = call_user_func( $this->repo->oldFileFromRowFactory, $row, $this->repo ); } else { @@ -1126,7 +1127,7 @@ class LocalFile extends File { $result = $dbw->select( 'oldimage', array( 'oi_archive_name' ), array( 'oi_name' => $this->getName() ) ); - while ( $row = $dbw->fetchObject( $result ) ) { + foreach ( $result as $row ) { $batch->addOld( $row->oi_archive_name ); } $status = $batch->execute(); @@ -1340,7 +1341,7 @@ class LocalFileDeleteBatch { __METHOD__ ); - while ( $row = $dbw->fetchObject( $res ) ) { + foreach ( $res as $row ) { if ( rtrim( $row->oi_sha1, "\0" ) === '' ) { // Get the hash from the file $oldUrl = $this->file->getArchiveVirtualUrl( $row->oi_archive_name ); @@ -1503,7 +1504,7 @@ class LocalFileDeleteBatch { $dbw->bitAnd( 'oi_deleted', File::DELETED_FILE ) => File::DELETED_FILE ), __METHOD__ ); - while ( $row = $dbw->fetchObject( $res ) ) { + foreach ( $res as $row ) { $privateFiles[$row->oi_archive_name] = 1; } } @@ -1673,7 +1674,7 @@ class LocalFileRestoreBatch { $first = true; $archiveNames = array(); - while ( $row = $dbw->fetchObject( $result ) ) { + foreach ( $result as $row ) { $idsPresent[] = $row->fa_id; if ( $row->fa_name != $this->file->getName() ) { @@ -1957,7 +1958,7 @@ class LocalFileMoveBatch { __METHOD__ ); - while ( $row = $this->db->fetchObject( $result ) ) { + foreach ( $result as $row ) { $oldName = $row->oi_archive_name; $bits = explode( '!', $oldName, 2 );