X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilebackend%2FFileBackendGroup.php;h=9e04d0963292d33233c35a679bf515dae77b3c40;hb=4858f8afdabb2a1d7c60b7c14b6f4d398056c07e;hp=7ec2357e5b8c00c3b60c7255fbba93d11d589500;hpb=41ba319eb6aaafb76b28bf161f2a48572bbfdbd7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 7ec2357e5b..9e04d09632 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -150,6 +150,7 @@ class FileBackendGroup { $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. @@ -186,7 +187,7 @@ class FileBackendGroup { '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' ), @@ -241,7 +242,8 @@ class FileBackendGroup { 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 ); }