removing unused globals and some whitespace cleaning
authorLupin <lupin-wp@users.mediawiki.org>
Tue, 7 Mar 2006 01:10:39 +0000 (01:10 +0000)
committerLupin <lupin-wp@users.mediawiki.org>
Tue, 7 Mar 2006 01:10:39 +0000 (01:10 +0000)
54 files changed:
includes/Article.php
includes/ChangesList.php
includes/Credits.php
includes/Database.php
includes/DatabaseOracle.php
includes/DatabasePostgreSQL.php
includes/DefaultSettings.php
includes/DifferenceEngine.php
includes/EditPage.php
includes/ExternalStoreDB.php
includes/ExternalStoreHttp.php
includes/Feed.php
includes/GlobalFunctions.php
includes/Group.php
includes/HistoryBlob.php
includes/HttpFunctions.php
includes/Image.php
includes/ImagePage.php
includes/OutputPage.php
includes/PageHistory.php
includes/Parser.php
includes/ParserCache.php
includes/ProfilerStub.php
includes/RawPage.php
includes/SearchTsearch2.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialAllpages.php
includes/SpecialBlockip.php
includes/SpecialContributions.php
includes/SpecialDisambiguations.php
includes/SpecialEmailuser.php
includes/SpecialImport.php
includes/SpecialIpblocklist.php
includes/SpecialListredirects.php
includes/SpecialLockdb.php
includes/SpecialNewimages.php
includes/SpecialNewpages.php
includes/SpecialPage.php
includes/SpecialPreferences.php
includes/SpecialPrefixindex.php
includes/SpecialRecentchanges.php
includes/SpecialRecentchangeslinked.php
includes/SpecialSearch.php
includes/SpecialUndelete.php
includes/SpecialUnlockdb.php
includes/SpecialUpload.php
includes/SpecialUploadMogile.php
includes/SpecialUserlogin.php
includes/SpecialWatchlist.php
includes/SpecialWhatlinkshere.php
includes/Title.php
includes/User.php
includes/WatchedItem.php

index bfdb68d..9fd25e3 100644 (file)
@@ -351,8 +351,6 @@ class Article {
         * Load the revision (including text) into this object
         */
        function loadContent() {
-               global $wgOut, $wgRequest;
-
                if ( $this->mContentLoaded ) return;
 
                # Query variables :P
@@ -621,8 +619,6 @@ class Article {
         * @access private
         */
        function loadLastEdit() {
-               global $wgOut;
-
                if ( -1 != $this->mUser )
                        return;
 
@@ -1139,7 +1135,7 @@ class Article {
         * @access private
         */
        function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
-               global $wgOut, $wgUser, $wgUseSquid;
+               global $wgUser;
 
                $fname = 'Article::insertNewArticle';
                wfProfileIn( $fname );
@@ -1330,7 +1326,7 @@ class Article {
         * first set $wgUser, and clean up $wgDeferredUpdates after each edit.
         */
        function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
-               global $wgOut, $wgUser, $wgDBtransactions, $wgMwRedir, $wgUseSquid;
+               global $wgUser, $wgDBtransactions, $wgUseSquid;
                global $wgPostCommitUpdateList, $wgUseFileCache;
 
                $fname = 'Article::updateArticle';
@@ -1476,8 +1472,7 @@ class Article {
         * the link tables and redirect to the new page.
         */
        function showArticle( $text, $subtitle , $sectionanchor = '', $me2, $now, $summary, $oldid ) {
-               global $wgOut, $wgUser;
-               global $wgUseEnotif;
+               global $wgOut;
 
                $fname = 'Article::showArticle';
                wfProfileIn( $fname );
@@ -1629,7 +1624,7 @@ class Article {
         * @return bool true on success
         */
        function updateRestrictions( $limit = array(), $reason = '' ) {
-               global $wgUser, $wgOut, $wgRequest;
+               global $wgUser;
 
                if ( !$wgUser->isAllowed( 'protect' ) ) {
                        return false;
@@ -1905,7 +1900,7 @@ class Article {
         * Perform a deletion and output success or failure messages
         */
        function doDelete( $reason ) {
-               global $wgOut, $wgUser, $wgContLang;
+               global $wgOut, $wgUser;
                $fname = 'Article::doDelete';
                wfDebug( $fname."\n" );
 
@@ -1934,7 +1929,7 @@ class Article {
         * Returns success
         */
        function doDeleteArticle( $reason ) {
-               global $wgUser, $wgUseSquid, $wgDeferredUpdateList;
+               global $wgUseSquid, $wgDeferredUpdateList;
                global $wgPostCommitUpdateList, $wgUseTrackbacks;
 
                $fname = 'Article::doDeleteArticle';
@@ -2185,7 +2180,7 @@ class Article {
 
                # Parse the text
                $options = new ParserOptions;
-                $options->setTidy(true);
+               $options->setTidy(true);
                $poutput = $wgParser->parse( $text, $this->mTitle, $options, true, true, $newid );
 
                # Save it to the parser cache
@@ -2305,7 +2300,6 @@ class Article {
                        $touched = $this->mTouched;
                        $cache = new CacheManager( $this->mTitle );
                        if($cache->isFileCacheGood( $touched )) {
-                               global $wgOut;
                                wfDebug( " tryFileCache() - about to load\n" );
                                $cache->loadFromFileCache();
                                return true;
index d46d5ff..0f814f0 100644 (file)
@@ -175,8 +175,8 @@ class ChangesList {
 
        function insertTimestamp(&$s, &$rc) {
                global $wgLang;
-        # Timestamp
-        $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
+               # Timestamp
+               $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
        }
 
        /** Insert links to user page, user talk page and eventually a blocking link */
@@ -287,7 +287,7 @@ class OldChangesList extends ChangesList {
         * Format a line using the old system (aka without any javascript).
         */
        function recentChangesLine( &$rc, $watched = false ) {
-               global $wgLang, $wgContLang, $wgUser, $wgSysopUserBans;
+               global $wgContLang;
 
                $fname = 'ChangesList::recentChangesLineOld';
                wfProfileIn( $fname );
@@ -351,7 +351,7 @@ class EnhancedChangesList extends ChangesList {
         * Format a line for enhanced recentchange (aka with javascript and block of lines).
         */
        function recentChangesLine( &$baseRC, $watched = false ) {
-               global $wgLang, $wgContLang, $wgUser, $wgSysopUserBans;
+               global $wgLang, $wgContLang;
 
                # Create a specialised object
                $rc = RCCacheEntry::newFromParent( $baseRC );
index 7131789..67b85ca 100644 (file)
  * This is largely cadged from PageHistory::history
  */
 function showCreditsPage($article) {
-    global $wgOut;
+       global $wgOut;
 
-    $fname = 'showCreditsPage';
+       $fname = 'showCreditsPage';
 
-    wfProfileIn( $fname );
-
-    $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
-    $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
-    $wgOut->setArticleFlag( false );
-    $wgOut->setArticleRelated( true );
-    $wgOut->setRobotpolicy( 'noindex,nofollow' );
-
-    if( $article->mTitle->getArticleID() == 0 ) {
+       wfProfileIn( $fname );
+       
+       $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
+       $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
+       $wgOut->setArticleFlag( false );
+       $wgOut->setArticleRelated( true );
+       $wgOut->setRobotpolicy( 'noindex,nofollow' );
+
+       if( $article->mTitle->getArticleID() == 0 ) {
                $s = wfMsg( 'nocredits' );
-    } else {
+       } else {
                $s = getCredits($article, -1);
-    }
+       }
 
-    $wgOut->addHTML( $s );
+       $wgOut->addHTML( $s );
 
-    wfProfileOut( $fname );
+       wfProfileOut( $fname );
 }
 
 function getCredits($article, $cnt, $showIfMax=true) {
        $fname = 'getCredits';
        wfProfileIn( $fname );
-    $s = '';
+       $s = '';
 
-    if (isset($cnt) && $cnt != 0) {
+       if (isset($cnt) && $cnt != 0) {
                $s = getAuthorCredits($article);
                if ($cnt > 1 || $cnt < 0) {
                        $s .= ' ' . getContributorCredits($article, $cnt - 1, $showIfMax);
                }
-    }
+       }
 
        wfProfileOut( $fname );
-    return $s;
+       return $s;
 }
 
 /**
  *
  */
 function getAuthorCredits($article) {
-    global $wgLang, $wgAllowRealName;
+       global $wgLang, $wgAllowRealName;
 
-    $last_author = $article->getUser();
+       $last_author = $article->getUser();
 
-    if ($last_author == 0) {
+       if ($last_author == 0) {
                $author_credit = wfMsg('anonymous');
-    } else {
+       } else {
                if($wgAllowRealName) { $real_name = User::whoIsReal($last_author); }
                $user_name = User::whoIs($last_author);
 
@@ -83,15 +83,15 @@ function getAuthorCredits($article) {
                } else {
                        $author_credit = wfMsg('siteuser', creditLink($user_name));
                }
-    }
+       }
 
-    $timestamp = $article->getTimestamp();
-    if ($timestamp) {
+       $timestamp = $article->getTimestamp();
+       if ($timestamp) {
                $d = $wgLang->timeanddate($article->getTimestamp(), true);
-    } else {
+       } else {
                $d = '';
-    }
-    return wfMsg('lastmodifiedby', $d, $author_credit);
+       }
+       return wfMsg('lastmodifiedby', $d, $author_credit);
 }
 
 /**
@@ -99,31 +99,31 @@ function getAuthorCredits($article) {
  */
 function getContributorCredits($article, $cnt, $showIfMax) {
 
-    global $wgLang, $wgAllowRealName;
+       global $wgLang, $wgAllowRealName;
 
-    $contributors = $article->getContributors();
+       $contributors = $article->getContributors();
 
-    $others_link = '';
+       $others_link = '';
 
-    # Hmm... too many to fit!
+       # Hmm... too many to fit!
 
-    if ($cnt > 0 && count($contributors) > $cnt) {
+       if ($cnt > 0 && count($contributors) > $cnt) {
                $others_link = creditOthersLink($article);
                if (!$showIfMax) {
                        return wfMsg('othercontribs', $others_link);
                } else {
                        $contributors = array_slice($contributors, 0, $cnt);
                }
-    }
+       }
 
-    $real_names = array();
-    $user_names = array();
+       $real_names = array();
+       $user_names = array();
 
-    $anon = '';
+       $anon = '';
 
-    # Sift for real versus user names
+       # Sift for real versus user names
 
-    foreach ($contributors as $user_parts) {
+       foreach ($contributors as $user_parts) {
                if ($user_parts[0] != 0) {
                        if ($wgAllowRealName && !empty($user_parts[2])) {
                                $real_names[] = creditLink($user_parts[1], $user_parts[2]);
@@ -133,55 +133,55 @@ function getContributorCredits($article, $cnt, $showIfMax) {
                } else {
                        $anon = wfMsg('anonymous');
                }
-    }
+       }
 
-    # Two strings: real names, and user names
+       # Two strings: real names, and user names
 
-    $real = $wgLang->listToText($real_names);
-    $user = $wgLang->listToText($user_names);
+       $real = $wgLang->listToText($real_names);
+       $user = $wgLang->listToText($user_names);
 
-    # "ThisSite user(s) A, B and C"
+       # "ThisSite user(s) A, B and C"
 
-    if (!empty($user)) {
-        $user = wfMsg('siteusers', $user);
-    }
+       if (!empty($user)) {
+               $user = wfMsg('siteusers', $user);
+       }
 
-    # This is the big list, all mooshed together. We sift for blank strings
+       # This is the big list, all mooshed together. We sift for blank strings
 
-    $fulllist = array();
+       $fulllist = array();
 
-    foreach (array($real, $user, $anon, $others_link) as $s) {
+       foreach (array($real, $user, $anon, $others_link) as $s) {
                if (!empty($s)) {
                        array_push($fulllist, $s);
                }
-    }
+       }
 
-    # Make the list into text...
+       # Make the list into text...
 
-    $creds = $wgLang->listToText($fulllist);
+       $creds = $wgLang->listToText($fulllist);
 
-    # "Based on work by ..."
+       # "Based on work by ..."
 
-    return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
+       return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
 }
 
 /**
  *
  */
 function creditLink($user_name, $link_text = '') {
-    global $wgUser, $wgContLang;
-    $skin = $wgUser->getSkin();
-    return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
-                                                  htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
+       global $wgUser, $wgContLang;
+       $skin = $wgUser->getSkin();
+       return $skin->makeLink($wgContLang->getNsText(NS_USER) . ':' . $user_name,
+                              htmlspecialchars( (empty($link_text)) ? $user_name : $link_text ));
 }
 
 /**
  *
  */
 function creditOthersLink($article) {
-    global $wgUser, $wgLang;
-    $skin = $wgUser->getSkin();
-    return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
+       global $wgUser;
+       $skin = $wgUser->getSkin();
+       return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
 }
 
 ?>
index 1dfe194..35525df 100644 (file)
@@ -359,7 +359,7 @@ class Database {
         * If errors are explicitly ignored, returns success
         */
        function query( $sql, $fname = '', $tempIgnore = false ) {
-               global $wgProfiling, $wgCommandLineMode;
+               global $wgProfiling;
 
                if ( $wgProfiling ) {
                        # generalizeSQL will probably cut down the query to reasonable
index c984240..e0763c3 100644 (file)
@@ -454,12 +454,12 @@ class DatabaseOracle extends Database {
 #              return "TO_TIMESTAMP('" . $this->strencode(wfTimestamp(TS_DB, $ts)) . "', 'RRRR-MM-DD HH24:MI:SS')";
        }
 
-        /**
-         * Return aggregated value function call
-         */
-        function aggregateValue ($valuedata,$valuename='value') {
-                return $valuedata;
-        }
+       /**
+        * Return aggregated value function call
+        */
+       function aggregateValue ($valuedata,$valuename='value') {
+               return $valuedata;
+       }
 
 
        function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
@@ -497,7 +497,7 @@ class DatabaseOracle extends Database {
        function immediateCommit( $fname = 'Database::immediateCommit' ) {
                oci_commit($this->mConn);
                $this->mTrxLevel = 0;
-        }
+       }
        function rollback( $fname = 'Database::rollback' ) {
                oci_rollback($this->mConn);
                $this->mTrxLevel = 0;
index 5dfda70..130a247 100644 (file)
@@ -121,8 +121,8 @@ class DatabasePgsql extends Database {
        function fetchRow( $res ) {
                @$row = pg_fetch_array( $res );
                if( pg_last_error($this->mConn) ) {
-                        wfDebugDieBacktrace( 'SQL error: ' . htmlspecialchars( pg_last_error($this->mConn) ) );
-                }
+                       wfDebugDieBacktrace( 'SQL error: ' . htmlspecialchars( pg_last_error($this->mConn) ) );
+               }
                return $row;
        }
 
@@ -365,7 +365,7 @@ class DatabasePgsql extends Database {
        }
 
        function limitResult($sql, $limit,$offset) {
-               return "$sql LIMIT $limit ".(is_numeric($offset)?" OFFSET {$offset} ":"");
+               return "$sql LIMIT $limit ".(is_numeric($offset)?" OFFSET {$offset} ":"");
        }
 
        /**
@@ -391,12 +391,12 @@ class DatabasePgsql extends Database {
                return wfTimestamp(TS_DB,$ts);
        }
 
-        /**
-         * Return aggregated value function call
-         */
-        function aggregateValue ($valuedata,$valuename='value') {
-                return $valuedata;
-        }
+       /**
+        * Return aggregated value function call
+        */
+       function aggregateValue ($valuedata,$valuename='value') {
+               return $valuedata;
+       }
 
 
        function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
index c99bbd7..1b9757b 100644 (file)
@@ -63,7 +63,7 @@ $wgServer = $wgProto.'://' . $wgServerName;
 # If the port is a non-standard one, add it to the URL
 if(    isset( $_SERVER['SERVER_PORT'] )
     && (    ( $wgProto == 'http' && $_SERVER['SERVER_PORT'] != 80 )
-         || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
+        || ( $wgProto == 'https' && $_SERVER['SERVER_PORT'] != 443 ) ) ) {
 
        $wgServer .= ":" . $_SERVER['SERVER_PORT'];
 }
index be3db6e..492aa4a 100644 (file)
@@ -72,8 +72,8 @@ class DifferenceEngine {
        }
 
        function showDiffPage() {
-               global $wgUser, $wgOut, $wgContLang, $wgOnlySysopsCanPatrol,
-                      $wgUseExternalEditor, $wgUseRCPatrol;
+               global $wgUser, $wgOut, $wgContLang, $wgOnlySysopsCanPatrol;
+               global $wgUseExternalEditor, $wgUseRCPatrol;
                $fname = 'DifferenceEngine::showDiffPage';
                wfProfileIn( $fname );
 
@@ -317,7 +317,7 @@ CONTROL;
         * Returns false on error
         */
        function getDiffBody() {
-               global $wgContLang, $wgMemc, $wgDBname;
+               global $wgMemc, $wgDBname;
                $fname = 'DifferenceEngine::getDiffBody';
                wfProfileIn( $fname );
                
@@ -1683,7 +1683,6 @@ class TableDiffFormatter extends DiffFormatter
        }
 
        function _start_block( $header ) {
-               global $wgOut;
                echo $header;
        }
 
index e15dc15..480533c 100644 (file)
@@ -156,8 +156,8 @@ class EditPage {
         * the newly-edited page.
         */
        function edit() {
-               global $wgOut, $wgUser, $wgRequest, $wgTitle,
-                      $wgEmailConfirmToEdit;
+               global $wgOut, $wgUser, $wgRequest, $wgTitle;
+               global $wgEmailConfirmToEdit;
 
                if ( ! wfRunHooks( 'AlternateEdit', array( &$this  ) ) )
                        return;
@@ -1218,7 +1218,7 @@ END
                        } else if(preg_match("/\\.js$/", $wgTitle->getText() ) ) {
                                $previewtext = wfMsg('userjspreview');
                        }
-                        $parserOptions->setTidy(true);
+                       $parserOptions->setTidy(true);
                        $parserOutput = $wgParser->parse( $previewtext , $wgTitle, $parserOptions );
                        $wgOut->addHTML( $parserOutput->mText );
                        wfProfileOut( $fname );
@@ -1238,7 +1238,7 @@ END
                        }
 
                        if ( $this->mMetaData != "" ) $toparse .= "\n" . $this->mMetaData ;
-                        $parserOptions->setTidy(true);
+                       $parserOptions->setTidy(true);
                        $parserOutput = $wgParser->parse( $this->mArticle->preSaveTransform( $toparse ) ."\n\n",
                                        $wgTitle, $parserOptions );
 
@@ -1545,8 +1545,6 @@ END
         * @return string HTML
         */
        function getDiff() {
-               global $wgUser;
-
                require_once( 'DifferenceEngine.php' );
                $oldtext = $this->mArticle->fetchContent();
                $newtext = $this->mArticle->replaceSection(
index c0fef52..beb4041 100644 (file)
@@ -65,7 +65,6 @@ class ExternalStoreDB {
        }
 
        function fetchFromURL($url) {
-               global $wgExternalServers;
                #
                # URLs have the form DB://cluster/id or DB://cluster/id/itemid for concatenated storage
                #
@@ -127,7 +126,6 @@ class ExternalStoreDB {
         * @return string URL
         */
        function store( $cluster, $data ) {
-               global $wgExternalServers;
                $fname = 'ExternalStoreDB::store';
 
                $dbw =& $this->getMaster( $cluster );
index f818de1..daf62cc 100644 (file)
@@ -10,9 +10,9 @@
 class ExternalStoreHttp {
        /* Fetch data from given URL */
        function fetchFromURL($url) {
-        ini_set( "allow_url_fopen", true );
-        $ret = file_get_contents( $url );
-        ini_set( "allow_url_fopen", false );
+       ini_set( "allow_url_fopen", true );
+       $ret = file_get_contents( $url );
+       ini_set( "allow_url_fopen", false );
                return $ret;
        }
 
index e0da06d..9b4816b 100644 (file)
@@ -237,7 +237,7 @@ class AtomFeed extends ChannelFeed {
         * @todo document
         */
        function outHeader() {
-               global $wgVersion, $wgOut;
+               global $wgVersion;
 
                $this->outXmlHeader();
                ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
index 215212e..377ee11 100644 (file)
@@ -716,7 +716,7 @@ function wfShowingResultsNum( $offset, $limit, $num ) {
  * @todo document
  */
 function wfViewPrevNext( $offset, $limit, $link, $query = '', $atend = false ) {
-       global $wgUser, $wgLang;
+       global $wgLang;
        $fmtLimit = $wgLang->formatNum( $limit );
        $prev = wfMsg( 'prevn', $fmtLimit );
        $next = wfMsg( 'nextn', $fmtLimit );
@@ -760,7 +760,7 @@ function wfViewPrevNext( $offset, $limit, $link, $query = '', $atend = false ) {
  * @todo document
  */
 function wfNumLink( $offset, $limit, &$title, $query = '' ) {
-       global $wgUser, $wgLang;
+       global $wgLang;
        if ( '' == $query ) { $q = ''; }
        else { $q = $query.'&'; }
        $q .= 'limit='.$limit.'&offset='.$offset;
@@ -1275,8 +1275,8 @@ define('TS_ORACLE', 6);
 
 /**
  * @param mixed $outputtype A timestamp in one of the supported formats, the
- *                          function will autodetect which format is supplied
-                            and act accordingly.
+ *                         function will autodetect which format is supplied
+                           and act accordingly.
  * @return string Time in the format specified in $outputtype
  */
 function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
@@ -1620,26 +1620,26 @@ function wfMkdirParents( $fullDir, $mode ) {
 /**
  * Increment a statistics counter
  */
-function wfIncrStats( $key ) {
-       global $wgDBname, $wgMemc;
-        /* LIVE HACK AVOID MEMCACHED ACCESSES DURING HIGH LOAD */
-        if ($wgDBname != 'enwiki' and $wgDBname != 'dewiki' and $wgDBname != 'commonswiki' and $wgDBname != 'testwiki')
-            return true;
-        static $socket;
-        if (!$socket) {
-            $socket=socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
-            $statline="{$wgDBname} - 1 1 1 1 1 -total\n";
-            socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
-        }
-        $statline="{$wgDBname} - 1 1 1 1 1 {$key}\n";
-        socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
-        return true;
-
-       $key = "$wgDBname:stats:$key";
-       if ( is_null( $wgMemc->incr( $key ) ) ) {
-               $wgMemc->add( $key, 1 );
-       }
-}
+ function wfIncrStats( $key ) {
+        global $wgDBname, $wgMemc;
+        /* LIVE HACK AVOID MEMCACHED ACCESSES DURING HIGH LOAD */
+        if ($wgDBname != 'enwiki' and $wgDBname != 'dewiki' and $wgDBname != 'commonswiki' and $wgDBname != 'testwiki')
+                return true;
+        static $socket;
+        if (!$socket) {
+                $socket=socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+                $statline="{$wgDBname} - 1 1 1 1 1 -total\n";
+                socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
+        }
+        $statline="{$wgDBname} - 1 1 1 1 1 {$key}\n";
+        socket_sendto($socket,$statline,strlen($statline),0,"webster","3811");
+        return true;
+
+        $key = "$wgDBname:stats:$key";
+        if ( is_null( $wgMemc->incr( $key ) ) ) {
+                $wgMemc->add( $key, 1 );
+        }
+ }
 
 /**
  * @param mixed $nr The number to format
index cc4a05d..bec94e9 100644 (file)
@@ -167,7 +167,7 @@ class Group {
         * @param integer $id Group database id
         */
        function newFromId($id) {
-               global $wgMemc, $wgDBname;
+               global $wgMemc;
                $fname = 'Group::newFromId';
 
                $staticGroups =& Group::getStaticGroups();
index eb4b7eb..5492ce0 100644 (file)
@@ -200,16 +200,16 @@ class HistoryBlobStub {
       /**
        * Sets the location (old_id) of the referring object
        */
-      function setReferrer( $id ) {
-              $this->mRef = $id;
-      }
+       function setReferrer( $id ) {
+               $this->mRef = $id;
+       }
 
       /**
        * Gets the location of the referring object
        */
-      function getReferrer() {
-              return $this->mRef;
-      }
+       function getReferrer() {
+               return $this->mRef;
+       }
 
        /** @todo document */
        function getText() {
index 2c2fd4c..f23a145 100644 (file)
@@ -9,7 +9,7 @@
  * if $timeout is 'default', $wgHTTPTimeout is used
  */
 function wfGetHTTP( $url, $timeout = 'default' ) {
-       global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle, $wgCommandLineMode;
+       global $wgHTTPTimeout, $wgHTTPProxy, $wgVersion, $wgTitle;
 
        # Use curl if available
        if ( function_exists( 'curl_init' ) ) {
index 0afad68..7096526 100644 (file)
@@ -212,8 +212,7 @@ class Image
         * Load metadata from the file itself
         */
        function loadFromFile() {
-               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang,
-                      $wgShowEXIF;
+               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang, $wgShowEXIF;
                $fname = 'Image::loadFromFile';
                wfProfileIn( $fname );
                $this->imagePath = $this->getFullPath();
@@ -742,8 +741,8 @@ class Image
                        $base = $wgUploadBaseUrl;
                        $path = $wgUploadPath;
                }
-               $url = "{$base}{$path}" .  wfGetHashPath($name, $fromSharedDirectory) . "{$name}";
-               return wfUrlencode( $url );
+               $url = "{$base}{$path}" .  wfGetHashPath($name, $fromSharedDirectory) . "{$name}";
+               return wfUrlencode( $url );
        }
 
        /**
@@ -909,7 +908,6 @@ class Image
         */
        function renderThumb( $width, $useScript = true ) {
                global $wgUseSquid, $wgInternalServer;
-               global $wgThumbnailScriptPath, $wgSharedThumbnailScriptPath;
                global $wgSVGMaxSize, $wgMaxImageArea, $wgThumbnailEpoch;
 
                $fname = 'Image::renderThumb';
@@ -1047,8 +1045,8 @@ class Image
         * @access private
         */
        function reallyRenderThumb( $thumbPath, $width, $height ) {
-               global $wgSVGConverters, $wgSVGConverter,
-                       $wgUseImageMagick, $wgImageMagickConvertCommand;
+               global $wgSVGConverters, $wgSVGConverter;
+               global $wgUseImageMagick, $wgImageMagickConvertCommand;
 
                $this->load();
 
@@ -1246,7 +1244,7 @@ class Image
        }
 
        function checkDBSchema(&$db) {
-                global $wgCheckDBSchema;
+               global $wgCheckDBSchema;
                if (!$wgCheckDBSchema) {
                        return;
                }
@@ -1711,8 +1709,8 @@ function wfDeprecatedThumbDir( $thumbName , $subdir='thumb', $shared=false) {
  * @access public
  */
 function wfImageArchiveDir( $fname , $subdir='archive', $shared=false ) {
-       global $wgUploadDirectory, $wgHashedUploadDirectory,
-              $wgSharedUploadDirectory, $wgHashedSharedUploadDirectory;
+       global $wgUploadDirectory, $wgHashedUploadDirectory;
+       global $wgSharedUploadDirectory, $wgHashedSharedUploadDirectory;
        $dir = $shared ? $wgSharedUploadDirectory : $wgUploadDirectory;
        $hashdir = $shared ? $wgHashedSharedUploadDirectory : $wgHashedUploadDirectory;
        if (!$hashdir) { return $dir.'/'.$subdir; }
index dd5f4f7..0e55156 100644 (file)
@@ -473,7 +473,7 @@ END
        }
 
        function doDelete()     {
-               global $wgOut, $wgUser, $wgRequest, $wgUseSquid, $wgInternalServer;
+               global $wgOut, $wgRequest, $wgUseSquid, $wgInternalServer;
                global $wgPostCommitUpdateList;
 
                $fname = 'ImagePage::doDelete';
index 510b9eb..3517e45 100644 (file)
@@ -668,8 +668,6 @@ class OutputPage {
         * @param mixed $version The version of MediaWiki needed to use the page
         */
        function versionRequired( $version ) {
-               global $wgUser;
-
                $this->setPageTitle( wfMsg( 'versionrequired', $version ) );
                $this->setHTMLTitle( wfMsg( 'versionrequired', $version ) );
                $this->setRobotpolicy( 'noindex,nofollow' );
@@ -911,7 +909,7 @@ class OutputPage {
         */
        function headElement() {
                global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
-               global $wgUser, $wgContLang, $wgRequest, $wgUseTrackbacks, $wgTitle;
+               global $wgUser, $wgContLang, $wgUseTrackbacks, $wgTitle;
 
                if( $wgMimeType == 'text/xml' || $wgMimeType == 'application/xhtml+xml' || $wgMimeType == 'application/xml' ) {
                        $ret = "<?xml version=\"1.0\" encoding=\"$wgOutputEncoding\" ?>\n";
@@ -953,7 +951,7 @@ class OutputPage {
        }
 
        function getHeadLinks() {
-               global $wgRequest, $wgStylePath;
+               global $wgRequest;
                $ret = '';
                foreach ( $this->mMetatags as $tag ) {
                        if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
index e8a6c07..ddfe444 100644 (file)
@@ -50,7 +50,7 @@ class PageHistory {
         * @returns nothing
         */
        function history() {
-               global $wgUser, $wgOut, $wgRequest, $wgTitle;
+               global $wgOut, $wgRequest, $wgTitle;
 
                /*
                 * Allow client caching.
@@ -429,7 +429,6 @@ class PageHistory {
 
        /** @todo document */
        function fetchRevisions($limit, $offset, $direction) {
-               global $wgUser, $wgShowUpdatedMarker;
                $fname = 'PageHistory::fetchRevisions';
 
                $dbr =& wfGetDB( DB_SLAVE );
@@ -490,7 +489,7 @@ class PageHistory {
 
        /** @todo document */
        function makeNavbar($revisions, $offset, $limit, $direction) {
-               global $wgTitle, $wgLang;
+               global $wgLang;
 
                $revisions = array_slice($revisions, 0, $limit);
 
index 8165de7..3281865 100644 (file)
@@ -815,7 +815,6 @@ class Parser
         * @access private
         */
        function internalParse( $text ) {
-               global $wgContLang;
                $args = array();
                $isMain = true;
                $fname = 'Parser::internalParse';
@@ -3332,8 +3331,6 @@ class Parser
         * @access private
         */
        function getUserSig( &$user ) {
-               global $wgContLang;
-
                $username = $user->getName();
                $nickname = $user->getOption( 'nickname' );
                $nickname = $nickname === '' ? $username : $nickname;
@@ -3623,9 +3620,6 @@ class Parser
         * @return string
         */
        function replaceLinkHoldersText( $text ) {
-               global $wgUser;
-               global $wgOutputReplace;
-
                $fname = 'Parser::replaceLinkHoldersText';
                wfProfileIn( $fname );
 
@@ -3709,7 +3703,7 @@ class Parser
         * Parse image options text and use it to make an image
         */
        function makeImage( &$nt, $options ) {
-               global $wgContLang, $wgUseImageResize, $wgUser;
+               global $wgUseImageResize;
 
                $align = '';
 
@@ -3991,8 +3985,8 @@ class ParserOptions
 
        /** Get user options */
        function initialiseFromUser( &$userInput ) {
-               global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages,
-                      $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion;
+               global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
+               global $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion;
                $fname = 'ParserOptions::initialiseFromUser';
                wfProfileIn( $fname );
                if ( !$userInput ) {
index aa3194e..d9a7c84 100644 (file)
@@ -93,7 +93,7 @@ class ParserCache {
        }
 
        function save( $parserOutput, &$article, &$user ){
-                global $wgParserCacheExpireTime;
+               global $wgParserCacheExpireTime;
                $key = $this->getKey( $article, $user );
                $now = wfTimestampNow();
                $parserOutput->setCacheTime( $now );
index edadd5e..3bcdaab 100644 (file)
@@ -6,15 +6,15 @@ $haveProctitle=function_exists("setproctitle");
 function wfProfileIn( $fn = '' ) {
        global $hackwhere, $wgDBname, $haveProctitle;
        if ($haveProctitle) {
-               $hackwhere[] = $fn;
+               $hackwhere[] = $fn;
                setproctitle($fn . " [$wgDBname]");
-        }
+       }
 }
 function wfProfileOut( $fn = '' ) {
        global $hackwhere, $wgDBname, $haveProctitle;
-        if (!$haveProctitle)
-                return;
-        if (count($hackwhere))
+       if (!$haveProctitle)
+               return;
+       if (count($hackwhere))
                array_pop($hackwhere);
        if (count($hackwhere))
                setproctitle($hackwhere[count($hackwhere)-1] . " [$wgDBname]");
index 0e46df5..780ec7c 100644 (file)
@@ -151,8 +151,6 @@ class RawPage {
        }
 
        function getArticleText() {
-               global $wgParser;
-
                if( $this->mTitle ) {
                        $text = '';
 
index 2cff2cb..d04312f 100644 (file)
@@ -99,8 +99,8 @@ class SearchTsearch2 extends SearchEngine {
                        " $field @@ to_tsquery ('$match') " ;
        }
 
-        function update( $id, $title, $text ) {
-                $dbw=& wfGetDB(DB_MASTER);
+       function update( $id, $title, $text ) {
+               $dbw=& wfGetDB(DB_MASTER);
                $searchindex = $dbw->tableName( 'searchindex' );
                $sql = "DELETE FROM $searchindex WHERE si_page={$id}";
                $dbw->query($sql,"SearchTsearch2:update");
@@ -110,17 +110,17 @@ class SearchTsearch2 extends SearchEngine {
                                "'),to_tsvector('".
                                $dbw->strencode( $text)."')) ";
                $dbw->query($sql,"SearchTsearch2:update");
-        }
+       }
 
-        function updateTitle($id,$title) {
-                $dbw=& wfGetDB(DB_MASTER);
-                $searchindex = $dbw->tableName( 'searchindex' );
-                $sql = "UPDATE $searchindex SET si_title=to_tsvector('" .
-                          $db->strencode( $title ) .
-                          "') WHERE si_page={$id}";
+       function updateTitle($id,$title) {
+               $dbw=& wfGetDB(DB_MASTER);
+               $searchindex = $dbw->tableName( 'searchindex' );
+               $sql = "UPDATE $searchindex SET si_title=to_tsvector('" .
+                         $db->strencode( $title ) .
+                         "') WHERE si_page={$id}";
 
-                $dbw->query( $sql, "SearchMySQL4::updateTitle" );
-        }
+               $dbw->query( $sql, "SearchMySQL4::updateTitle" );
+       }
 
 }
 
index 4b506fe..5dafd69 100644 (file)
@@ -275,7 +275,7 @@ class Skin extends Linker {
 
        # get the user/site-specific stylesheet, SkinTemplate loads via RawPage.php (settings are cached that way)
        function getUserStylesheet() {
-               global $wgOut, $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
+               global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage;
                $sheet = $this->getStylesheet();
                $action = $wgRequest->getText('action');
                $s = "@import \"$wgStylePath/$sheet\";\n";
@@ -298,7 +298,6 @@ class Skin extends Linker {
         * Return html code that include User stylesheets
         */
        function getUserStyles() {
-               global $wgOut, $wgStylePath;
                $s = "<style type='text/css'>\n";
                $s .= "/*/*/ /*<![CDATA[*/\n"; # <-- Hide the styles from Netscape 4 without hiding them from IE/Mac
                $s .= $this->getUserStylesheet();
@@ -311,7 +310,7 @@ class Skin extends Linker {
         * Some styles that are set by user through the user settings interface.
         */
        function doGetUserStyles() {
-               global $wgUser, $wgContLang, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
+               global $wgUser, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
 
                $s = '';
 
@@ -413,7 +412,7 @@ END;
        }
 
        function doBeforeContent() {
-               global $wgOut, $wgTitle, $wgContLang;
+               global $wgContLang;
                $fname = 'Skin::doBeforeContent';
                wfProfileIn( $fname );
 
@@ -571,7 +570,7 @@ END;
        function doAfterContent() { }
 
        function pageTitleLinks() {
-               global $wgOut, $wgTitle, $wgUser, $wgContLang, $wgRequest;
+               global $wgOut, $wgTitle, $wgUser, $wgRequest;
 
                extract( $wgRequest->getValues( 'oldid', 'diff' ) );
                $action = $wgRequest->getText( 'action' );
@@ -664,7 +663,7 @@ END;
        }
 
        function pageTitle() {
-               global $wgOut, $wgTitle, $wgUser;
+               global $wgOut;
 
                $s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
                return $s;
@@ -920,7 +919,7 @@ END;
        }
 
        function getCopyrightIcon() {
-               global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgCopyrightIcon;
+               global $wgRightsUrl, $wgRightsText, $wgRightsIcon, $wgCopyrightIcon;
                $out = '';
                if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
                        $out = $wgCopyrightIcon;
@@ -984,7 +983,7 @@ END;
         * @TODO crash bug913. Need to be rewrote completly.
         */
        function specialPagesList() {
-               global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights;
+               global $wgUser, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights;
                require_once('SpecialPage.php');
                $a = array();
                $pages = SpecialPage::getPages();
@@ -1066,7 +1065,7 @@ END;
        }
 
        function editThisPage() {
-               global $wgOut, $wgTitle, $wgRequest;
+               global $wgOut, $wgTitle;
 
                if ( ! $wgOut->isArticleRelated() ) {
                        $s = wfMsg( 'protectedpage' );
@@ -1100,7 +1099,7 @@ END;
        }
 
        function deleteThisPage() {
-               global $wgUser, $wgOut, $wgTitle, $wgRequest;
+               global $wgUser, $wgTitle, $wgRequest;
 
                $diff = $wgRequest->getVal( 'diff' );
                if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('delete') ) {
@@ -1114,7 +1113,7 @@ END;
        }
 
        function protectThisPage() {
-               global $wgUser, $wgOut, $wgTitle, $wgRequest;
+               global $wgUser, $wgTitle, $wgRequest;
 
                $diff = $wgRequest->getVal( 'diff' );
                if ( $wgTitle->getArticleId() && ( ! $diff ) && $wgUser->isAllowed('protect') ) {
@@ -1133,7 +1132,7 @@ END;
        }
 
        function watchThisPage() {
-               global $wgUser, $wgOut, $wgTitle;
+               global $wgOut, $wgTitle;
 
                if ( $wgOut->isArticleRelated() ) {
                        if ( $wgTitle->userIsWatching() ) {
@@ -1221,7 +1220,7 @@ END;
        }
 
        function otherLanguages() {
-               global $wgOut, $wgContLang, $wgTitle, $wgHideInterlanguageLinks;
+               global $wgOut, $wgContLang, $wgHideInterlanguageLinks;
 
                if ( $wgHideInterlanguageLinks ) {
                        return '';
@@ -1317,7 +1316,7 @@ END;
        }
 
        function commentLink() {
-               global $wgContLang, $wgTitle;
+               global $wgTitle;
 
                if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
                        return '';
@@ -1400,7 +1399,7 @@ END;
         * @access private
         */
        function buildSidebar() {
-               global $wgTitle, $action, $wgDBname, $parserMemc;
+               global $wgDBname, $parserMemc;
                global $wgLanguageCode, $wgContLanguageCode;
 
                $fname = 'SkinTemplate::buildSidebar';
index 865b834..040e253 100644 (file)
@@ -447,7 +447,7 @@ class SkinTemplate extends Skin {
         * @access private
         */
        function buildPersonalUrls() {
-               global $wgTitle, $wgShowIPinHeader, $wgContLang;
+               global $wgTitle, $wgShowIPinHeader;
 
                $fname = 'SkinTemplate::buildPersonalUrls';
                $pageurl = $wgTitle->getLocalURL();
@@ -583,7 +583,7 @@ class SkinTemplate extends Skin {
         * @access private
         */
        function buildContentActionUrls () {
-               global $wgContLang, $wgDBprefix;
+               global $wgContLang;
                $fname = 'SkinTemplate::buildContentActionUrls';
                wfProfileIn( $fname );
 
@@ -764,14 +764,14 @@ class SkinTemplate extends Skin {
                wfProfileIn( $fname );
 
                global $wgUser, $wgRequest;
-               global $wgSiteSupportPage, $wgEnableUploads, $wgUploadNavigationUrl;
+               global $wgEnableUploads, $wgUploadNavigationUrl;
 
                $action = $wgRequest->getText( 'action' );
                $oldid = $wgRequest->getVal( 'oldid' );
                $diff = $wgRequest->getVal( 'diff' );
 
                $nav_urls = array();
-                $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
+               $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage'));
                if( $wgEnableUploads ) {
                        if ($wgUploadNavigationUrl) {
                                $nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );
@@ -993,7 +993,6 @@ class SkinTemplate extends Skin {
                $fname = 'SkinTemplate::getUserStylesheet';
                wfProfileIn( $fname );
 
-               global $wgUser;
                $s = "/* generated user stylesheet */\n";
                $s .= $this->reallyDoGetUserStyles();
                wfProfileOut( $fname );
index 25275a6..9208ee6 100644 (file)
@@ -49,7 +49,7 @@ class SpecialAllpages {
  * @param string $from Article name we are starting listing at.
  */
 function namespaceForm ( $namespace = NS_MAIN, $from = '' ) {
-       global $wgContLang, $wgScript;
+       global $wgScript;
        $t = Title::makeTitle( NS_SPECIAL, $this->name );
 
        $namespaceselect = HTMLnamespaceselector($namespace, null);
@@ -82,7 +82,7 @@ function namespaceForm ( $namespace = NS_MAIN, $from = '' ) {
  * @param integer $namespace (default NS_MAIN)
  */
 function showToplevel ( $namespace = NS_MAIN, $including = false ) {
-       global $wgOut, $wgContLang, $wgRequest, $wgUser;
+       global $wgOut, $wgUser;
        $sk = $wgUser->getSkin();
        $fname = "indexShowToplevel";
 
@@ -188,7 +188,7 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) {
  * @param integer $namespace (Default NS_MAIN)
  */
 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
-       global $wgOut, $wgUser;
+       global $wgUser;
        $sk = $wgUser->getSkin();
        $dbr =& wfGetDB( DB_SLAVE );
 
index 8a1a841..b3f67ab 100644 (file)
@@ -49,7 +49,7 @@ class IPBlockForm {
        }
 
        function showForm( $err ) {
-               global $wgOut, $wgUser, $wgRequest, $wgSysopUserBans;
+               global $wgOut, $wgUser, $wgSysopUserBans;
 
                $wgOut->setPagetitle( wfMsg( 'blockip' ) );
                $wgOut->addWikiText( wfMsg( 'blockiptext' ) );
@@ -227,7 +227,7 @@ class IPBlockForm {
        }
 
        function showSuccess() {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                $wgOut->setPagetitle( wfMsg( 'blockip' ) );
                $wgOut->setSubtitle( wfMsg( 'blockipsuccesssub' ) );
index 9386d97..34b5d2e 100644 (file)
@@ -155,8 +155,7 @@ class contribs_finder {
  * @param      string  $par    (optional) user name of the user for which to show the contributions
  */
 function wfSpecialContributions( $par = null ) {
-       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle,
-              $wgScript;
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle, $wgScript;
        $fname = 'wfSpecialContributions';
 
        $target = isset($par) ? $par : $wgRequest->getVal( 'target' );
@@ -206,7 +205,7 @@ function wfSpecialContributions( $par = null ) {
        }
 
        if ($wgRequest->getText('go') == 'first' && $target != 'newbies') {
-                $prevts = $finder->get_first_offset_for_paging();
+               $prevts = $finder->get_first_offset_for_paging();
                $prevurl = $title->getLocalURL($urlbits . "&offset=$prevts&limit=$limit$nsurl$boturl");
                $wgOut->redirect($prevurl);
                return;
@@ -306,11 +305,11 @@ function wfSpecialContributions( $par = null ) {
                $firstlink = "<a href=\"$myurl&amp;limit=$limit$xnsurl$boturl&amp;go=first\">$firsttext</a>";
                $nextlink = "<a href=\"$myurl&amp;offset=$lastts&amp;limit=$limit$xnsurl$boturl\">$nexttext</a>";
        }
-        if ($target == 'newbies') {
-            $firstlast ="($lastlink)";
-        } else {
-            $firstlast = "($lastlink | $firstlink)";
-        }
+       if ($target == 'newbies') {
+               $firstlast ="($lastlink)";
+       } else {
+               $firstlast = "($lastlink | $firstlink)";
+       }
 
        $urls = array();
        foreach (array(20, 50, 100, 250, 500) as $num)
@@ -351,7 +350,7 @@ function ucListEdit( $sk, $row ) {
        $fname = 'ucListEdit';
        wfProfileIn( $fname );
 
-       global $wgLang, $wgOut, $wgUser, $wgRequest;
+       global $wgLang, $wgUser, $wgRequest;
        static $messages;
        if( !isset( $messages ) ) {
                foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
index 16dcfb0..7bcb026 100644 (file)
@@ -38,8 +38,8 @@ class DisambiguationsPage extends PageQueryPage {
 
                $dp = Title::newFromText(wfMsgForContent('disambiguationspage'));
                $id = $dp->getArticleId();
-        $dns = $dp->getNamespace();
-        $dtitle = $dbr->addQuotes( $dp->getDBkey() );
+       $dns = $dp->getNamespace();
+       $dtitle = $dbr->addQuotes( $dp->getDBkey() );
 
                if($dns != NS_TEMPLATE) {
                        # FIXME we assume the disambiguation message is a template but
@@ -63,7 +63,7 @@ class DisambiguationsPage extends PageQueryPage {
 
        function formatResult( $skin, $result ) {
                $title = Title::newFromId( $result->value );
-        $dp = Title::makeTitle( $result->namespace, $result->title );
+       $dp = Title::makeTitle( $result->namespace, $result->title );
 
                $from = $skin->makeKnownLinkObj( $title,'');
                $edit = $skin->makeBrokenLinkObj( $title, "(".wfMsg("qbedit").")" , 'redirect=no');
index 59899c9..95f696f 100644 (file)
@@ -149,7 +149,7 @@ class EmailUserForm {
        }
 
        function showSuccess() {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                $wgOut->setPagetitle( wfMsg( "emailsent" ) );
                $wgOut->addHTML( wfMsg( "emailsenttext" ) );
index e0289af..e01ca8f 100644 (file)
@@ -599,8 +599,6 @@ class ImportStreamSource {
        }
 
        function newFromUpload( $fieldname = "xmlimport" ) {
-               global $wgOut;
-
                $upload =& $_FILES[$fieldname];
 
                if( !isset( $upload ) ) {
index aa0c824..f533192 100644 (file)
@@ -93,7 +93,7 @@ class IPUnblockForm {
        }
 
        function doSubmit() {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                $block = new Block();
                $this->ip = trim( $this->ip );
index c1e5ad6..a2483db 100644 (file)
@@ -29,8 +29,6 @@ class ListredirectsPage extends QueryPage {
        }
 
        function formatResult( $skin, $result ) {
-               global $wgContLang;
-
                # Make a link to the redirect itself
                $rd_title = Title::makeTitle( $result->namespace, $result->title );
                $rd_link = $skin->makeKnownLinkObj( $rd_title, '', 'redirect=no' );
index a07c1d8..3c153f9 100644 (file)
@@ -107,7 +107,7 @@ END
        }
 
        function showSuccess() {
-               global $wgOut, $wgUser;
+               global $wgOut;
 
                $wgOut->setPagetitle( wfMsg( 'lockdb' ) );
                $wgOut->setSubtitle( wfMsg( 'lockdbsuccesssub' ) );
index 98c6c36..58d434b 100644 (file)
@@ -12,8 +12,7 @@ require_once( 'ImageGallery.php' );
  *
  */
 function wfSpecialNewimages( $par, $specialPage ) {
-       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest,
-              $wgGroupPermissions;
+       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgGroupPermissions;
 
        $wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
        $dbr =& wfGetDB( DB_SLAVE );
index 76ee47e..b73d5b6 100644 (file)
@@ -41,19 +41,19 @@ class NewPagesPage extends QueryPage {
                # FIXME: text will break with compression
                return
                        "SELECT 'Newpages' as type,
-                               rc_namespace AS namespace,
-                               rc_title AS title,
-                               rc_cur_id AS cur_id,
-                               rc_user AS user,
-                               rc_user_text AS user_text,
-                               rc_comment as comment,
-                               rc_timestamp AS timestamp,
-                                rc_timestamp AS value,
-                               '{$usepatrol}' as usepatrol,
-                               rc_patrolled AS patrolled,
-                               rc_id AS rcid,
-                               page_len as length,
-                               page_latest as rev_id
+                               rc_namespace AS namespace,
+                               rc_title AS title,
+                               rc_cur_id AS cur_id,
+                               rc_user AS user,
+                               rc_user_text AS user_text,
+                               rc_comment as comment,
+                               rc_timestamp AS timestamp,
+                               rc_timestamp AS value,
+                               '{$usepatrol}' as usepatrol,
+                               rc_patrolled AS patrolled,
+                               rc_id AS rcid,
+                               page_len as length,
+                               page_latest as rev_id
                        FROM $recentchanges,$page
                        WHERE rc_cur_id=page_id AND rc_new=1
                        AND rc_namespace=" . $this->namespace . " AND page_is_redirect=0";
index f9a5ed9..17388ac 100644 (file)
@@ -225,7 +225,7 @@ class SpecialPage
         * @param $including      output is being captured for use in {{special:whatever}}
         */
        function executePath( &$title, $including = false ) {
-               global $wgSpecialPages, $wgOut, $wgTitle;
+               global $wgOut, $wgTitle;
                $fname = 'SpecialPage::executePath';
                wfProfileIn( $fname );
 
@@ -397,7 +397,7 @@ class SpecialPage
         * Checks user permissions, calls the function given in mFunction
         */
        function execute( $par ) {
-               global $wgUser, $wgOut, $wgTitle;
+               global $wgUser;
 
                $this->setHeaders();
 
index ff118f7..1bbd501 100644 (file)
@@ -187,7 +187,7 @@ class PreferencesForm {
         * @access private
         */
        function savePreferences() {
-               global $wgUser, $wgLang, $wgOut, $wgParser;
+               global $wgUser, $wgOut, $wgParser;
                global $wgEnableUserEmail, $wgEnableEmail;
                global $wgEmailAuthentication, $wgMinimalPasswordLength;
                global $wgAuth;
@@ -370,7 +370,7 @@ class PreferencesForm {
         * @access private
         */
        function namespacesCheckboxes() {
-               global $wgContLang, $wgUser;
+               global $wgContLang;
 
                # Determine namespace checkboxes
                $namespaces = $wgContLang->getNamespaces();
@@ -447,7 +447,7 @@ class PreferencesForm {
                } else if ( '' != $status ) {
                        $wgOut->addWikitext( $message . "\n----" );
                }
-
+               
                $qbs = $wgLang->getQuickbarSettings();
                $skinNames = $wgLang->getSkinNames();
                $mathopts = $wgLang->getMathNames();
@@ -658,12 +658,12 @@ class PreferencesForm {
                # Enotif
                if ($wgEnableEmail) {
                        $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'email' ) . '</legend>' );
-                        $wgOut->addHTML(
-                                $emailauthenticated.
-                                $enotifrevealaddr.
-                                $enotifwatchlistpages.
-                                $enotifusertalkpages.
-                                $enotifminoredits );
+                       $wgOut->addHTML(
+                                       $emailauthenticated.
+                                       $enotifrevealaddr.
+                                       $enotifwatchlistpages.
+                                       $enotifusertalkpages.
+                                       $enotifminoredits );
                        if ($wgEnableUserEmail) {
                        $emf = wfMsg( 'allowemail' );
                                $disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
@@ -672,7 +672,7 @@ class PreferencesForm {
                        }
 
                        $wgOut->addHTML( '</fieldset>' );
-                }
+               }
                # </FIXME>
 
                if ($wgAllowRealName || $wgEnableEmail) {
@@ -755,8 +755,8 @@ class PreferencesForm {
                        }
                        $wgOut->addHTML( "{$imageThumbOptions}</select></div></fieldset>\n\n");
 
-                # Date format
-                #
+               # Date format
+               #
                # Date/Time
                #
 
@@ -890,8 +890,8 @@ class PreferencesForm {
        <input type='hidden' name='wpEditToken' value='{$token}' />
        </div></form>\n" );
 
-       $wgOut->addWikiText( '<div class="prefcache">' . wfMsg('clearyourcache') . '</div>' );
-
+               $wgOut->addWikiText( '<div class="prefcache">' . wfMsg('clearyourcache') . '</div>' );
+       
        }
 }
 ?>
index d8adcbe..27a04c3 100644 (file)
@@ -60,8 +60,8 @@ function showChunk( $namespace = NS_MAIN, $from, $including = false ) {
 
        $fromTitle = Title::newFromURL( $from );
        if ($namespace == NS_MAIN and $fromTitle) {
-                $namespace = $fromTitle->getNamespace();
-        }
+               $namespace = $fromTitle->getNamespace();
+       }
 
        $fromKey = is_null( $fromTitle ) ? '' : $fromTitle->getDBkey();
 
index 32f9f05..66b4276 100644 (file)
@@ -366,7 +366,6 @@ function rcOutputFeed( $rows, $feedFormat, $limit, $hideminor, $lastmod ) {
 }
 
 function rcDoOutputFeed( $rows, &$feed ) {
-       global $wgSitename, $wgFeedClasses, $wgContLanguageCode;
        $fname = 'rcDoOutputFeed';
        wfProfileIn( $fname );
 
@@ -456,7 +455,7 @@ function rcDayLimitLinks( $days, $limit, $page='Recentchanges', $more='', $doall
  * Makes change an option link which carries all the other options
  */
 function makeOptionsLink( $title, $override, $options ) {
-       global $wgUser, $wgLang, $wgContLang;
+       global $wgUser, $wgContLang;
        $sk = $wgUser->getSkin();
        return $sk->makeKnownLink( $wgContLang->specialPage( 'Recentchanges' ),
                $title, wfArrayToCGI( $override, $options ) );
@@ -533,7 +532,7 @@ function rcOptionsPanel( $defaults, $nondefaults ) {
  * @return string
  */
 function rcNamespaceForm( $namespace, $invert, $nondefaults, $categories_any ) {
-       global $wgContLang, $wgScript, $wgAllowCategorizedRecentChanges, $wgRequest;
+       global $wgScript, $wgAllowCategorizedRecentChanges, $wgRequest;
        $t = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
 
        $namespaceselect = HTMLnamespaceselector($namespace, '');
index 0d11ef7..c543f89 100644 (file)
@@ -70,32 +70,32 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
        if( $nt->getNamespace() == NS_CATEGORY ) {
                $catkey = $dbr->addQuotes( $nt->getDBKey() );
                $sql = "SELECT /* wfSpecialRecentchangeslinked */
-                               rc_id,
-                               rc_cur_id,
-                               rc_namespace,
-                               rc_title,
-                               rc_this_oldid,
-                               rc_last_oldid,
-                               rc_user,
-                               rc_comment,
-                       rc_user_text,
-                               rc_timestamp,
-                               rc_minor,
-                                       rc_new,
-                                       rc_patrolled,
-                                       rc_type
+                               rc_id,
+                               rc_cur_id,
+                               rc_namespace,
+                               rc_title,
+                               rc_this_oldid,
+                               rc_last_oldid,
+                               rc_user,
+                               rc_comment,
+                               rc_user_text,
+                               rc_timestamp,
+                               rc_minor,
+                               rc_new,
+                               rc_patrolled,
+                               rc_type
 " . ($uid ? ",wl_user" : "") . "
-            FROM $categorylinks, $recentchanges
+           FROM $categorylinks, $recentchanges
 " . ($uid ? "LEFT OUTER JOIN $watchlist ON wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace " : "") . "
-           WHERE rc_timestamp > '{$cutoff}'
-             {$cmq}
-             AND cl_from=rc_cur_id
-             AND cl_to=$catkey
-        GROUP BY rc_cur_id,rc_namespace,rc_title,
-                 rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
-                 rc_new
-        ORDER BY rc_timestamp DESC
-           LIMIT {$limit};
+          WHERE rc_timestamp > '{$cutoff}'
+            {$cmq}
+            AND cl_from=rc_cur_id
+            AND cl_to=$catkey
+       GROUP BY rc_cur_id,rc_namespace,rc_title,
+               rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
+               rc_new
+               ORDER BY rc_timestamp DESC
+       LIMIT {$limit};
  ";
        } else {
                $sql =
@@ -104,7 +104,7 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
                        rc_cur_id,
                        rc_namespace,
                        rc_title,
-               rc_user,
+                       rc_user,
                        rc_comment,
                        rc_user_text,
                        rc_this_oldid,
@@ -123,8 +123,8 @@ function wfSpecialRecentchangeslinked( $par = NULL ) {
      AND pl_title=rc_title
      AND pl_from=$id
 GROUP BY rc_cur_id,rc_namespace,rc_title,
-         rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
-         rc_new
+        rc_user,rc_comment,rc_user_text,rc_timestamp,rc_minor,
+        rc_new
 ORDER BY rc_timestamp DESC
    LIMIT {$limit}";
        }
@@ -135,8 +135,8 @@ ORDER BY rc_timestamp DESC
        $wgOut->addHTML( "<hr />\n{$note}\n<br />" );
 
        $note = rcDayLimitlinks( $days, $limit, "Recentchangeslinked",
-                                 "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
-                                 false, $mlink );
+                                "target=" . $nt->getPrefixedURL() . "&hideminor={$hideminor}",
+                                false, $mlink );
 
        $wgOut->addHTML( $note."\n" );
 
index 61750b0..c76468b 100644 (file)
@@ -293,7 +293,6 @@ class SpecialSearch {
                $tm = $wgContLang->convertForSearchResult( $matches->termMatches() );
                $terms = implode( '|', $tm );
 
-               global $wgOut;
                $off = $this->offset + 1;
                $out = "<ol start='{$off}'>\n";
 
index 3825e0c..b38206d 100644 (file)
@@ -155,7 +155,7 @@ class PageArchive {
         * @return bool
         */
        function undelete( $timestamps ) {
-               global $wgDeferredUpdateList, $wgParser, $wgDBtype;
+               global $wgParser, $wgDBtype;
 
                $fname = "doUndeleteArticle";
                $restoreAll = empty( $timestamps );
index 6ff28c7..9d13808 100644 (file)
@@ -76,7 +76,7 @@ END
        }
 
        function doSubmit() {
-               global $wgOut, $wgUser, $wgRequest, $wgReadOnlyFile;
+               global $wgOut, $wgRequest, $wgReadOnlyFile;
 
                $wpLockConfirm = $wgRequest->getCheck( 'wpLockConfirm' );
                if ( ! $wpLockConfirm ) {
@@ -93,7 +93,7 @@ END
        }
 
        function showSuccess() {
-               global $wgOut, $wgUser;
+               global $wgOut;
                global $ip;
 
                $wgOut->setPagetitle( wfMsg( "unlockdb" ) );
index 70920a7..3bfd26e 100644 (file)
@@ -153,7 +153,7 @@ class UploadForm {
         * @access private
         */
        function processUpload() {
-               global $wgUser, $wgOut, $wgUploadDirectory;
+               global $wgUser, $wgOut;
 
                /* Check for PHP error if any, requires php 4.2 or newer */
                if ( $this->mUploadError == 1/*UPLOAD_ERR_INI_SIZE*/ ) {
@@ -344,7 +344,7 @@ class UploadForm {
         *                        is a PHP-managed upload temporary
         */
        function saveUploadedFile( $saveName, $tempName, $useRename = false ) {
-               global $wgUploadDirectory, $wgOut;
+               global $wgOut;
 
                $fname= "SpecialUpload::saveUploadedFile";
 
@@ -493,7 +493,7 @@ class UploadForm {
         * @access private
         */
        function uploadWarning( $warning ) {
-               global $wgOut, $wgUser, $wgUploadDirectory, $wgRequest;
+               global $wgOut;
                global $wgUseCopyrightUpload;
 
                $this->mSessionKey = $this->stashSession();
@@ -557,7 +557,7 @@ class UploadForm {
         * @access private
         */
        function mainUploadForm( $msg='' ) {
-               global $wgOut, $wgUser, $wgUploadDirectory, $wgRequest;
+               global $wgOut, $wgUser;
                global $wgUseCopyrightUpload;
 
                $cols = intval($wgUser->getOption( 'cols' ));
index 461d26d..a303e8c 100644 (file)
@@ -15,9 +15,9 @@ require_once( 'MogileFS.php' );
  * Entry point
  */
 function wfSpecialUploadMogile() {
-        global $wgRequest;
-        $form = new UploadFormMogile( $wgRequest );
-        $form->execute();
+       global $wgRequest;
+       $form = new UploadFormMogile( $wgRequest );
+       $form->execute();
 }
 
 /** @package MediaWiki */
index 7bdd3dc..ef58051 100644 (file)
@@ -132,7 +132,7 @@ class LoginForm {
         * @access private
         */
        function addNewAccount() {
-               global $wgUser, $wgOut, $wgEmailAuthentication;
+               global $wgUser, $wgEmailAuthentication;
 
                $u = $this->addNewAccountInternal();
 
@@ -351,8 +351,6 @@ class LoginForm {
         * @access private
         */
        function mailPassword() {
-               global $wgUser, $wgDBname;
-
                if ( '' == $this->mName ) {
                        $this->mainLoginForm( wfMsg( 'noname' ) );
                        return;
@@ -383,7 +381,6 @@ class LoginForm {
         * @access private
         */
        function mailPasswordInternal( $u ) {
-               global $wgPasswordSender, $wgIP;
                global $wgCookiePath, $wgCookieDomain, $wgCookiePrefix, $wgCookieSecure;
 
                if ( '' == $u->getEmail() ) {
@@ -444,7 +441,7 @@ class LoginForm {
         * @access private
         */
        function mainLoginForm( $msg, $msgtype = 'error' ) {
-               global $wgUser, $wgOut, $wgLang;
+               global $wgUser, $wgOut;
                global $wgAllowRealName, $wgEnableEmail;
                global $wgCookiePrefix;
                global $wgAuth;
@@ -546,7 +543,7 @@ class LoginForm {
         * @access private
         */
        function cookieRedirectCheck( $type ) {
-               global $wgOut, $wgLang;
+               global $wgOut;
 
                $titleObj = Title::makeTitle( NS_SPECIAL, 'Userlogin' );
                $check = $titleObj->getFullURL( 'wpCookieCheck='.$type );
index 572e3f4..352e2d0 100644 (file)
@@ -89,11 +89,11 @@ function wfSpecialWatchlist( $par ) {
        $dbr =& wfGetDB( DB_SLAVE );
        extract( $dbr->tableNames( 'page', 'revision', 'watchlist', 'recentchanges' ) );
 
-                       $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
-               $res = $dbr->query( $sql, $fname );
-               $s = $dbr->fetchObject( $res );
-
-        #      Patch *** A1 *** (see A2 below)
+       $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
+       $res = $dbr->query( $sql, $fname );
+       $s = $dbr->fetchObject( $res );
+       
+#      Patch *** A1 *** (see A2 below)
 #      adjust for page X, talk:page X, which are both stored separately, but treated together
        $nitems = floor($s->n / 2);
 #      $nitems = $s->n;
@@ -130,13 +130,13 @@ function wfSpecialWatchlist( $par ) {
                $docutoff = "AND rev_timestamp > '" .
                  ( $cutoff = $dbr->timestamp( time() - intval( $days * 86400 ) ) )
                  . "'";
-                  /*
-                  $sql = "SELECT COUNT(*) AS n FROM $page, $revision  WHERE rev_timestamp>'$cutoff' AND page_id=rev_page";
-                  $res = $dbr->query( $sql, $fname );
-                  $s = $dbr->fetchObject( $res );
-                  $npages = $s->n;
-                  */
-                  $npages = 40000 * $days;
+                 /*
+                 $sql = "SELECT COUNT(*) AS n FROM $page, $revision  WHERE rev_timestamp>'$cutoff' AND page_id=rev_page";
+                 $res = $dbr->query( $sql, $fname );
+                 $s = $dbr->fetchObject( $res );
+                 $npages = $s->n;
+                 */
+                 $npages = 40000 * $days;
 
        }
 
@@ -236,23 +236,23 @@ function wfSpecialWatchlist( $par ) {
                        "\n\n" );
        }
 
-        $sql = "SELECT
-          rc_namespace page_namespace,rc_title page_title,
-          rc_comment rev_comment, rc_cur_id page_id,
-          rc_user rev_user,rc_user_text rev_user_text,
-          rc_timestamp rev_timestamp,rc_minor rev_minor_edit,
-          rc_this_oldid rev_id,
-          rc_last_oldid,
-          rc_new page_is_new,wl_notificationtimestamp
-          FROM $watchlist,$recentchanges,$page
-          WHERE wl_user=$uid
-          AND wl_namespace=rc_namespace
-          AND wl_title=rc_title
-          AND rc_timestamp > '$cutoff'
-          AND rc_cur_id=page_id
-          $andHideOwn
-          $andHideBotsOptional
-          ORDER BY rc_timestamp DESC";
+       $sql = "SELECT
+         rc_namespace page_namespace,rc_title page_title,
+         rc_comment rev_comment, rc_cur_id page_id,
+         rc_user rev_user,rc_user_text rev_user_text,
+         rc_timestamp rev_timestamp,rc_minor rev_minor_edit,
+         rc_this_oldid rev_id,
+         rc_last_oldid,
+         rc_new page_is_new,wl_notificationtimestamp
+         FROM $watchlist,$recentchanges,$page
+         WHERE wl_user=$uid
+         AND wl_namespace=rc_namespace
+         AND wl_title=rc_title
+         AND rc_timestamp > '$cutoff'
+         AND rc_cur_id=page_id
+         $andHideOwn
+         $andHideBotsOptional
+         ORDER BY rc_timestamp DESC";
 
        $res = $dbr->query( $sql, $fname );
        $numRows = $dbr->numRows( $res );
index 540ea50..41465dd 100644 (file)
@@ -28,7 +28,7 @@ class WhatLinksHerePage {
        }
 
        function execute() {
-               global $wgUser, $wgOut;
+               global $wgOut;
 
                $this->limit = min( $this->request->getInt( 'limit', 50 ), 5000 );
                if ( $this->limit <= 0 ) {
@@ -73,7 +73,7 @@ class WhatLinksHerePage {
         * @access private
         */
        function showIndirectLinks( $level, $target, $limit, $from = 0, $dir = 'next' ) {
-               global $wgOut, $wgUser;
+               global $wgOut;
                $fname = 'WhatLinksHerePage::showIndirectLinks';
 
                $dbr =& wfGetDB( DB_READ );
index 3f276f6..31842ae 100644 (file)
@@ -46,12 +46,12 @@ class Title {
        var $mArticleID;          # Article ID, fetched from the link cache on demand
        var $mLatestID;         # ID of most recent revision
        var $mRestrictions;       # Array of groups allowed to edit this article
-                              # Only null or "sysop" are supported
+                               # Only null or "sysop" are supported
        var $mRestrictionsLoaded; # Boolean for initialisation on demand
        var $mPrefixedText;       # Text form including namespace/interwiki, initialised on demand
        var $mDefaultNamespace;   # Namespace index when there is no namespace
-                              # Zero except in {{transclusion}} tags
-       var $mWatched;            # Is $wgUser watching this page? NULL if unfilled, accessed through userIsWatching()
+                             # Zero except in {{transclusion}} tags
+       var $mWatched;      # Is $wgUser watching this page? NULL if unfilled, accessed through userIsWatching()
        /**#@-*/
 
 
@@ -651,7 +651,6 @@ class Title {
         * @access public
         */
        function getPrefixedText() {
-               global $wgContLang;
                if ( empty( $this->mPrefixedText ) ) { // FIXME: bad usage of empty() ?
                        $s = $this->prefix( $this->mTextform );
                        $s = str_replace( '_', ' ', $s );
@@ -668,7 +667,6 @@ class Title {
         * @access public
         */
        function getFullText() {
-               global $wgContLang;
                $text = $this->getPrefixedText();
                if( '' != $this->mFragment ) {
                        $text .= '#' . $this->mFragment;
@@ -855,8 +853,6 @@ class Title {
         * @access public
         */
        function getEditURL() {
-               global $wgServer, $wgScript;
-
                if ( '' != $this->mInterwiki ) { return ''; }
                $s = $this->getLocalURL( 'action=edit' );
 
@@ -985,7 +981,7 @@ class Title {
 
                # protect global styles and js
                if ( NS_MEDIAWIKI == $this->mNamespace
-                && preg_match("/\\.(css|js)$/", $this->mTextform )
+                && preg_match("/\\.(css|js)$/", $this->mTextform )
                     && !$wgUser->isAllowed('editinterface') ) {
                        wfProfileOut( $fname );
                        return false;
@@ -1594,7 +1590,7 @@ class Title {
                              AND pl_title=page_title
                            WHERE pl_from=?
                              AND page_namespace IS NULL
-                                 !",
+                                 !",
                        $db->tableName( 'pagelinks' ),
                        $db->tableName( 'page' ),
                        $this->getArticleId(),
@@ -1645,7 +1641,6 @@ class Title {
         * @access public
         */
        function isValidMoveOperation( &$nt, $auth = true ) {
-               global $wgUser;
                if( !$this or !$nt ) {
                        return 'badtitletext';
                }
@@ -1768,7 +1763,7 @@ class Title {
         * @access private
         */
        function moveOverExistingRedirect( &$nt, $reason = '' ) {
-               global $wgUser, $wgUseSquid, $wgMwRedir;
+               global $wgUseSquid, $wgMwRedir;
                $fname = 'Title::moveOverExistingRedirect';
                $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
 
@@ -1846,7 +1841,7 @@ class Title {
         * @access private
         */
        function moveToNewTitle( &$nt, $reason = '' ) {
-               global $wgUser, $wgUseSquid;
+               global $wgUseSquid;
                global $wgMwRedir;
                $fname = 'MovePageForm::moveToNewTitle';
                $comment = wfMsgForContent( '1movedto2', $this->getPrefixedText(), $nt->getPrefixedText() );
@@ -1983,7 +1978,6 @@ class Title {
         * @access public
         */
        function createRedirect( $dest, $comment ) {
-               global $wgUser;
                if ( $this->getArticleID() ) {
                        return false;
                }
@@ -2023,7 +2017,7 @@ class Title {
         * @access public
         */
        function getParentCategories() {
-               global $wgContLang,$wgUser;
+               global $wgContLang;
 
                $titlekey = $this->getArticleId();
                $dbr =& wfGetDB( DB_SLAVE );
index 2024364..8f4ca42 100644 (file)
@@ -307,7 +307,7 @@ class User {
                $fname = 'User::loadDefaults' . $n;
                wfProfileIn( $fname );
 
-               global $wgContLang, $wgCookiePrefix;
+               global $wgCookiePrefix;
                global $wgNamespacesToBeSearchedDefault;
 
                $this->mId = 0;
@@ -1387,7 +1387,7 @@ class User {
         * Save object settings into database
         */
        function saveSettings() {
-               global $wgMemc, $wgDBname, $wgUseEnotif;
+               global $wgMemc, $wgDBname;
                $fname = 'User::saveSettings';
 
                if ( wfReadOnly() ) { return; }
index f0f5623..3885bb9 100644 (file)
@@ -151,7 +151,6 @@ class WatchedItem {
         */
        function doDuplicateEntries( $ot, $nt ) {
                $fname = "WatchedItem::duplicateEntries";
-               global $wgMemc, $wgDBname;
                $oldnamespace = $ot->getNamespace();
                $newnamespace = $nt->getNamespace();
                $oldtitle = $ot->getDBkey();