From e745bfed82c41901b1e718ee98bcd396b68ec6ed Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Tue, 2 Jul 2019 14:58:36 -0700 Subject: [PATCH] Drop UploadBase:: and UploadFromChunks::stashFileGetKey() and stashSession(), deprecated in 1.28 Change-Id: I2411753a24092a5c37434b095e594831ecff04e1 --- RELEASE-NOTES-1.34 | 3 +++ includes/upload/UploadBase.php | 25 ++----------------------- includes/upload/UploadFromChunks.php | 23 +---------------------- 3 files changed, 6 insertions(+), 45 deletions(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index c470fff22d..57d635e5ef 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -307,6 +307,9 @@ because of Phabricator reports. have been removed. * The UploadVerification hook, deprecated in 1.28, has been removed. Instead, use the UploadVerifyFile hook. +* UploadBase:: and UploadFromChunks::stashFileGetKey() and stashSession(), + deprecated in 1.28, have been removed. Instead, please use the getFileKey() + method on the response from doStashFile(). * … === Deprecations in 1.34 === diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 3d84ba484c..5b15e82f34 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -1122,6 +1122,8 @@ abstract class UploadBase { * @throws UploadStashNotLoggedInException */ public function stashFile( User $user = null ) { + wfDeprecated( __METHOD__, '1.28' ); + return $this->doStashFile( $user ); } @@ -1139,29 +1141,6 @@ abstract class UploadBase { return $file; } - /** - * Stash a file in a temporary directory, returning a key which can be used - * to find the file again. See stashFile(). - * - * @deprecated since 1.28 - * @return string File key - */ - public function stashFileGetKey() { - wfDeprecated( __METHOD__, '1.28' ); - return $this->doStashFile()->getFileKey(); - } - - /** - * alias for stashFileGetKey, for backwards compatibility - * - * @deprecated since 1.28 - * @return string File key - */ - public function stashSession() { - wfDeprecated( __METHOD__, '1.28' ); - return $this->doStashFile()->getFileKey(); - } - /** * If we've modified the upload file we need to manually remove it * on exit to clean up. diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index 1bd99c1660..cc527e7e4b 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -86,30 +86,9 @@ class UploadFromChunks extends UploadFromFile { */ public function stashFile( User $user = null ) { wfDeprecated( __METHOD__, '1.28' ); - $this->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 ); } /** -- 2.20.1