r69911 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69910‎ | r69911 | r69912 >
Date:21:08, 25 July 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Fixup some more wrong static usages
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)
  • /trunk/phase3/maintenance/installExtension.php (modified) (history)
  • /trunk/phase3/maintenance/tests/UploadFromUrlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/UploadFromUrlTest.php
@@ -180,7 +180,7 @@
181181 $job = Job::pop();
182182 $this->assertFalse( $job );
183183
184 - self::deleteFile( 'Test.png' );
 184+ $this->deleteFile( 'Test.png' );
185185
186186 $wgUser->addGroup( 'users' );
187187 $data = $this->doApiRequest( array(
@@ -207,7 +207,7 @@
208208
209209 $this->assertTrue( $t->exists() );
210210
211 - self::deleteFile( 'Test.png' );
 211+ $this->deleteFile( 'Test.png' );
212212 }
213213
214214 /**
Index: trunk/phase3/maintenance/installExtension.php
@@ -264,11 +264,13 @@
265265 */
266266 class LocalInstallerResource extends InstallerResource {
267267 function LocalInstallerResource( $path ) {
268 - InstallerResource::InstallerResource( $path, is_dir( $path ), true );
 268+ parent::InstallerResource( $path, is_dir( $path ), true );
269269 }
270270
271271 function fetch( $target ) {
272 - if ( $this->isdir ) return ExtensionInstaller::copyDir( $this->path, dirname( $target ) );
 272+ if ( $this->isdir ) {
 273+ return ExtensionInstaller::copyDir( $this->path, dirname( $target ) );
 274+ }
273275 else return $this->extract( $this->path, dirname( $target ) );
274276 }
275277
@@ -279,7 +281,7 @@
280282 */
281283 class WebInstallerResource extends InstallerResource {
282284 function WebInstallerResource( $path ) {
283 - InstallerResource::InstallerResource( $path, false, false );
 285+ parent::InstallerResource( $path, false, false );
284286 }
285287
286288 function fetch( $target ) {
@@ -305,7 +307,7 @@
306308 */
307309 class SVNInstallerResource extends InstallerResource {
308310 function SVNInstallerResource( $path ) {
309 - InstallerResource::InstallerResource( $path, true, false );
 311+ parent::InstallerResource( $path, true, false );
310312 }
311313
312314 function fetch( $target ) {
@@ -333,7 +335,9 @@
334336 var $tasks;
335337
336338 function ExtensionInstaller( $name, $source, $target ) {
337 - if ( !is_object( $source ) ) $source = InstallerResource::makeResource( $source );
 339+ if ( !is_object( $source ) ) {
 340+ $source = parent::makeResource( $source );
 341+ }
338342
339343 $this->name = $name;
340344 $this->source = $source;
Index: trunk/phase3/includes/ImagePage.php
@@ -760,7 +760,7 @@
761761 $this->loadFile();
762762 if ( !$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected() ) {
763763 // Standard article deletion
764 - Article::delete();
 764+ parent::delete();
765765 return;
766766 }
767767 $deleter = new FileDeleteForm( $this->img );
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -60,14 +60,14 @@
6161 * Upload stashed in a previous request
6262 */
6363 // Check the session key
64 - if ( !isset( $_SESSION[UploadBase::getSessionKey()][$this->mParams['sessionkey']] ) ) {
 64+ if ( !isset( $_SESSION[$this->mUpload->getSessionKey()][$this->mParams['sessionkey']] ) ) {
6565 $this->dieUsageMsg( array( 'invalid-session-key' ) );
6666 }
6767
6868 $this->mUpload = new UploadFromStash();
6969 $this->mUpload->initialize( $this->mParams['filename'],
7070 $this->mParams['sessionkey'],
71 - $_SESSION[UploadBase::getSessionKey()][$this->mParams['sessionkey']] );
 71+ $_SESSION[$this->mUpload->getSessionKey()][$this->mParams['sessionkey']] );
7272 } elseif ( isset( $this->mParams['filename'] ) ) {
7373 /**
7474 * Upload from URL, etc.

Follow-up revisions

RevisionCommit summaryAuthorDate
r70049Follow-up r70037: Fix ApiUpload by passing a WebRequestUpload to the the init...btongminh21:53, 27 July 2010

Comments

#Comment by Bryan (talk | contribs)   21:26, 27 July 2010

Breaks uploading, mUpload not set by then. I am working on a fix.

#Comment by Catrope (talk | contribs)   12:34, 14 December 2010
-		InstallerResource::InstallerResource( $path, is_dir( $path ), true );
+		parent::InstallerResource( $path, is_dir( $path ), true );

Use parent::__construct(). Multiple occurrences.

#Comment by Reedy (talk | contribs)   12:54, 14 December 2010

installExtension was killed in r69916, so nothing further to do here

Status & tagging log