Completing code housekeeping stuff for rest of includes/ directory: removing unused...
authorNick Jenkins <nickj@users.mediawiki.org>
Wed, 29 Nov 2006 11:43:58 +0000 (11:43 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Wed, 29 Nov 2006 11:43:58 +0000 (11:43 +0000)
50 files changed:
includes/AjaxResponse.php
includes/Article.php
includes/Block.php
includes/ChangesList.php
includes/Database.php
includes/DatabasePostgres.php
includes/DifferenceEngine.php
includes/DjVuImage.php
includes/EditPage.php
includes/FileStore.php
includes/HTMLCacheUpdate.php
includes/HistoryBlob.php
includes/Hooks.php
includes/IP.php
includes/Image.php
includes/ImageFunctions.php
includes/ImageGallery.php
includes/MagicWord.php
includes/Math.php
includes/Metadata.php
includes/PageHistory.php
includes/Pager.php
includes/ParserCache.php
includes/ProfilerSimple.php
includes/Revision.php
includes/SearchMySQL4.php
includes/SearchTsearch2.php
includes/Skin.php
includes/SkinTemplate.php
includes/SpecialAllmessages.php
includes/SpecialAllpages.php
includes/SpecialBooksources.php
includes/SpecialDisambiguations.php
includes/SpecialExport.php
includes/SpecialImagelist.php
includes/SpecialIpblocklist.php
includes/SpecialLog.php
includes/SpecialPreferences.php
includes/SpecialPrefixindex.php
includes/SpecialRandompage.php
includes/SpecialSearch.php
includes/SpecialSpecialpages.php
includes/SpecialUndelete.php
includes/SpecialVersion.php
includes/SquidUpdate.php
includes/StringUtils.php
includes/Title.php
includes/User.php
includes/WikiError.php
includes/memcached-client.php

index 40f5087..a59c73b 100644 (file)
@@ -61,7 +61,7 @@ class AjaxResponse {
        }
        
        function sendHeaders() {
-               global $wgUseSquid, $wgUseESI, $wgSquidMaxage;
+               global $wgUseSquid, $wgUseESI;
                
                if ( $this->mResponseCode ) {
                        $n = preg_replace( '/^ *(\d+)/', '\1', $this->mResponseCode );
@@ -122,7 +122,7 @@ class AjaxResponse {
         * returns true iff the response code was set to 304 Not Modified.
         */
        function checkLastModified ( $timestamp ) {
-               global $wgCachePages, $wgCacheEpoch, $wgUser, $wgRequest;
+               global $wgCachePages, $wgCacheEpoch, $wgUser;
                $fname = 'AjaxResponse::checkLastModified';
 
                if ( !$timestamp || $timestamp == '19700101000000' ) {
index 86028de..f998147 100644 (file)
@@ -2330,7 +2330,11 @@ class Article {
         */
        function isFileCacheable() {
                global $wgUser, $wgUseFileCache, $wgShowIPinHeader, $wgRequest;
-               extract( $wgRequest->getValues( 'action', 'oldid', 'diff', 'redirect', 'printable' ) );
+               $action    = $wgRequest->getVal( 'action'    );
+               $oldid     = $wgRequest->getVal( 'oldid'     );
+               $diff      = $wgRequest->getVal( 'diff'      );
+               $redirect  = $wgRequest->getVal( 'redirect'  );
+               $printable = $wgRequest->getVal( 'printable' );
 
                return $wgUseFileCache
                        and (!$wgShowIPinHeader)
@@ -2700,8 +2704,6 @@ class Article {
                # This code is UGLY UGLY UGLY.
                # Somebody PLEASE come up with a more elegant way to do it.
 
-               $summary = '';
-
                #Redirect autosummaries
                $summary = self::getRedirectAutosummary( $newtext );
 
index 15b3972..29709d2 100644 (file)
@@ -113,9 +113,6 @@ class Block
                $options = array();
                $db =& $this->getDBOptions( $options );
 
-               $ret = false;
-               $killed = false;
-
                if ( 0 == $user && $address == '' ) {
                        # Invalid user specification, not blocked
                        $this->clear();
index 80b8cf7..ab27295 100644 (file)
@@ -184,7 +184,7 @@ class ChangesList {
                $s .= ' '.$articlelink;
        }
 
-       function insertTimestamp(&$s, &$rc) {
+       function insertTimestamp(&$s, $rc) {
                global $wgLang;
                # Timestamp
                $s .= '; ' . $wgLang->time( $rc->mAttribs['rc_timestamp'], true, true ) . ' . . ';
@@ -233,7 +233,6 @@ class OldChangesList extends ChangesList {
 
                # Extract DB fields into local scope
                extract( $rc->mAttribs );
-               $curIdEq = 'curid=' . $rc_cur_id;
 
                # Should patrol-related stuff be shown?
                $unpatrolled = $this->usePatrol() && $rc_patrolled == 0;
@@ -413,7 +412,6 @@ class EnhancedChangesList extends ChangesList {
                $userlinks = array();
                foreach( $block as $rcObj ) {
                        $oldid = $rcObj->mAttribs['rc_last_oldid'];
-                       $newid = $rcObj->mAttribs['rc_this_oldid'];
                        if( $rcObj->mAttribs['rc_new'] ) {
                                $isnew = true;
                        }
@@ -643,7 +641,7 @@ class EnhancedChangesList extends ChangesList {
                        return '';
                }
                $blockOut = '';
-               foreach( $this->rc_cache as $secureName => $block ) {
+               foreach( $this->rc_cache as $block ) {
                        if( count( $block ) < 2 ) {
                                $blockOut .= $this->recentChangesBlockLine( array_shift( $block ) );
                        } else {
index fb4449b..5250221 100644 (file)
@@ -90,8 +90,8 @@ class DBConnectionError extends DBError {
        }
 
        function getHTML() {
-               global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding, $wgOutputEncoding;
-               global $wgSitename, $wgServer, $wgMessageCache, $wgLogo;
+               global $wgTitle, $wgUseFileCache, $title, $wgInputEncoding;
+               global $wgSitename, $wgServer, $wgMessageCache;
 
                # I give up, Brion is right. Getting the message cache to work when there is no DB is tricky.
                # Hard coding strings instead.
@@ -621,7 +621,7 @@ class Database {
 
                # Add a comment for easy SHOW PROCESSLIST interpretation
                if ( $fname ) {
-                       $commentedSql = preg_replace("/\s/", " /* $fname */ ", $sql, 1);
+                       $commentedSql = preg_replace('/\s/', " /* $fname */ ", $sql, 1);
                } else {
                        $commentedSql = $sql;
                }
@@ -687,7 +687,7 @@ class Database {
         * @param bool $tempIgnore
         */
        function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
-               global $wgCommandLineMode, $wgFullyInitialised, $wgColorErrors;
+               global $wgCommandLineMode;
                # Ignore errors during error handling to avoid infinite recursion
                $ignore = $this->ignoreErrors( true );
                ++$this->mErrorCount;
@@ -786,7 +786,7 @@ class Database {
                        case '\\!': return '!';
                        case '\\&': return '&';
                }
-               list( $n, $arg ) = each( $this->preparedArgs );
+               list( /* $n */ , $arg ) = each( $this->preparedArgs );
                switch( $matches[1] ) {
                        case '?': return $this->addQuotes( $arg );
                        case '!': return $arg;
@@ -1091,7 +1091,7 @@ class Database {
                $sql = preg_replace ('/".*"/s', "'X'", $sql);
 
                # All newlines, tabs, etc replaced by single space
-               $sql = preg_replace ( "/\s+/", ' ', $sql);
+               $sql = preg_replace ( '/\s+/', ' ', $sql);
 
                # All numbers => N
                $sql = preg_replace ('/-?[0-9]+/s', 'N', $sql);
@@ -1558,7 +1558,8 @@ class Database {
                $row = $this->fetchObject( $res );
                $this->freeResult( $res );
 
-               if ( preg_match( "/\((.*)\)/", $row->Type, $m ) ) {
+               $m = array();
+               if ( preg_match( '/\((.*)\)/', $row->Type, $m ) ) {
                        $size = $m[1];
                } else {
                        $size = -1;
@@ -1882,7 +1883,6 @@ class Database {
                $res = $this->query( 'SHOW PROCESSLIST' );
                # Find slave SQL thread. Assumed to be the second one running, which is a bit
                # dubious, but unfortunately there's no easy rigorous way
-               $slaveThreads = 0;
                while ( $row = $this->fetchObject( $res ) ) {
                        /* This should work for most situations - when default db 
                         * for thread is not specified, it had no events executed, 
index 805313d..2adc90e 100644 (file)
@@ -18,7 +18,7 @@ class DatabasePostgres extends Database {
                $failFunction = false, $flags = 0 )
        {
 
-               global $wgOut, $wgDBprefix, $wgCommandLineMode;
+               global $wgOut;
                # Can't get a reference if it hasn't been set yet
                if ( !isset( $wgOut ) ) {
                        $wgOut = NULL;
@@ -60,7 +60,6 @@ class DatabasePostgres extends Database {
                $this->mPassword = $password;
                $this->mDBname = $dbName;
 
-               $success = false;
                $hstring="";
                if ($server!=false && $server!="") {
                        $hstring="host=$server ";
@@ -87,12 +86,13 @@ class DatabasePostgres extends Database {
                ## If this is the initial connection, setup the schema stuff and possibly create the user
                if (defined('MEDIAWIKI_INSTALL')) {
                        global $wgDBname, $wgDBuser, $wgDBpassword, $wgDBsuperuser, $wgDBmwschema,
-                               $wgDBts2schema, $wgDBts2locale;
+                               $wgDBts2schema;
                        print "OK</li>\n";
 
                        print "<li>Checking the version of Postgres...";
                        $version = pg_fetch_result($this->doQuery("SELECT version()"),0,0);
-                       if (!preg_match("/PostgreSQL (\d+\.\d+)(\S+)/", $version, $thisver)) {
+                       $thisver = array();
+                       if (!preg_match('/PostgreSQL (\d+\.\d+)(\S+)/', $version, $thisver)) {
                                print "<b>FAILED</b> (could not determine the version)</li>\n";
                                dieout("</ul>");
                        }
@@ -804,10 +804,10 @@ class DatabasePostgres extends Database {
                $SQL = "INSERT INTO interwiki(iw_prefix,iw_url,iw_local) VALUES ";
                while ( ! feof( $f ) ) {
                        $line = fgets($f,1024);
-                       if (!preg_match("/^\s*(\(.+?),(\d)\)/", $line, $matches)) {
+                       $matches = array();
+                       if (!preg_match('/^\s*(\(.+?),(\d)\)/', $line, $matches)) {
                                continue;
                        }
-                       $yesno = $matches[2]; ## ? "'true'" : "'false'";
                        $this->query("$SQL $matches[1],$matches[2])");
                }
                print " (table interwiki successfully populated)...\n";
@@ -831,7 +831,7 @@ class DatabasePostgres extends Database {
                        return "E'$s[1]'";
                }
                return "'" . pg_escape_string($s) . "'";
-               return "E'" . pg_escape_string($s) . "'";
+               // Unreachable: return "E'" . pg_escape_string($s) . "'";
        }
 
        function quote_ident( $s ) {
index fc6d725..682b425 100644 (file)
@@ -144,8 +144,6 @@ CONTROL;
                }
 
                $sk = $wgUser->getSkin();
-               $talk = $wgContLang->getNsText( NS_TALK );
-               $contribs = wfMsg( 'contribslink' );
 
                if ( $this->mNewRev->isCurrent() && $wgUser->isAllowed('rollback') ) {
                        $rollback = '&nbsp;&nbsp;&nbsp;' . $sk->generateRollback( $this->mNewRev );
@@ -901,7 +899,7 @@ class _DiffEngine
                                                $ymids[$k] = $ymids[$k-1];
                                                break;
                                        }
-                               while (list ($junk, $y) = each($matches)) {
+                               while (list ( /* $junk */, $y) = each($matches)) {
                                        if ($y > $this->seq[$k-1]) {
                                                USE_ASSERTS && assert($y < $this->seq[$k]);
                                                // Optimization: this is a common case:
@@ -1619,6 +1617,7 @@ class WordLevelDiff extends MappedDiff
                                $words[] = $line;
                                $stripped[] = $line;
                        } else {
+                               $m = array();
                                if (preg_match_all('/ ( [^\S\n]+ | [0-9_A-Za-z\x80-\xff]+ | . ) (?: (?!< \n) [^\S\n])? /xs',
                                        $line, $m))
                                {
index 871c563..f7297dc 100644 (file)
@@ -217,7 +217,7 @@ class DjVuImage {
                global $wgDjvuToXML;
                if ( isset( $wgDjvuToXML ) ) {
                        $cmd = $wgDjvuToXML . ' --without-anno --without-text ' . $this->mFilename;
-                       $xml = wfShellExec( $cmd, $retval );
+                       $xml = wfShellExec( $cmd );
                } else {
                        $xml = null;
                }
index 8cad492..d2eeb73 100644 (file)
@@ -1625,15 +1625,15 @@ END
                 */
                $toolarray=array(
                        array(  'image'=>'button_bold.png',
-                                       'open'  =>      "\'\'\'",
-                                       'close' =>      "\'\'\'",
+                                       'open'  =>      '\\\'\\\'\\\'',
+                                       'close' =>      '\\\'\\\'\\\'',
                                        'sample'=>      wfMsg('bold_sample'),
                                        'tip'   =>      wfMsg('bold_tip'),
                                        'key'   =>      'B'
                                ),
                        array(  'image'=>'button_italic.png',
-                                       'open'  =>      "\'\'",
-                                       'close' =>      "\'\'",
+                                       'open'  =>      '\\\'\\\'',
+                                       'close' =>      '\\\'\\\'',
                                        'sample'=>      wfMsg('italic_sample'),
                                        'tip'   =>      wfMsg('italic_tip'),
                                        'key'   =>      'I'
index 35ebd55..294bf99 100644 (file)
@@ -57,7 +57,7 @@ class FileStore {
                $dbw = wfGetDB( DB_MASTER );
                $lockname = $dbw->addQuotes( FileStore::lockName() );
                $result = $dbw->query( "SELECT RELEASE_LOCK($lockname)", __METHOD__ );
-               $row = $dbw->fetchObject( $result );
+               $dbw->fetchObject( $result );
                $dbw->freeResult( $result );
        }
        
index f76bcd6..bda4720 100644 (file)
@@ -55,7 +55,6 @@ class HTMLCacheUpdate
                $numRows = $res->numRows();
                $numBatches = ceil( $numRows / $this->mRowsPerJob );
                $realBatchSize = $numRows / $numBatches;
-               $boundaries = array();
                $start = false;
                $jobs = array();
                do {
index 357c1d4..a06b620 100644 (file)
@@ -226,7 +226,7 @@ class HistoryBlobStub {
                        $flags = explode( ',', $row->old_flags );
                        if( in_array( 'external', $flags ) ) {
                                $url=$row->old_text;
-                               @list($proto,$path)=explode('://',$url,2);
+                               @list( /* $proto */ ,$path)=explode('://',$url,2);
                                if ($path=="") {
                                        wfProfileOut( $fname );
                                        return false;
index 575a28c..2eecfd7 100644 (file)
@@ -31,7 +31,6 @@
 function wfRunHooks($event, $args = null) {
 
        global $wgHooks;
-       $fname = 'wfRunHooks';
 
        if (!is_array($wgHooks)) {
                throw new MWException("Global hooks array is not an array!\n");
index 7137804..b34cc78 100644 (file)
@@ -27,7 +27,7 @@ class IP {
         * @return boolean True if it is valid.
         */
        public static function isValid( $ip ) {
-               return preg_match( '/^' . RE_IP_ADD . '$/', $ip, $matches) ;
+               return preg_match( '/^' . RE_IP_ADD . '$/', $ip) ;
        }
 
        /**
@@ -84,6 +84,7 @@ class IP {
         * @return array
         */
        public static function toArray( $ipblock ) {
+               $matches = array();
                if(! preg_match( '/^' . RE_IP_ADD . '(?:\/(?:'.RE_IP_PREFIX.'))?' . '$/', $ipblock, $matches ) ) {
                        return false;
                } else {
index 5e85602..1f3895c 100644 (file)
@@ -235,7 +235,7 @@ class Image
         * Load metadata from the file itself
         */
        function loadFromFile() {
-               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang, $wgShowEXIF;
+               global $wgUseSharedUploads, $wgSharedUploadDirectory, $wgContLang;
                wfProfileIn( __METHOD__ );
                $this->imagePath = $this->getFullPath();
                $this->fileExists = file_exists( $this->imagePath );
@@ -925,7 +925,7 @@ class Image
                                        if ( !$this->mustRender() && $width == $this->width && $height == $this->height ) {
                                                $url = $this->getURL();
                                        } else {
-                                               list( $isScriptUrl, $url ) = $this->thumbUrl( $width );
+                                               list( /* $isScriptUrl */, $url ) = $this->thumbUrl( $width );
                                        }
                                        $thumb = new ThumbnailImage( $url, $width, $height );
                                } else {
@@ -1360,8 +1360,9 @@ class Image
                $dir = wfImageThumbDir( $this->name, $shared );
                $urls = array();
                foreach ( $files as $file ) {
+                       $m = array();
                        if ( preg_match( '/^(\d+)px/', $file, $m ) ) {
-                               list( $isScriptUrl, $url ) = $this->thumbUrl( $m[1] );
+                               list( /* $isScriptUrl */, $url ) = $this->thumbUrl( $m[1] );
                                $urls[] = $url;
                                @unlink( "$dir/$file" );
                        }
index 7575558..931fdff 100644 (file)
@@ -126,6 +126,7 @@ function wfScaleSVGUnit( $length ) {
                ''   => 1.0, // "User units" pixels by default
                '%'  => 2.0, // Fake it!
                );
+       $matches = array();
        if( preg_match( '/^(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) {
                $length = floatval( $matches[1] );
                $unit = $matches[2];
@@ -156,6 +157,7 @@ function wfGetSVGsize( $filename ) {
        fclose( $f );
 
        // Uber-crappy hack! Run through a real XML parser.
+       $matches = array();
        if( !preg_match( '/<svg\s*([^>]*)\s*>/s', $chunk, $matches ) ) {
                return false;
        }
@@ -206,6 +208,7 @@ function wfIsBadImage( $name, $contextTitle = false ) {
                        }
 
                        # Find all links
+                       $m = array();
                        if ( !preg_match_all( '/\[\[:?(.*?)\]\]/', $line, $m ) ) {
                                continue;
                        }
index dfd5a98..e88ab8b 100644 (file)
@@ -134,7 +134,7 @@ class ImageGallery
         *
         */
        function toHTML() {
-               global $wgLang, $wgIgnoreImageErrors, $wgGenerateThumbnailOnParse;
+               global $wgLang, $wgGenerateThumbnailOnParse;
 
                $sk = $this->getSkin();
 
@@ -147,7 +147,6 @@ class ImageGallery
                        $img =& $pair[0];
                        $text = $pair[1];
 
-                       $name = $img->getName();
                        $nt = $img->getTitle();
 
                        if( $nt->getNamespace() != NS_IMAGE ) {
index 350fb8e..0b6065d 100644 (file)
@@ -289,7 +289,7 @@ class MagicWord {
         * Used in matchAndRemove()
         * @private
         **/
-       function pregRemoveAndRecord( $match ) {
+       function pregRemoveAndRecord( ) {
                $this->mFound = true;
                return '';
        }
index a8b3398..30b4bfe 100644 (file)
@@ -75,12 +75,13 @@ class MathRenderer {
                        $retval = substr ($contents, 0, 1);
                        $errmsg = '';
                        if (($retval == 'C') || ($retval == 'M') || ($retval == 'L')) {
-                               if ($retval == 'C')
+                               if ($retval == 'C') {
                                        $this->conservativeness = 2;
-                               else if ($retval == 'M')
+                               } else if ($retval == 'M') {
                                        $this->conservativeness = 1;
-                               else
+                               } else {
                                        $this->conservativeness = 0;
+                               }
                                $outdata = substr ($contents, 33);
 
                                $i = strpos($outdata, "\000");
@@ -89,12 +90,13 @@ class MathRenderer {
                                $this->mathml = substr($outdata, $i+1);
                        } else if (($retval == 'c') || ($retval == 'm') || ($retval == 'l'))  {
                                $this->html = substr ($contents, 33);
-                               if ($retval == 'c')
+                               if ($retval == 'c') {
                                        $this->conservativeness = 2;
-                               else if ($retval == 'm')
+                               } else if ($retval == 'm') {
                                        $this->conservativeness = 1;
-                               else
+                               } else {
                                        $this->conservativeness = 0;
+                               }
                                $this->mathml = NULL;
                        } else if ($retval == 'X') {
                                $this->html = NULL;
@@ -118,7 +120,7 @@ class MathRenderer {
                                 $this->hash = substr ($contents, 1, 32);
                        }
 
-                       $res = wfRunHooks( 'MathAfterTexvc', array( &$this, &$errmsg ) );
+                       wfRunHooks( 'MathAfterTexvc', array( &$this, &$errmsg ) );
 
                        if ( $errmsg ) {
                                 return $errmsg;
index af40ab2..4f3c7b1 100644 (file)
@@ -22,7 +22,8 @@
  */
 
 /**
- *
+ * TODO: Perhaps make this file into a Metadata class, with static methods (declared 
+ * as private where indicated), to move these functions out of the global namespace?
  */
 define('RDF_TYPE_PREFS', "application/rdf+xml,text/xml;q=0.7,application/xml;q=0.5,text/rdf;q=0.1");
 
@@ -142,7 +143,7 @@ function dcBasics($article) {
                dcPerson('contributor', $user_parts[0], $user_parts[1], $user_parts[2]);
        }
 
-       dcRights($article);
+       dcRights();
 }
 
 /**
@@ -291,7 +292,7 @@ function dcPerson($name, $id, $user_name='', $user_real_name='') {
  * different pages.
  * @private
  */
-function dcRights($article) {
+function dcRights() {
 
        global $wgRightsPage, $wgRightsUrl, $wgRightsText;
 
index fd6a6d2..aea0f0e 100644 (file)
@@ -106,7 +106,6 @@ class PageHistory {
                 * Do the list
                 */
                $pager = new PageHistoryPager( $this );
-               $navbar = $pager->getNavigationBar();
                $this->linesonpage = $pager->getNumRows();
                $wgOut->addHTML(
                        $pager->getNavigationBar() . 
index b14aa8c..b97462d 100644 (file)
@@ -323,7 +323,7 @@ abstract class IndexPager implements Pager {
                        $next = array( 'offset' => $this->mLastShown, 'limit' => $urlLimit );
                        $last = array( 'dir' => 'prev', 'limit' => $urlLimit );
                }
-               return compact( 'prev', 'next', 'first', 'last' );
+               return array( 'prev' => $prev, 'next' => $next, 'first' => $first, 'last' => $last );
        }
 
        /**
index 1f2e2aa..37a42b7 100644 (file)
@@ -56,8 +56,6 @@ class ParserCache {
                $fname = 'ParserCache::get';
                wfProfileIn( $fname );
 
-               $hash = $user->getPageRenderingHash();
-               $pageid = intval( $article->getID() );
                $key = $this->getKey( $article, $user );
 
                wfDebug( "Trying parser cache $key\n" );
index 2d0d01b..eb2985c 100644 (file)
@@ -61,15 +61,13 @@ class ProfilerSimple extends Profiler {
        }
 
        function profileOut($functionname) {
-               $memory = memory_get_usage();
-
                global $wgDebugFunctionEntry;
 
                if ($wgDebugFunctionEntry) {
                        $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n");
                }
 
-               list($ofname,$ocount,$ortime,$octime) = array_pop($this->mWorkStack);
+               list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack);
 
                if (!$ofname) {
                        $this->debug("Profiling error: $functionname\n");
index 6ef9ede..49fc32f 100644 (file)
@@ -532,7 +532,7 @@ class Revision {
                # Use external methods for external objects, text in table is URL-only then
                if ( in_array( 'external', $flags ) ) {
                        $url=$text;
-                       @list($proto,$path)=explode('://',$url,2);
+                       @list(/* $proto */,$path)=explode('://',$url,2);
                        if ($path=="") {
                                wfProfileOut( $fname );
                                return false;
index dcc1f68..c20e3f8 100644 (file)
@@ -43,6 +43,7 @@ class SearchMySQL4 extends SearchMySQL {
                $this->searchTerms = array();
 
                # FIXME: This doesn't handle parenthetical expressions.
+               $m = array();
                if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                          $filteredText, $m, PREG_SET_ORDER ) ) {
                        foreach( $m as $terms ) {
@@ -60,7 +61,7 @@ class SearchMySQL4 extends SearchMySQL {
                                $this->searchTerms[] = $regexp;
                        }
                        wfDebug( "Would search with '$searchon'\n" );
-                       wfDebug( "Match with /\b" . implode( '\b|\b', $this->searchTerms ) . "\b/\n" );
+                       wfDebug( 'Match with /\b' . implode( '\b|\b', $this->searchTerms ) . "\b/\n" );
                } else {
                        wfDebug( "Can't understand search query '{$filteredText}'\n" );
                }
index a8f354b..e4c94c7 100644 (file)
@@ -47,6 +47,7 @@ class SearchTsearch2 extends SearchEngine {
                $this->searchTerms = array();
 
                # FIXME: This doesn't handle parenthetical expressions.
+               $m = array();
                if( preg_match_all( '/([-+<>~]?)(([' . $lc . ']+)(\*?)|"[^"]*")/',
                          $filteredText, $m, PREG_SET_ORDER ) ) {
                        foreach( $m as $terms ) {
@@ -64,7 +65,7 @@ class SearchTsearch2 extends SearchEngine {
                                $this->searchTerms[] = $regexp;
                        }
                        wfDebug( "Would search with '$searchon'\n" );
-                       wfDebug( "Match with /\b" . implode( '\b|\b', $this->searchTerms ) . "\b/\n" );
+                       wfDebug( 'Match with /\b' . implode( '\b|\b', $this->searchTerms ) . "\b/\n" );
                } else {
                        wfDebug( "Can't understand search query '{$this->filteredText}'\n" );
                }
index 9900ff4..924deef 100644 (file)
@@ -48,6 +48,7 @@ class Skin extends Linker {
                        # while code from www.php.net
                        while (false !== ($file = $skinDir->read())) {
                                // Skip non-PHP files, hidden files, and '.dep' includes
+                               $matches = array();
                                if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
                                        $aSkin = $matches[1];
                                        $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
@@ -369,7 +370,6 @@ class Skin extends Linker {
        function getUserStylesheet() {
                global $wgStylePath, $wgRequest, $wgContLang, $wgSquidMaxage, $wgStyleVersion;
                $sheet = $this->getStylesheet();
-               $action = $wgRequest->getText('action');
                $s = "@import \"$wgStylePath/common/common.css?$wgStyleVersion\";\n";
                $s .= "@import \"$wgStylePath/$sheet?$wgStyleVersion\";\n";
                if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css?$wgStyleVersion\";\n";
@@ -490,7 +490,6 @@ END;
                else $a = array( 'bgcolor' => '#FFFFFF' );
                if($wgOut->isArticle() && $wgUser->getOption('editondblclick') &&
                  $wgTitle->userCanEdit() ) {
-                       $t = wfMsg( 'editthispage' );
                        $s = $wgTitle->getFullURL( $this->editUrlOptions() );
                        $s = 'document.location = "' .wfEscapeJSString( $s ) .'";';
                        $a += array ('ondblclick' => $s);
@@ -696,7 +695,8 @@ END;
        function pageTitleLinks() {
                global $wgOut, $wgTitle, $wgUser, $wgRequest;
 
-               extract( $wgRequest->getValues( 'oldid', 'diff' ) );
+               $oldid = $wgRequest->getVal( 'oldid' );
+               $diff = $wgRequest->getVal( 'diff' );
                $action = $wgRequest->getText( 'action' );
 
                $s = $this->printableLink();
@@ -838,7 +838,6 @@ END;
        function nameAndLogin() {
                global $wgUser, $wgTitle, $wgLang, $wgContLang, $wgShowIPinHeader;
 
-               $li = $wgContLang->specialPage( 'Userlogin' );
                $lo = $wgContLang->specialPage( 'Userlogout' );
 
                $s = '';
@@ -1011,7 +1010,8 @@ END;
                global $wgOut, $wgLang, $wgArticle, $wgRequest, $wgUser;
                global $wgDisableCounters, $wgMaxCredits, $wgShowCreditsIfMax, $wgTitle, $wgPageShowWatchingUsers;
 
-               extract( $wgRequest->getValues( 'oldid', 'diff' ) );
+               $oldid = $wgRequest->getVal( 'oldid' );
+               $diff = $wgRequest->getVal( 'diff' );
                if ( ! $wgOut->isArticle() ) { return ''; }
                if ( isset( $oldid ) || isset( $diff ) ) { return ''; }
                if ( 0 == $wgArticle->getID() ) { return ''; }
@@ -1144,7 +1144,6 @@ END;
         */
        function specialPagesList() {
                global $wgUser, $wgContLang, $wgServer, $wgRedirectScript;
-               $a = array();
                $pages = array_merge( SpecialPage::getRegularPages(), SpecialPage::getRestrictedPages() );
                foreach ( $pages as $name => $page ) {
                        $pages[$name] = $page->getDescription();
@@ -1629,7 +1628,7 @@ END;
                        }
                }
                if ($cacheSidebar)
-                       $cachednotice = $parserMemc->set( $key, $bar, 86400 );
+                       $parserMemc->set( $key, $bar, 86400 );
                wfProfileOut( $fname );
                return $bar;
        }
index c47e619..ca3546d 100644 (file)
@@ -148,7 +148,8 @@ class SkinTemplate extends Skin {
                // adding of CSS or Javascript by extensions.
                wfRunHooks( 'BeforePageDisplay', array( &$out ) );
 
-               extract( $wgRequest->getValues( 'oldid', 'diff' ) );
+               $oldid = $wgRequest->getVal( 'oldid' );
+               $diff = $wgRequest->getVal( 'diff' );
 
                wfProfileIn( "$fname-init" );
                $this->initPage( $out );
@@ -768,9 +769,6 @@ class SkinTemplate extends Skin {
                $variants = $wgContLang->getVariants();
                if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) {
                        $preferred = $wgContLang->getPreferredVariant();
-                       $actstr = '';
-                       if( $action )
-                               $actstr = 'action=' . $action . '&';
                        $vcount=0;
                        foreach( $variants as $code ) {
                                $varname = $wgContLang->getVariantname( $code );
@@ -810,7 +808,6 @@ class SkinTemplate extends Skin {
 
                $action = $wgRequest->getText( 'action' );
                $oldid = $wgRequest->getVal( 'oldid' );
-               $diff = $wgRequest->getVal( 'diff' );
 
                $nav_urls = array();
                $nav_urls['mainpage'] = array( 'href' => self::makeI18nUrl( 'mainpage') );
index d6126da..a28ab3c 100644 (file)
@@ -28,7 +28,6 @@ function wfSpecialAllmessages() {
        # Make sure all extension messages are available
        MessageCache::loadAllMessages();
 
-       $first = true;
        $sortedArray = array_merge( Language::getMessagesFor( 'en' ), $wgMessageCache->getExtensionMessagesFor( 'en' ) );
        ksort( $sortedArray );
        $messages = array();
@@ -75,7 +74,7 @@ function makePhp( $messages ) {
                } else {
                        $comment = '';
                }
-               $txt .= "'$key' => '" . preg_replace( "/(?<!\\\\)'/", "\'", $m['msg']) . "',$comment\n";
+               $txt .= "'$key' => '" . preg_replace( '/(?<!\\\\)\'/', "\'", $m['msg']) . "',$comment\n";
        }
        $txt .= ');';
        return $txt;
@@ -92,8 +91,6 @@ function makeHTMLText( $messages ) {
 
        $sk =& $wgUser->getSkin();
        $talk = $wgLang->getNsText( NS_TALK );
-       $mwnspace = $wgLang->getNsText( NS_MEDIAWIKI );
-       $mwtalk = $wgLang->getNsText( NS_MEDIAWIKI_TALK );
 
        $input = wfElement( 'input', array(
                'type'    => 'text',
index 1fc4815..cfe8cb5 100644 (file)
@@ -184,8 +184,6 @@ function showToplevel ( $namespace = NS_MAIN, $including = false ) {
  * @param integer $namespace (Default NS_MAIN)
  */
 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
-       global $wgUser;
-
        $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
        $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) );
        $queryparams = ($namespace ? "namespace=$namespace" : '');
index 960f622..40b5a10 100644 (file)
@@ -48,7 +48,6 @@ class BookSourceList {
 
        function showList() {
                global $wgOut, $wgContLang;
-               $fname = "BookSourceList::showList()";
 
                # First, see if we have a custom list setup in
                # [[Wikipedia:Book sources]] or equivalent.
@@ -93,7 +92,6 @@ class BookSourceList {
 
        function askForm() {
                global $wgOut, $wgTitle;
-               $fname = "BookSourceList::askForm()";
 
                $action = $wgTitle->escapeLocalUrl();
                $isbn = htmlspecialchars( wfMsg( "isbn" ) );
index 0355c85..626b967 100644 (file)
@@ -32,7 +32,7 @@ class DisambiguationsPage extends PageQueryPage {
 
        function getSQL() {
                $dbr =& wfGetDB( DB_SLAVE );
-               extract( $dbr->tableNames( 'page', 'pagelinks', 'templatelinks' ) );
+               list( $page, $pagelinks, $templatelinks) =  $dbr->tableNamesN( 'page', 'pagelinks', 'templatelinks' );
 
         $dMsgText = wfMsgForContent('disambiguationspage');
                
index d387f3d..26ca7ef 100644 (file)
@@ -30,11 +30,6 @@ function wfSpecialExport( $page = '' ) {
        global $wgExportAllowHistory, $wgExportMaxHistory;
 
        $curonly = true;
-       $fullHistory = array(
-               'dir' => 'asc',
-               'offset' => false,
-               'limit' => $wgExportMaxHistory,
-       );
        if( $wgRequest->wasPosted() ) {
                $page = $wgRequest->getText( 'pages' );
                $curonly = $wgRequest->getCheck( 'curonly' );
index 54ee83e..69004be 100644 (file)
@@ -9,7 +9,7 @@
  *
  */
 function wfSpecialImagelist() {
-       global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgMiserMode;
+       global $wgOut;
 
        $pager = new ImageListPager;
 
index 84f0a9c..84d07ac 100644 (file)
@@ -167,6 +167,7 @@ class IPUnblockForm {
                }
 
                $conds = array();
+               $matches = array();
                if ( $this->ip == '' ) {
                        // No extra conditions
                } elseif ( substr( $this->ip, 0, 1 ) == '#' ) {
@@ -174,7 +175,7 @@ class IPUnblockForm {
                } elseif ( IP::toUnsigned( $this->ip ) !== false ) {
                        $conds['ipb_address'] = $this->ip;
                        $conds['ipb_auto'] = 0;
-               } elseif( preg_match( "/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/", $this->ip, $matches ) ) {
+               } elseif( preg_match( '/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\\/(\\d{1,2})$/', $this->ip, $matches ) ) {
                        $conds['ipb_address'] = Block::normaliseRange( $this->ip );
                        $conds['ipb_auto'] = 0;
                } else {
index 10d1d89..7076d81 100644 (file)
@@ -151,7 +151,6 @@ class LogReader {
         */
        function getQuery() {
                $logging = $this->db->tableName( "logging" );
-               $user = $this->db->tableName( 'user' );
                $sql = "SELECT /*! STRAIGHT_JOIN */ log_type, log_action, log_timestamp,
                        log_user, user_name,
                        log_namespace, log_title, page_id,
@@ -304,7 +303,6 @@ class LogViewer {
        function logLine( $s ) {
                global $wgLang;
                $title = Title::makeTitle( $s->log_namespace, $s->log_title );
-               $user = Title::makeTitleSafe( NS_USER, $s->user_name );
                $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $s->log_timestamp), true );
 
                // Enter the existence or non-existence of this page into the link cache,
index b7f275d..a06bf79 100644 (file)
@@ -34,7 +34,7 @@ class PreferencesForm {
         * Load some values
         */
        function PreferencesForm( &$request ) {
-               global $wgLang, $wgContLang, $wgUser, $wgAllowRealName;
+               global $wgContLang, $wgUser, $wgAllowRealName;
 
                $this->mQuickbar = $request->getVal( 'wpQuickbar' );
                $this->mOldpass = $request->getVal( 'wpOldpass' );
@@ -378,7 +378,6 @@ class PreferencesForm {
 
                $togs = User::getToggles();
                foreach ( $togs as $tname ) {
-                       $ttext = wfMsg('tog-'.$tname);
                        $this->mToggles[$tname] = $wgUser->getOption( $tname );
                }
 
@@ -526,8 +525,6 @@ class PreferencesForm {
                $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : '';
                $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits', false, $disableEmailPrefs ) : '';
                $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr', false, $disableEmailPrefs ) : '';
-               $prefs_help_email_enotif = ( $wgEnotifWatchlist || $wgEnotifUserTalk) ? ' ' . wfMsg('prefs-help-email-enotif') : '';
-               $prefs_help_realname = '';
 
                # </FIXME>
 
index 86880d2..ce296b4 100644 (file)
@@ -97,7 +97,6 @@ function showChunk( $namespace = NS_MAIN, $prefix, $including = false, $from = n
                $n = 0;
                $out = '<table style="background: inherit;" border="0" width="100%">';
 
-               $namespaces = $wgContLang->getFormattedNamespaces();
                while( ($n < $this->maxPerPage) && ($s = $dbr->fetchObject( $res )) ) {
                        $t = Title::makeTitle( $s->page_namespace, $s->page_title );
                        if( $t ) {
index 9d38abc..aa77f2d 100644 (file)
@@ -11,7 +11,7 @@
  *               used as e.g. Special:Randompage/Category
  */
 function wfSpecialRandompage( $par = NS_MAIN ) {
-       global $wgOut, $wgExtraRandompageSQL, $wgContLang, $wgLang;
+       global $wgOut, $wgExtraRandompageSQL;
        $fname = 'wfSpecialRandompage';
 
        # Determine namespace
index d28f059..ac39f29 100644 (file)
@@ -77,7 +77,6 @@ class SpecialSearch {
        function goResult( $term ) {
                global $wgOut;
                global $wgGoToEdit;
-               global $wgContLang;
 
                $this->setupPage( $term );
 
@@ -98,17 +97,13 @@ class SpecialSearch {
 
                # No match, generate an edit URL
                $t = Title::newFromText( $term );
-               if( is_null( $t ) ) {
-                       $editurl = ''; # hrm...
-               } else {
+               if( ! is_null( $t ) ) {
                        wfRunHooks( 'SpecialSearchNogomatch', array( &$t ) );
                        # If the feature is enabled, go straight to the edit page
                        if ( $wgGoToEdit ) {
                                $wgOut->redirect( $t->getFullURL( 'action=edit' ) );
                                return;
-                       } else {
-                               $editurl = $t->escapeLocalURL( 'action=edit' );
-                       }
+                       } 
                }
                $wgOut->addWikiText( wfMsg( 'noexactmatch', wfEscapeWikiText( $term ) ) );
 
@@ -125,8 +120,7 @@ class SpecialSearch {
 
                $this->setupPage( $term );
 
-               global $wgUser, $wgOut;
-               $sk = $wgUser->getSkin();
+               global $wgOut;
                $wgOut->addWikiText( wfMsg( 'searchresulttext' ) );
 
                #if ( !$this->parseQuery() ) {
@@ -347,6 +341,7 @@ class SpecialSearch {
                                break;
                        }
                        ++$lineno;
+                       $m = array();
                        if ( ! preg_match( $pat1, $line, $m ) ) {
                                continue;
                        }
index 6a01cd0..78f9dee 100644 (file)
@@ -37,7 +37,7 @@ function wfSpecialSpecialpages_gen($pages,$heading,$sk) {
 
        /** Put them into a sortable array */
        $sortedPages = array();
-       foreach ( $pages as $name => $page ) {
+       foreach ( $pages as $page ) {
                if ( $page->isListed() ) {
                        $sortedPages[$page->getDescription()] = $page->getTitle();
                }
index c78cae2..f152f64 100644 (file)
@@ -348,7 +348,6 @@ class PageArchive {
                }
                
                $revision = null;
-               $newRevId = $previousRevId;
                $restored = 0;
 
                while( $row = $dbw->fetchObject( $result ) ) {
@@ -375,7 +374,7 @@ class PageArchive {
                                'minor_edit' => $row->ar_minor_edit,
                                'text_id'    => $row->ar_text_id,
                                ) );
-                       $newRevId = $revision->insertOn( $dbw );
+                       $revision->insertOn( $dbw );
                        $restored++;
                }
 
@@ -594,8 +593,8 @@ class UndeleteForm {
                }
 
                $archive = new PageArchive( $this->mTargetObj );
-               $text = $archive->getLastRevisionText();
                /*
+               $text = $archive->getLastRevisionText();
                if( is_null( $text ) ) {
                        $wgOut->addWikiText( wfMsg( "nohistory" ) );
                        return;
@@ -739,7 +738,6 @@ class UndeleteForm {
                global $wgOut, $wgUser;
                if( !is_null( $this->mTargetObj ) ) {
                        $archive = new PageArchive( $this->mTargetObj );
-                       $ok = true;
                        
                        $ok = $archive->undelete(
                                $this->mTargetTimestamp,
index 8744597..58fc65e 100644 (file)
@@ -281,8 +281,6 @@ class SpecialVersion {
                        // subversion is release 1.4
                        return intval( $content[3] );
                }
-
-               return false;
        }
 
        /**#@-*/
index 25dd1cf..2e2a4a5 100644 (file)
@@ -29,8 +29,6 @@ class SquidUpdate {
                wfProfileIn( $fname );
 
                # Get a list of URLs linking to this page
-               $id = $title->getArticleID();
-
                $dbr =& wfGetDB( DB_SLAVE );
                $res = $dbr->select( array( 'links', 'page' ),
                        array( 'page_namespace', 'page_title' ),
index 4c4d219..0090604 100644 (file)
@@ -50,7 +50,8 @@ class StringUtils {
                $encEnd = preg_quote( $endDelim, '!' );
                $strcmp = strpos( $flags, 'i' ) === false ? 'strcmp' : 'strcasecmp';
                $endLength = strlen( $endDelim );
-
+               $m = array();
+               
                while ( $inputPos < strlen( $subject ) && 
                  preg_match( "!($encStart)|($encEnd)!S$flags", $subject, $m, PREG_OFFSET_CAPTURE, $inputPos ) ) 
                {
index 76cf0eb..65458a0 100644 (file)
@@ -109,8 +109,6 @@ class Title {
         * @access public
         */
        public static function newFromText( $text, $defaultNamespace = NS_MAIN ) {
-               $fname = 'Title::newFromText';
-
                if( is_object( $text ) ) {
                        throw new MWException( 'Title::newFromText given an object' );
                }
@@ -289,6 +287,7 @@ class Title {
                $mwRedir = MagicWord::get( 'redirect' );
                $rt = NULL;
                if ( $mwRedir->matchStart( $text ) ) {
+                       $m = array();
                        if ( preg_match( '/\[{2}(.*?)(?:\||\]{2})/', $text, $m ) ) {
                                # categories are escaped using : for example one can enter:
                                # #REDIRECT [[:Category:Music]]. Need to remove it.
@@ -859,6 +858,7 @@ class Title {
                        } else {
                                global $wgActionPaths;
                                $url = false;
+                               $matches = array();
                                if( !empty( $wgActionPaths ) &&
                                        preg_match( '/^(.*&|)action=([^&]*)(&(.*)|)$/', $query, $matches ) )
                                {
@@ -1429,7 +1429,6 @@ class Title {
         */
        /* private */ function secureAndSplit() {
                global $wgContLang, $wgLocalInterwiki, $wgCapitalLinks;
-               $fname = 'Title::secureAndSplit';
 
                # Initialisation
                static $rxTc = false;
@@ -1467,6 +1466,7 @@ class Title {
                # Namespace or interwiki prefix
                $firstPass = true;
                do {
+                       $m = array();
                        if ( preg_match( "/^(.+?)_*:_*(.*)$/S", $t, $m ) ) {
                                $p = $m[1];
                                $lowerNs = $wgContLang->lc( $p );
@@ -1628,7 +1628,6 @@ class Title {
         */
        function getLinksTo( $options = '', $table = 'pagelinks', $prefix = 'pl' ) {
                $linkCache =& LinkCache::singleton();
-               $id = $this->getArticleID();
 
                if ( $options ) {
                        $db =& wfGetDB( DB_MASTER );
@@ -1899,7 +1898,6 @@ class Title {
                }
 
                $now = wfTimestampNow();
-               $rand = wfRandom();
                $newid = $nt->getArticleID();
                $oldid = $this->getArticleID();
                $dbw =& wfGetDB( DB_MASTER );
@@ -1937,7 +1935,7 @@ class Title {
                        'page'    => $newid,
                        'comment' => $comment,
                        'text'    => $redirectText ) );
-               $revid = $redirectRevision->insertOn( $dbw );
+               $redirectRevision->insertOn( $dbw );
                $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
                $linkCache->clearLink( $this->getPrefixedDBkey() );
 
@@ -1980,7 +1978,6 @@ class Title {
                $oldid = $this->getArticleID();
                $dbw =& wfGetDB( DB_MASTER );
                $now = $dbw->timestamp();
-               $rand = wfRandom();
                $linkCache =& LinkCache::singleton();
 
                # Save a null revision in the page's history notifying of the move
@@ -2010,7 +2007,7 @@ class Title {
                        'page'    => $newid,
                        'comment' => $comment,
                        'text'    => $redirectText ) );
-               $revid = $redirectRevision->insertOn( $dbw );
+               $redirectRevision->insertOn( $dbw );
                $redirectArticle->updateRevisionOn( $dbw, $redirectRevision, 0 );
                $linkCache->clearLink( $this->getPrefixedDBkey() );
 
@@ -2062,6 +2059,7 @@ class Title {
 
                # Does the redirect point to the source?
                # Or is it a broken self-redirect, usually caused by namespace collisions?
+               $m = array();
                if ( preg_match( "/\\[\\[\\s*([^\\]\\|]*)]]/", $text, $m ) ) {
                        $redirTitle = Title::newFromText( $m[1] );
                        if( !is_object( $redirTitle ) ||
@@ -2113,7 +2111,7 @@ class Title {
                        'comment'   => $comment,
                        'text'      => "#REDIRECT [[" . $dest->getPrefixedText() . "]]\n",
                        ) );
-               $revisionId = $revision->insertOn( $dbw );
+               $revision->insertOn( $dbw );
                $article->updateRevisionOn( $dbw, $revision, 0 );
 
                # Link table
@@ -2372,7 +2370,7 @@ class Title {
         */
        function isSpecial( $name ) {
                if ( $this->getNamespace() == NS_SPECIAL ) {
-                       list( $thisName, $subpage ) = SpecialPage::resolveAliasWithSubpage( $this->getDBkey() );
+                       list( $thisName, /* $subpage */ ) = SpecialPage::resolveAliasWithSubpage( $this->getDBkey() );
                        if ( $name == $thisName ) {
                                return true;
                        }
index 8d402ef..ea05f6a 100644 (file)
@@ -2133,6 +2133,7 @@ class User {
         */
        function sendConfirmationMail() {
                global $wgContLang;
+               $expiration = null; // gets passed-by-ref and defined in next line.
                $url = $this->confirmationTokenUrl( $expiration );
                return $this->sendMail( wfMsg( 'confirmemail_subject' ),
                        wfMsg( 'confirmemail_body',
index 6986b1c..029184d 100644 (file)
@@ -59,7 +59,7 @@ class WikiError {
         * @return bool
         * @static
         */
-       public static function isError( &$object ) {
+       public static function isError( $object ) {
                return $object instanceof WikiError;
        }
 }
index b1ba778..2c5cc6b 100644 (file)
@@ -451,7 +451,8 @@ class memcached
          return false;
 
       $this->stats['get_multi']++;
-
+      $sock_keys = array();
+      
       foreach ($keys as $key)
       {
          $sock = $this->get_sock($key);
@@ -697,6 +698,7 @@ class memcached
       list ($ip, $port) = explode(":", $host);
       $sock = false;
       $timeout = $this->_connect_timeout;
+      $errno = $errstr = null;
       for ($i = 0; !$sock && $i < $this->_connect_attempts; $i++) {
          if ($i > 0) {
             # Sleep until the timeout, in case it failed fast
@@ -740,7 +742,7 @@ class memcached
    function _dead_sock ($sock)
    {
       $host = array_search($sock, $this->_cache_sock);
-      @list ($ip, $port) = explode(":", $host);
+      @list ($ip, /* $port */) = explode(":", $host);
       $this->_host_dead[$ip] = time() + 30 + intval(rand(0, 10));
       $this->_host_dead[$host] = $this->_host_dead[$ip];
       unset($this->_cache_sock[$host]);
@@ -849,6 +851,7 @@ class memcached
 
       stream_set_timeout($sock, 1, 0);
       $line = fgets($sock);
+      $match = array();
       if (!preg_match('/^(\d+)/', $line, $match))
          return null;
       return $match[1];
@@ -1001,8 +1004,9 @@ class memcached
       if (isset($this->_cache_sock[$host]))
          return $this->_cache_sock[$host];
 
+      $sock = null;
       $now = time();
-      list ($ip, $port) = explode (":", $host);
+      list ($ip, /* $port */) = explode (":", $host);
       if (isset($this->_host_dead[$host]) && $this->_host_dead[$host] > $now ||
           isset($this->_host_dead[$ip]) && $this->_host_dead[$ip] > $now)
          return null;