diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
commit | 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch) | |
tree | 577a29fb579188d16003a209ce2a2e9c5b0aa2bd /includes/filebackend/FileBackendGroup.php | |
parent | cacc939b34e315b85e2d72997811eb6677996cc1 (diff) |
Update to MediaWiki 1.21.1
Diffstat (limited to 'includes/filebackend/FileBackendGroup.php')
-rw-r--r-- | includes/filebackend/FileBackendGroup.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 8bbc96d0..d790a996 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -87,6 +87,9 @@ class FileBackendGroup { $thumbDir = isset( $info['thumbDir'] ) ? $info['thumbDir'] : "{$directory}/thumb"; + $transcodedDir = isset( $info['transcodedDir'] ) + ? $info['transcodedDir'] + : "{$directory}/transcoded"; $fileMode = isset( $info['fileMode'] ) ? $info['fileMode'] : 0644; @@ -98,6 +101,7 @@ class FileBackendGroup { 'containerPaths' => array( "{$repoName}-public" => "{$directory}", "{$repoName}-thumb" => $thumbDir, + "{$repoName}-transcoded" => $transcodedDir, "{$repoName}-deleted" => $deletedDir, "{$repoName}-temp" => "{$directory}/temp" ), @@ -122,7 +126,9 @@ class FileBackendGroup { throw new MWException( "Cannot register a backend with no name." ); } $name = $config['name']; - if ( !isset( $config['class'] ) ) { + if ( isset( $this->backends[$name] ) ) { + throw new MWException( "Backend with name `{$name}` already registered." ); + } elseif ( !isset( $config['class'] ) ) { throw new MWException( "Cannot register backend `{$name}` with no class." ); } $class = $config['class']; @@ -178,7 +184,7 @@ class FileBackendGroup { * @return FileBackend|null Backend or null on failure */ public function backendFromPath( $storagePath ) { - list( $backend, $c, $p ) = FileBackend::splitStoragePath( $storagePath ); + list( $backend, , ) = FileBackend::splitStoragePath( $storagePath ); if ( $backend !== null && isset( $this->backends[$backend] ) ) { return $this->get( $backend ); } |