$class = $config['class'];
if ( $class === FileBackendMultiWrite::class ) {
+ // @todo How can we test this? What's the intended use-case?
foreach ( $config['backends'] as $index => $beConfig ) {
if ( isset( $beConfig['template'] ) ) {
// Config is just a modified version of a registered backend's.
'mimeCallback' => [ $this, 'guessMimeInternal' ],
'obResetFunc' => 'wfResetOutputBuffers',
'streamMimeFunc' => [ StreamFile::class, 'contentTypeFromPath' ],
- 'tmpDirectory' => wfTempDir(),
+ 'tmpFileFactory' => $services->getTempFSFileFactory(),
'statusWrapper' => [ Status::class, 'wrap' ],
'wanCache' => $services->getMainWANObjectCache(),
'srvCache' => ObjectCache::getLocalServerInstance( 'hash' ),
if ( !$type && $fsPath ) {
$type = $magic->guessMimeType( $fsPath, false );
} elseif ( !$type && strlen( $content ) ) {
- $tmpFile = TempFSFile::factory( 'mime_', '', wfTempDir() );
+ $tmpFile = MediaWikiServices::getInstance()->getTempFSFileFactory()
+ ->newTempFSFile( 'mime_', '' );
file_put_contents( $tmpFile->getPath(), $content );
$type = $magic->guessMimeType( $tmpFile->getPath(), false );
}