Removing or commenting out unused variables or globals, and adding declarations for...
authorNick Jenkins <nickj@users.mediawiki.org>
Tue, 8 May 2007 09:09:46 +0000 (09:09 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Tue, 8 May 2007 09:09:46 +0000 (09:09 +0000)
20 files changed:
docs/memcached.txt
includes/Block.php
includes/Database.php
includes/EditPage.php
includes/Image.php
includes/Linker.php
includes/OutputPage.php
includes/Parser.php
includes/PatrolLog.php
includes/ProtectionForm.php
includes/QueryPage.php
includes/SearchPostgres.php
includes/SpecialContributions.php
includes/SpecialListusers.php
includes/SpecialProtectedpages.php
includes/Title.php
includes/media/Bitmap.php
includes/media/DjVu.php
includes/media/Generic.php
includes/media/SVG.php

index d4e2915..3addd96 100644 (file)
@@ -53,7 +53,7 @@ on port 11000, using up to 64MB of memory)
 
 In your LocalSettings.php file, set:
 
-       $wgMainCacheType = CACHE_MEMCACHED;;
+       $wgMainCacheType = CACHE_MEMCACHED;
        $wgMemCachedServers = array( "127.0.0.1:11000" );
 
 The wiki should then use memcached to cache various data. To use
index 94bfa5b..fa98692 100644 (file)
@@ -438,9 +438,6 @@ class Block
        * @return bool Whether or not an autoblock was inserted.
        */
        function doAutoblock( $autoblockip, $justInserted = false ) {
-               # Check if this IP address is already blocked
-               $dbw = wfGetDB( DB_MASTER );
-
                # If autoblocks are disabled, go away.
                if ( !$this->mEnableAutoblock ) {
                        return;
index 21e38ba..fa6ba41 100644 (file)
@@ -582,7 +582,7 @@ class Database {
                                @/**/$this->mConn = mysql_connect( $server, $user, $password, true );
                        }
                        if ($this->mConn === false) {
-                               $iplus = $i + 1;
+                               #$iplus = $i + 1;
                                #wfLogDBError("Connect loop error $iplus of $max ($server): " . mysql_errno() . " - " . mysql_error()."\n"); 
                        }
                }
index 4e6c3e8..6493698 100644 (file)
@@ -1002,7 +1002,7 @@ class EditPage {
                }
                if ( $this->mTitle->isCascadeProtected() ) {
                        # Is this page under cascading protection from some source pages?
-                       list($cascadeSources, $restrictions) = $this->mTitle->getCascadeProtectionSources();
+                       list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
                        if ( count($cascadeSources) > 0 ) {
                                # Explain, and list the titles responsible
                                $notice = wfMsgExt( 'cascadeprotectedwarning', array('parsemag'), count($cascadeSources) ) . "\n";
index a898f9b..0ea6d92 100644 (file)
@@ -831,7 +831,7 @@ class Image
                if ( !$handler ) {
                        return null;
                }
-               list( $thumbExt, $thumbMime ) = self::getThumbType( $this->extension, $this->mime );
+               list( $thumbExt, /* $thumbMime */ ) = self::getThumbType( $this->extension, $this->mime );
                $thumbName = $handler->makeParamString( $params ) . '-' . $this->name;
                if ( $thumbExt != $this->extension ) {
                        $thumbName .= ".$thumbExt";
@@ -1070,7 +1070,6 @@ class Image
                $dir = wfImageThumbDir( $this->name, $shared );
                $urls = array();
                foreach ( $files as $file ) {
-                       $m = array();
                        # Check that the base image name is part of the thumb name
                        # This is a basic sanity check to avoid erasing unrelated directories
                        if ( strpos( $file, $this->name ) !== false ) {
@@ -1404,7 +1403,6 @@ class Image
        }
 
        function getExifData() {
-               global $wgRequest;
                $handler = $this->getHandler();
                if ( !$handler || $handler->getMetadataType( $this ) != 'exif' ) {
                        return array();
index 82dca04..2cfaafc 100644 (file)
@@ -511,8 +511,6 @@ class Linker {
         */
        function makeThumbLinkObj( $img, $label = '', $alt, $align = 'right', $params = array(), $framed=false , $manual_thumb = "" ) {
                global $wgStylePath, $wgContLang;
-               $thumbUrl = '';
-               $error = '';
 
                $page = isset( $params['page'] ) ? $params['page'] : false;
 
index 18a5be4..baf9f3e 100644 (file)
@@ -937,7 +937,7 @@ class OutputPage {
                        $this->setPageTitle( wfMsg( 'viewsource' ) );
                        $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
 
-                       list( $cascadeSources, $restrictions ) = $wgTitle->getCascadeProtectionSources();
+                       list( $cascadeSources, /* $restrictions */ ) = $wgTitle->getCascadeProtectionSources();
 
                        # Determine if protection is due to the page being a system message
                        # and show an appropriate explanation
index 30a4169..3a52f24 100644 (file)
@@ -1929,6 +1929,7 @@ class Parser
                        # Look at the first character
                        if( $target != '' && $target{0} == '/' ) {
                                # / at end means we don't want the slash to be shown
+                               $m = array();
                                $trailingSlashes = preg_match_all( '%(/+)$%', $target, $m );
                                if( $trailingSlashes ) {
                                        $noslash = $target = substr( $target, 1, -strlen($m[0][0]) );
index a22839f..157dcbd 100644 (file)
@@ -46,7 +46,7 @@ class PatrolLog {
                # these conditions would have gone into recentchanges, which we aren't
                # supposed to be updating
                if( is_object( $skin ) ) {
-                       list( $cur, $prev, $auto ) = $params;
+                       list( $cur, /* $prev */, $auto ) = $params;
                        # Standard link to the page in question
                        $link = $skin->makeLinkObj( $title );
                        # Generate a diff link
index 3cafbd5..54ac3a2 100644 (file)
@@ -99,7 +99,7 @@ class ProtectionForm {
                        return;
                }
 
-               list( $cascadeSources, $restrictions ) = $this->mTitle->getCascadeProtectionSources();
+               list( $cascadeSources, /* $restrictions */ ) = $this->mTitle->getCascadeProtectionSources();
 
                if ( "" != $err ) {
                        $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
index 143c8be..5374104 100644 (file)
@@ -332,7 +332,6 @@ class QueryPage {
                $num = $dbr->numRows($res);
 
                $this->preprocessResults( $dbr, $res );
-               $sk = $wgUser->getSkin();
                
                # Top header and navigation
                if( $shownavigation ) {
index 3a624ce..a7c7c3d 100644 (file)
@@ -64,6 +64,7 @@ class SearchPostgres extends SearchEngine {
                $term = preg_replace('/:/', ' ', $term);
 
                $searchstring = '';
+               $m = array();
                if( preg_match_all('/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER ) ) {
                        foreach( $m as $terms ) {
                                if (strlen($terms[1])) {
index 82c8d60..c3db78b 100644 (file)
@@ -10,8 +10,6 @@ class ContribsPager extends IndexPager {
        var $namespace = '', $mDb;
 
        function __construct( $target, $namespace = false ) {
-               global $wgUser;
-
                parent::__construct();
                foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist minoreditletter' ) as $msg ) {
                        $this->messages[$msg] = wfMsgExt( $msg, array( 'escape') );
index 4249843..3ff087b 100644 (file)
@@ -103,7 +103,6 @@ class UsersPager extends AlphabeticPager {
                        $this->doQuery();
                }
                $batch = new LinkBatch;
-               $db = $this->mDb;
 
                $this->mResult->rewind();
 
index e9fb079..ae3b528 100644 (file)
@@ -239,10 +239,11 @@ class ProtectedPagesPager extends AlphabeticPager {
                $conds[] = 'page_id=pr_page';
                $conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
                
-               if( $this->sizetype=='min' )
+               if( $this->sizetype=='min' ) {
                        $conds[] = 'page_len>=' . $this->size;
-               else if( $this->sizetype=='max' )
+               } else if( $this->sizetype=='max' ) {
                        $conds[] = 'page_len<=' . $this->size;
+               }
                
                if( $this->level )
                        $conds[] = 'pr_level=' . $this->mDb->addQuotes( $this->level );
index 0ff2e80..b108e66 100644 (file)
@@ -40,7 +40,7 @@ class Title {
         * Please use the accessor functions
         */
 
-        /**#@+
+       /**#@+
         * @private
         */
 
index 3f3aabb..8024cb3 100644 (file)
@@ -154,7 +154,7 @@ class BitmapHandler extends ImageHandler {
                                wfDebug( "$err\n" );
                                return new MediaTransformError( 'thumbnail_error', $clientWidth, $clientHeight, $err );
                        }
-                       list( $loader, $colorStyle, $saveType ) = $typemap[$mimeType];
+                       list( $loader, /* $colorStyle */, $saveType ) = $typemap[$mimeType];
 
                        if( !function_exists( $loader ) ) {
                                $err = "Incomplete GD library configuration: missing function $loader";
index 3c053a0..00a1b51 100644 (file)
@@ -71,7 +71,6 @@ class DjVuHandler extends ImageHandler {
                $height = $params['height'];
                $srcPath = $image->getImagePath();
                $page = $params['page'];
-               $pageCount = $this->pageCount( $image );
                if ( $page > $this->pageCount( $image ) ) {
                        return new MediaTransformError( 'thumbnail_error', $width, $height, wfMsg( 'djvu_page_error' ) );
                }
index d588a78..189045a 100644 (file)
@@ -275,7 +275,6 @@ abstract class ImageHandler extends MediaHandler {
         * @return true if removed, false otherwise
         */
        function removeBadFile( $dstPath, $retval = 0 ) {
-               $removed = false;
                if( file_exists( $dstPath ) ) {
                        $thumbstat = stat( $dstPath );
                        if( $thumbstat['size'] == 0 || $retval != 0 ) {
index 5307e26..2dfbd02 100644 (file)
@@ -46,8 +46,6 @@ class SvgHandler extends ImageHandler {
                $clientHeight = $params['height'];
                $physicalWidth = $params['physicalWidth'];
                $physicalHeight = $params['physicalHeight'];
-               $srcWidth = $image->getWidth();
-               $srcHeight = $image->getHeight();
                $srcPath = $image->getImagePath();
 
                if ( $flags & self::TRANSFORM_LATER ) {