"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "includes/filebackend/FileBackendGroup.php" between
mediawiki-1.31.1.tar.gz and mediawiki-1.32.0.tar.gz

About: MediaWiki is a wiki engine (the collaborative editing software that runs for e.g. Wikipedia, the free encyclopedia).

FileBackendGroup.php  (mediawiki-1.31.1):FileBackendGroup.php  (mediawiki-1.32.0)
skipping to change at line 82 skipping to change at line 82
// Automatically create b/c backends for file repos... // Automatically create b/c backends for file repos...
$repos = array_merge( $wgForeignFileRepos, [ $wgLocalFileRepo ] ) ; $repos = array_merge( $wgForeignFileRepos, [ $wgLocalFileRepo ] ) ;
foreach ( $repos as $info ) { foreach ( $repos as $info ) {
$backendName = $info['backend']; $backendName = $info['backend'];
if ( is_object( $backendName ) || isset( $this->backends[ $backendName] ) ) { if ( is_object( $backendName ) || isset( $this->backends[ $backendName] ) ) {
continue; // already defined (or set to the objec t for some reason) continue; // already defined (or set to the objec t for some reason)
} }
$repoName = $info['name']; $repoName = $info['name'];
// Local vars that used to be FSRepo members... // Local vars that used to be FSRepo members...
$directory = $info['directory']; $directory = $info['directory'];
$deletedDir = isset( $info['deletedDir'] ) $deletedDir = $info['deletedDir'] ?? false; // deletion d
? $info['deletedDir'] isabled
: false; // deletion disabled $thumbDir = $info['thumbDir'] ?? "{$directory}/thumb";
$thumbDir = isset( $info['thumbDir'] ) $transcodedDir = $info['transcodedDir'] ?? "{$directory}/
? $info['thumbDir'] transcoded";
: "{$directory}/thumb";
$transcodedDir = isset( $info['transcodedDir'] )
? $info['transcodedDir']
: "{$directory}/transcoded";
// Get the FS backend configuration // Get the FS backend configuration
$autoBackends[] = [ $autoBackends[] = [
'name' => $backendName, 'name' => $backendName,
'class' => FSFileBackend::class, 'class' => FSFileBackend::class,
'lockManager' => 'fsLockManager', 'lockManager' => 'fsLockManager',
'containerPaths' => [ 'containerPaths' => [
"{$repoName}-public" => "{$directory}", "{$repoName}-public" => "{$directory}",
"{$repoName}-thumb" => $thumbDir, "{$repoName}-thumb" => $thumbDir,
"{$repoName}-transcoded" => $transcodedDi r, "{$repoName}-transcoded" => $transcodedDi r,
"{$repoName}-deleted" => $deletedDir, "{$repoName}-deleted" => $deletedDir,
"{$repoName}-temp" => "{$directory}/temp" "{$repoName}-temp" => "{$directory}/temp"
], ],
'fileMode' => isset( $info['fileMode'] ) ? $info[ 'fileMode'] : 0644, 'fileMode' => $info['fileMode'] ?? 0644,
'directoryMode' => $wgDirectoryMode, 'directoryMode' => $wgDirectoryMode,
]; ];
} }
// Register implicitly defined backends // Register implicitly defined backends
$this->register( $autoBackends, wfConfiguredReadOnlyReason() ); $this->register( $autoBackends, wfConfiguredReadOnlyReason() );
} }
/** /**
* Register an array of file backend configurations * Register an array of file backend configurations
skipping to change at line 132 skipping to change at line 126
throw new InvalidArgumentException( "Cannot regis ter a backend with no name." ); throw new InvalidArgumentException( "Cannot regis ter a backend with no name." );
} }
$name = $config['name']; $name = $config['name'];
if ( isset( $this->backends[$name] ) ) { if ( isset( $this->backends[$name] ) ) {
throw new LogicException( "Backend with name `{$n ame}` already registered." ); throw new LogicException( "Backend with name `{$n ame}` already registered." );
} elseif ( !isset( $config['class'] ) ) { } elseif ( !isset( $config['class'] ) ) {
throw new InvalidArgumentException( "Backend with name `{$name}` has no class." ); throw new InvalidArgumentException( "Backend with name `{$name}` has no class." );
} }
$class = $config['class']; $class = $config['class'];
$config['readOnly'] = !empty( $config['readOnly'] ) $config['readOnly'] = $config['readOnly'] ?? $readOnlyRea
? $config['readOnly'] son;
: $readOnlyReason;
unset( $config['class'] ); // backend won't need this unset( $config['class'] ); // backend won't need this
$this->backends[$name] = [ $this->backends[$name] = [
'class' => $class, 'class' => $class,
'config' => $config, 'config' => $config,
'instance' => null 'instance' => null
]; ];
} }
} }
 End of changes. 3 change blocks. 
13 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)