r62164 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62163‎ | r62164 | r62165 >
Date:03:54, 9 February 2010
Author:mah
Status:ok (Comments)
Tags:
Comment:
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().
Modified paths:
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromStash.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromStash.php
@@ -35,7 +35,7 @@
3636 * an opaque key to the user agent.
3737 */
3838
39 - parent::initialize( $name,
 39+ $this->initializePathInfo( $name,
4040 $this->getRealPath ( $sessionData['mTempPath'] ),
4141 $sessionData['mFileSize'],
4242 false
@@ -62,7 +62,7 @@
6363 return true;
6464 }
6565
66 -
 66+
6767 /**
6868 * There is no need to stash the image twice
6969 */
Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -36,7 +36,7 @@
3737 global $wgTmpDirectory;
3838
3939 $localFile = tempnam( $wgTmpDirectory, 'WEBUPLOAD' );
40 - parent::initialize( $name, $localFile, 0, true );
 40+ $this->initializePathInfo( $name, $localFile, 0, true );
4141
4242 $this->mUrl = trim( $url );
4343 }
Index: trunk/phase3/includes/upload/UploadBase.php
@@ -110,9 +110,14 @@
111111 public function __construct() {}
112112
113113 /**
114 - * Do the real variable initialization
 114+ * Initialize the path information
 115+ * @param $name string the desired destination name
 116+ * @param $tempPath string the temporary path
 117+ * @param $fileSize int the file size
 118+ * @param $removeTempFile bool (false) remove the temporary file?
 119+ * @return null
115120 */
116 - public function initialize( $name, $tempPath, $fileSize, $removeTempFile = false ) {
 121+ public function initializePathInfo( $name, $tempPath, $fileSize, $removeTempFile = false ) {
117122 $this->mDesiredDestName = $name;
118123 $this->mTempPath = $tempPath;
119124 $this->mFileSize = $fileSize;

Follow-up revisions

RevisionCommit summaryAuthorDate
r62229follow-up r62164mah09:59, 10 February 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61407follow up r61355mah05:20, 23 January 2010

Comments

#Comment by Tim Starling (talk | contribs)   05:48, 10 February 2010

UploadFromFile is broken now, "Fatal error: Call to undefined method UploadFromFile::initialize() in .../includes/upload/UploadFromFile.php on line 17"

#Comment by Siebrand (talk | contribs)   08:23, 12 February 2010

Fixed in r62164 -> new

#Comment by Tim Starling (talk | contribs)   09:50, 22 February 2010

Mark, please review the related revision r62639.

Status & tagging log