From 2e2c089898d7a5cf8db7f548d5b3caf85a347039 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Tue, 9 Feb 2010 03:54:59 +0000 Subject: [PATCH] follow up r61407 rename UploadBase::initialize to UploadBase::initializeFileInfo Each sub-class implements initialize() with a different prototype. Only two sub-classes actually use the parent initialize(). --- includes/upload/UploadBase.php | 9 +++++++-- includes/upload/UploadFromStash.php | 4 ++-- includes/upload/UploadFromUrl.php | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index e55e7faa8e..d0f05f6b8e 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -110,9 +110,14 @@ abstract class UploadBase { public function __construct() {} /** - * Do the real variable initialization + * Initialize the path information + * @param $name string the desired destination name + * @param $tempPath string the temporary path + * @param $fileSize int the file size + * @param $removeTempFile bool (false) remove the temporary file? + * @return null */ - public function initialize( $name, $tempPath, $fileSize, $removeTempFile = false ) { + public function initializePathInfo( $name, $tempPath, $fileSize, $removeTempFile = false ) { $this->mDesiredDestName = $name; $this->mTempPath = $tempPath; $this->mFileSize = $fileSize; diff --git a/includes/upload/UploadFromStash.php b/includes/upload/UploadFromStash.php index 96059ebae5..37789bd5ab 100644 --- a/includes/upload/UploadFromStash.php +++ b/includes/upload/UploadFromStash.php @@ -35,7 +35,7 @@ class UploadFromStash extends UploadBase { * an opaque key to the user agent. */ - parent::initialize( $name, + $this->initializePathInfo( $name, $this->getRealPath ( $sessionData['mTempPath'] ), $sessionData['mFileSize'], false @@ -62,7 +62,7 @@ class UploadFromStash extends UploadBase { return true; } - + /** * There is no need to stash the image twice */ diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index 1975e93357..763dae38d1 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -36,7 +36,7 @@ class UploadFromUrl extends UploadBase { global $wgTmpDirectory; $localFile = tempnam( $wgTmpDirectory, 'WEBUPLOAD' ); - parent::initialize( $name, $localFile, 0, true ); + $this->initializePathInfo( $name, $localFile, 0, true ); $this->mUrl = trim( $url ); } -- 2.20.1