follow up r61407
authorMark A. Hershberger <mah@users.mediawiki.org>
Tue, 9 Feb 2010 03:54:59 +0000 (03:54 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Tue, 9 Feb 2010 03:54:59 +0000 (03:54 +0000)
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
includes/upload/UploadFromStash.php
includes/upload/UploadFromUrl.php

index e55e7fa..d0f05f6 100644 (file)
@@ -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;
index 96059eb..37789bd 100644 (file)
@@ -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
         */
index 1975e93..763dae3 100644 (file)
@@ -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 );
        }