From 5fd23ed8b5eb9a07af0ce3d43eebb5b99f68d12b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 25 Jul 2010 17:47:41 +0000 Subject: [PATCH] More unused globals --- includes/Article.php | 1 - includes/Title.php | 2 -- includes/WebRequest.php | 1 - includes/db/DatabaseOracle.php | 1 - includes/extauth/vB.php | 2 +- includes/installer/CliInstaller.php | 4 ---- includes/installer/WebInstallerPage.php | 1 - includes/media/PNG.php | 3 +-- includes/parser/Parser_LinkHooks.php | 1 - maintenance/parserTests.inc | 1 - maintenance/tests/ApiSetup.php | 2 +- maintenance/tests/SearchDbTest.php | 1 - maintenance/tests/TimeAdjustTest.php | 2 +- maintenance/tests/TitlePermissionTest.php | 3 +-- maintenance/tests/UploadFromUrlTest.php | 2 +- maintenance/tests/UploadFromUrlTestSuite.php | 4 ++-- maintenance/tests/selenium/Selenium.php | 1 - 17 files changed, 8 insertions(+), 24 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 4903a8e2a2..fd668f28d6 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2375,7 +2375,6 @@ class Article { $returnto = $rc->getAttribute( 'rc_type' ) == RC_NEW ? 'Newpages' : 'Recentchanges'; $return = SpecialPage::getTitleFor( $returnto ); - $dbw = wfGetDB( DB_MASTER ); $errors = $rc->doMarkPatrolled(); if ( in_array( array( 'rcpatroldisabled' ), $errors ) ) { diff --git a/includes/Title.php b/includes/Title.php index 06aa98ea4a..cb2c554420 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -27,7 +27,6 @@ class Title { /** @name Static cache variables */ // @{ static private $titleCache = array(); - static private $interwikiCache = array(); // @} /** @@ -3487,7 +3486,6 @@ class Title { * @return \type{\bool} TRUE or FALSE */ public function isValidMoveTarget( $nt ) { - $dbw = wfGetDB( DB_MASTER ); # Is it an existing file? if ( $nt->getNamespace() == NS_FILE ) { $file = wfLocalFile( $nt ); diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 5db725ff24..1bde4aed6f 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -777,7 +777,6 @@ class WebRequest { class FauxRequest extends WebRequest { private $wasPosted = false; private $session = array(); - private $response; /** * @param $data Array of *non*-urlencoded key => value pairs, the diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 3866b1ef09..b3809b0f59 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -32,7 +32,6 @@ class ORAResult { private $stmt; private $nrows; - private $unique; private function array_unique_md( $array_in ) { $array_out = array(); $array_hashes = array(); diff --git a/includes/extauth/vB.php b/includes/extauth/vB.php index 23523665fe..355a7e6854 100644 --- a/includes/extauth/vB.php +++ b/includes/extauth/vB.php @@ -36,7 +36,7 @@ * @ingroup ExternalUser */ class ExternalUser_vB extends ExternalUser { - private $mDb, $mRow; + private $mRow; protected function initFromName( $name ) { return $this->initFromCond( array( 'username' => $name ) ); diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index bbb43fbfe0..ec968e716a 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -6,10 +6,6 @@ * @since 1.17 */ class CliInstaller extends CoreInstaller { - - /* The maintenance class in effect */ - private $maint; - private $optionMap = array( 'dbtype' => 'wgDBtype', 'dbserver' => 'wgDBserver', diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index b6b0266254..a630b5d181 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -846,7 +846,6 @@ class WebInstaller_Install extends WebInstallerPage { class WebInstaller_Complete extends WebInstallerPage { public function execute() { - global $IP; $this->startForm(); $this->addHTML( $this->parent->getInfoBox( diff --git a/includes/media/PNG.php b/includes/media/PNG.php index 57f4dc0ab5..21de7f2847 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -50,8 +50,7 @@ class PNGHandler extends BitmapHandler { return (boolean) $data; } function getLongDesc( $image ) { - global $wgUser, $wgLang; - $sk = $wgUser->getSkin(); + global $wgLang; $original = parent::getLongDesc( $image ); wfSuppressWarnings(); diff --git a/includes/parser/Parser_LinkHooks.php b/includes/parser/Parser_LinkHooks.php index 8b63de853c..7d4b03f3ad 100644 --- a/includes/parser/Parser_LinkHooks.php +++ b/includes/parser/Parser_LinkHooks.php @@ -128,7 +128,6 @@ class Parser_LinkHooks extends Parser $titleRegex = "/^([{$tc}]+)$/sD"; } - $sk = $this->mOptions->getSkin(); $holders = new LinkHolderArray( $this ); if( is_null( $this->mTitle ) ) { diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index f95cc69364..3c315ede7a 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -1259,7 +1259,6 @@ class DbTestPreviewer extends TestRecorder { * and all that fun stuff */ function start() { - global $wgDBtype; parent::start(); if ( ! $this->db->tableExists( 'testrun' ) diff --git a/maintenance/tests/ApiSetup.php b/maintenance/tests/ApiSetup.php index e4c1765a7d..7f34f111ad 100644 --- a/maintenance/tests/ApiSetup.php +++ b/maintenance/tests/ApiSetup.php @@ -7,7 +7,7 @@ abstract class ApiTestSetup extends PHPUnit_Framework_TestCase { protected static $apiUrl; function setup() { - global $wgServerName, $wgServer, $wgContLang, $wgAuth, $wgScriptPath, + global $wgServer, $wgContLang, $wgAuth, $wgScriptPath, $wgScriptExtension, $wgMemc, $wgRequest; self::$apiUrl = $wgServer . $wgScriptPath . "/api" . $wgScriptExtension; diff --git a/maintenance/tests/SearchDbTest.php b/maintenance/tests/SearchDbTest.php index e9884b32c1..370b0c45aa 100644 --- a/maintenance/tests/SearchDbTest.php +++ b/maintenance/tests/SearchDbTest.php @@ -3,7 +3,6 @@ class SearchDbTest extends SearchEngineTest { var $db; function setUp() { - global $wgDBprefix, $wgDBtype; $this->db = wfGetDB( DB_MASTER ); if ( !$this->db ) { $this->markTestIncomplete( "Can't find a database to test with." ); diff --git a/maintenance/tests/TimeAdjustTest.php b/maintenance/tests/TimeAdjustTest.php index f71fc4ec8b..820e7130fd 100644 --- a/maintenance/tests/TimeAdjustTest.php +++ b/maintenance/tests/TimeAdjustTest.php @@ -17,7 +17,7 @@ class TimeAdjustTest extends PHPUnit_Framework_TestCase { # Test offset usage for a given language::userAdjust function testUserAdjust() { - global $wgLocalTZoffset, $wgContLang, $wgUser; + global $wgLocalTZoffset, $wgContLang; $wgContLang = $en = Language::factory( 'en' ); diff --git a/maintenance/tests/TitlePermissionTest.php b/maintenance/tests/TitlePermissionTest.php index 6420266287..4d34e6fc75 100644 --- a/maintenance/tests/TitlePermissionTest.php +++ b/maintenance/tests/TitlePermissionTest.php @@ -10,7 +10,7 @@ class TitlePermissionTest extends PhpUnit_Framework_TestCase { static $altUserName; function setUp() { - global $wgAutoloadLocalClasses, $wgLocaltimezone, $wgLocalTZoffset; + global $wgLocaltimezone, $wgLocalTZoffset; self::$userName = "Useruser"; self::$altUserName = "Altuseruser"; date_default_timezone_set( $wgLocaltimezone ); @@ -40,7 +40,6 @@ class TitlePermissionTest extends PhpUnit_Framework_TestCase { } function setUserPerm( $perm ) { - global $wgUseRCPatrol, $wgUseNPPatrol; if ( is_array( $perm ) ) { self::$user->mRights = $perm; } else { diff --git a/maintenance/tests/UploadFromUrlTest.php b/maintenance/tests/UploadFromUrlTest.php index 65879c0ec6..e72137fee7 100644 --- a/maintenance/tests/UploadFromUrlTest.php +++ b/maintenance/tests/UploadFromUrlTest.php @@ -8,7 +8,7 @@ class nullClass { class UploadFromUrlTest extends ApiTestSetup { function setUp() { - global $wgEnableUploads, $wgLocalFileRepo, $wgAllowCopyUploads; + global $wgEnableUploads, $wgAllowCopyUploads; $wgEnableUploads = true; $wgAllowCopyUploads = true; diff --git a/maintenance/tests/UploadFromUrlTestSuite.php b/maintenance/tests/UploadFromUrlTestSuite.php index 2de8eba4ae..6dd1a2581e 100644 --- a/maintenance/tests/UploadFromUrlTestSuite.php +++ b/maintenance/tests/UploadFromUrlTestSuite.php @@ -16,7 +16,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache, $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc, $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo, - $wgNamespacesWithSubpages, $wgThumbnailScriptPath, $wgScriptPath, + $wgThumbnailScriptPath, $wgScriptPath, $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath; $wgScript = '/index.php'; @@ -45,7 +45,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite $messageMemc =& wfGetMessageCacheStorage(); $parserMemc =& wfGetParserCacheStorage(); - $wgContLang = new StubContLang; + //$wgContLang = new StubContLang; $wgUser = new StubUser; $wgLang = new StubUserLang; $wgOut = new StubObject( 'wgOut', 'OutputPage' ); diff --git a/maintenance/tests/selenium/Selenium.php b/maintenance/tests/selenium/Selenium.php index 7db805a102..688a69f51b 100644 --- a/maintenance/tests/selenium/Selenium.php +++ b/maintenance/tests/selenium/Selenium.php @@ -21,7 +21,6 @@ class Selenium extends Testing_Selenium { } public function start() { - global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost; parent::start(); $this->isStarted = true; } -- 2.20.1