X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fupload%2FUploadFromChunks.php;h=c28890baa177188d84a8b8c3f154904671c3d067;hb=60d5b8022d03fe13c8157c0dd08e404891bd2744;hp=58541b236a0e8d8b958a7175efa5bedfbc8667fe;hpb=508c30e38fe1db714f3bd99478c811b4094a9f7f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index 58541b236a..c28890baa1 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -1,4 +1,7 @@ verifyChunk(); - return parent::stashFile( $user ); - } - - /** - * @inheritDoc - * @throws UploadChunkVerificationException - * @deprecated since 1.28 - */ - public function stashFileGetKey() { - wfDeprecated( __METHOD__, '1.28' ); - $this->verifyChunk(); - return parent::stashFileGetKey(); - } - /** - * @inheritDoc - * @throws UploadChunkVerificationException - * @deprecated since 1.28 - */ - public function stashSession() { - wfDeprecated( __METHOD__, '1.28' ); $this->verifyChunk(); - return parent::stashSession(); + return parent::stashFile( $user ); } /** @@ -171,7 +160,8 @@ class UploadFromChunks extends UploadFromFile { // Get the file extension from the last chunk $ext = FileBackend::extensionFromPath( $this->mVirtualTempPath ); // Get a 0-byte temp file to perform the concatenation at - $tmpFile = TempFSFile::factory( 'chunkedupload_', $ext, wfTempDir() ); + $tmpFile = MediaWikiServices::getInstance()->getTempFSFileFactory() + ->newTempFSFile( 'chunkedupload_', $ext ); $tmpPath = false; // fail in concatenate() if ( $tmpFile ) { // keep alive with $this @@ -409,18 +399,3 @@ class UploadFromChunks extends UploadFromFile { } } } - -class UploadChunkZeroLengthFileException extends MWException { -} - -class UploadChunkFileException extends MWException { -} - -class UploadChunkVerificationException extends MWException { - public $msg; - public function __construct( array $res ) { - $this->msg = wfMessage( ...$res ); - parent::__construct( wfMessage( ...$res ) - ->inLanguage( 'en' )->useDatabase( false )->text() ); - } -}