X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Ffilebackend%2FFileBackendGroup.php;h=57461a48ea8fd04f36cb23f2e5f7adbf113bb1a3;hb=687dc7cf57bdc74a80b2ae3176cda1facd535ee9;hp=c043106acfc6c05781d38c64d9941fa2fb74e350;hpb=de290cd02db7150549da5cc66c9af3de6933a68b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index c043106acf..57461a48ea 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -33,7 +33,7 @@ class FileBackendGroup { protected static $instance = null; /** @var array (name => ('class' => string, 'config' => array, 'instance' => object)) */ - protected $backends = array(); + protected $backends = []; protected function __construct() { } @@ -66,9 +66,9 @@ class FileBackendGroup { // Register explicitly defined backends $this->register( $wgFileBackends, wfConfiguredReadOnlyReason() ); - $autoBackends = array(); + $autoBackends = []; // Automatically create b/c backends for file repos... - $repos = array_merge( $wgForeignFileRepos, array( $wgLocalFileRepo ) ); + $repos = array_merge( $wgForeignFileRepos, [ $wgLocalFileRepo ] ); foreach ( $repos as $info ) { $backendName = $info['backend']; if ( is_object( $backendName ) || isset( $this->backends[$backendName] ) ) { @@ -90,19 +90,19 @@ class FileBackendGroup { ? $info['fileMode'] : 0644; // Get the FS backend configuration - $autoBackends[] = array( + $autoBackends[] = [ 'name' => $backendName, 'class' => 'FSFileBackend', 'lockManager' => 'fsLockManager', - 'containerPaths' => array( + 'containerPaths' => [ "{$repoName}-public" => "{$directory}", "{$repoName}-thumb" => $thumbDir, "{$repoName}-transcoded" => $transcodedDir, "{$repoName}-deleted" => $deletedDir, "{$repoName}-temp" => "{$directory}/temp" - ), + ], 'fileMode' => $fileMode, - ); + ]; } // Register implicitly defined backends @@ -134,11 +134,11 @@ class FileBackendGroup { : $readOnlyReason; unset( $config['class'] ); // backend won't need this - $this->backends[$name] = array( + $this->backends[$name] = [ 'class' => $class, 'config' => $config, 'instance' => null - ); + ]; } } @@ -164,9 +164,9 @@ class FileBackendGroup { LockManagerGroup::singleton( $config['wikiId'] )->get( $config['lockManager'] ); $config['fileJournal'] = isset( $config['fileJournal'] ) ? FileJournal::factory( $config['fileJournal'], $name ) - : FileJournal::factory( array( 'class' => 'NullFileJournal' ), $name ); + : FileJournal::factory( [ 'class' => 'NullFileJournal' ], $name ); $config['wanCache'] = ObjectCache::getMainWANInstance(); - $config['mimeCallback'] = array( $this, 'guessMimeInternal' ); + $config['mimeCallback'] = [ $this, 'guessMimeInternal' ]; $this->backends[$name]['instance'] = new $class( $config ); } @@ -187,7 +187,7 @@ class FileBackendGroup { } $class = $this->backends[$name]['class']; - return array( 'class' => $class ) + $this->backends[$name]['config']; + return [ 'class' => $class ] + $this->backends[$name]['config']; } /**