From 8ce3c5cf23f920a0fea1c7d08fd2009716545133 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 25 Jul 2010 21:08:34 +0000 Subject: [PATCH] Fixup some more wrong static usages --- includes/ImagePage.php | 2 +- includes/api/ApiUpload.php | 4 ++-- maintenance/installExtension.php | 14 +++++++++----- maintenance/tests/UploadFromUrlTest.php | 4 ++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 3c778d37a7..9d827ee9fe 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -760,7 +760,7 @@ EOT $this->loadFile(); if ( !$this->img->exists() || !$this->img->isLocal() || $this->img->getRedirected() ) { // Standard article deletion - Article::delete(); + parent::delete(); return; } $deleter = new FileDeleteForm( $this->img ); diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index ca91c0406b..16e6420e0f 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -60,14 +60,14 @@ class ApiUpload extends ApiBase { * Upload stashed in a previous request */ // Check the session key - if ( !isset( $_SESSION[UploadBase::getSessionKey()][$this->mParams['sessionkey']] ) ) { + if ( !isset( $_SESSION[$this->mUpload->getSessionKey()][$this->mParams['sessionkey']] ) ) { $this->dieUsageMsg( array( 'invalid-session-key' ) ); } $this->mUpload = new UploadFromStash(); $this->mUpload->initialize( $this->mParams['filename'], $this->mParams['sessionkey'], - $_SESSION[UploadBase::getSessionKey()][$this->mParams['sessionkey']] ); + $_SESSION[$this->mUpload->getSessionKey()][$this->mParams['sessionkey']] ); } elseif ( isset( $this->mParams['filename'] ) ) { /** * Upload from URL, etc. diff --git a/maintenance/installExtension.php b/maintenance/installExtension.php index 94dcfd7daa..d0adff3582 100644 --- a/maintenance/installExtension.php +++ b/maintenance/installExtension.php @@ -264,11 +264,13 @@ class InstallerResource { */ class LocalInstallerResource extends InstallerResource { function LocalInstallerResource( $path ) { - InstallerResource::InstallerResource( $path, is_dir( $path ), true ); + parent::InstallerResource( $path, is_dir( $path ), true ); } function fetch( $target ) { - if ( $this->isdir ) return ExtensionInstaller::copyDir( $this->path, dirname( $target ) ); + if ( $this->isdir ) { + return ExtensionInstaller::copyDir( $this->path, dirname( $target ) ); + } else return $this->extract( $this->path, dirname( $target ) ); } @@ -279,7 +281,7 @@ class LocalInstallerResource extends InstallerResource { */ class WebInstallerResource extends InstallerResource { function WebInstallerResource( $path ) { - InstallerResource::InstallerResource( $path, false, false ); + parent::InstallerResource( $path, false, false ); } function fetch( $target ) { @@ -305,7 +307,7 @@ class WebInstallerResource extends InstallerResource { */ class SVNInstallerResource extends InstallerResource { function SVNInstallerResource( $path ) { - InstallerResource::InstallerResource( $path, true, false ); + parent::InstallerResource( $path, true, false ); } function fetch( $target ) { @@ -333,7 +335,9 @@ class ExtensionInstaller { var $tasks; function ExtensionInstaller( $name, $source, $target ) { - if ( !is_object( $source ) ) $source = InstallerResource::makeResource( $source ); + if ( !is_object( $source ) ) { + $source = parent::makeResource( $source ); + } $this->name = $name; $this->source = $source; diff --git a/maintenance/tests/UploadFromUrlTest.php b/maintenance/tests/UploadFromUrlTest.php index e72137fee7..b1567aeba4 100644 --- a/maintenance/tests/UploadFromUrlTest.php +++ b/maintenance/tests/UploadFromUrlTest.php @@ -180,7 +180,7 @@ class UploadFromUrlTest extends ApiTestSetup { $job = Job::pop(); $this->assertFalse( $job ); - self::deleteFile( 'Test.png' ); + $this->deleteFile( 'Test.png' ); $wgUser->addGroup( 'users' ); $data = $this->doApiRequest( array( @@ -207,7 +207,7 @@ class UploadFromUrlTest extends ApiTestSetup { $this->assertTrue( $t->exists() ); - self::deleteFile( 'Test.png' ); + $this->deleteFile( 'Test.png' ); } /** -- 2.20.1