X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FFileBackendDBRepoWrapper.php;h=aec337e404a4f8c7c5cf0c7ad0b7e59a78625614;hb=533ca5b24fbe455498062ea9f660b7967aa88c26;hp=c83e5b1b916d54e87a6bc4dd875888b180b1d0a4;hpb=d2278d1c2ae98e2c177acdab400614f29ac54591;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/FileBackendDBRepoWrapper.php b/includes/filerepo/FileBackendDBRepoWrapper.php index c83e5b1b91..aec337e404 100644 --- a/includes/filerepo/FileBackendDBRepoWrapper.php +++ b/includes/filerepo/FileBackendDBRepoWrapper.php @@ -79,7 +79,7 @@ class FileBackendDBRepoWrapper extends FileBackend { * @return string */ public function getBackendPath( $path, $latest = true ) { - $paths = $this->getBackendPaths( array( $path ), $latest ); + $paths = $this->getBackendPaths( [ $path ], $latest ); return current( $paths ); } @@ -97,7 +97,7 @@ class FileBackendDBRepoWrapper extends FileBackend { $db = $this->getDB( $latest ? DB_MASTER : DB_SLAVE ); // @TODO: batching - $resolved = array(); + $resolved = []; foreach ( $paths as $i => $path ) { if ( !$latest && $this->resolvedPathCache->has( $path, 'target', 10 ) ) { $resolved[$i] = $this->resolvedPathCache->get( $path, 'target' ); @@ -110,12 +110,12 @@ class FileBackendDBRepoWrapper extends FileBackend { $name = basename( $path ); if ( strpos( $path, '!' ) !== false ) { $sha1 = $db->selectField( 'oldimage', 'oi_sha1', - array( 'oi_archive_name' => $name ), + [ 'oi_archive_name' => $name ], __METHOD__ ); } else { $sha1 = $db->selectField( 'image', 'img_sha1', - array( 'img_name' => $name ), + [ 'img_name' => $name ], __METHOD__ ); } @@ -135,7 +135,7 @@ class FileBackendDBRepoWrapper extends FileBackend { } } - $res = array(); + $res = []; foreach ( $paths as $i => $path ) { $res[$i] = $resolved[$i]; } @@ -324,7 +324,7 @@ class FileBackendDBRepoWrapper extends FileBackend { $results = $this->backend->$function( $params ); - $contents = array(); + $contents = []; foreach ( $results as $path => $result ) { $contents[$pathMap[$path]] = $result; } @@ -342,7 +342,7 @@ class FileBackendDBRepoWrapper extends FileBackend { */ protected function mungeOpPaths( array $ops ) { // Ops that use 'src' and do not mutate core file data there - static $srcRefOps = array( 'store', 'copy', 'describe' ); + static $srcRefOps = [ 'store', 'copy', 'describe' ]; foreach ( $ops as &$op ) { if ( isset( $op['src'] ) && in_array( $op['op'], $srcRefOps ) ) { $op['src'] = $this->getBackendPath( $op['src'], true );