unused variables as per #3692
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 1 May 2006 10:53:59 +0000 (10:53 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 1 May 2006 10:53:59 +0000 (10:53 +0000)
17 files changed:
config/index.php
includes/Article.php
includes/CategoryPage.php
includes/ChangesList.php
includes/Database.php
includes/Exif.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/Image.php
includes/JobQueue.php
includes/LogPage.php
includes/ParserXML.php
includes/Sanitizer.php
includes/normal/UtfNormal.php
maintenance/refreshLinks.inc
skins/CologneBlue.php
skins/Standard.php

index 135127b..71eceb5 100644 (file)
@@ -1332,7 +1332,7 @@ function aField( &$conf, $field, $text, $type = "text", $value = "" ) {
                $xtype = "";
        }
 
-       if(!(isset($id)) or ($id == "") ) $id = $field;
+       $id = $field;
        $nolabel = ($type == "radio") || ($type == "hidden");
 
        if ($type == 'radio')
@@ -1418,6 +1418,7 @@ function get_db_version() {
                return mysql_get_server_info( $wgDatabase->mConn );
        else if ($conf->DBtype == 'oracle')
                return oci_server_version($wgDatabase->mConn);
+       else return 'unknown';
 }
 
 # Test a memcached server
index 9e2c9d0..52ecca4 100644 (file)
@@ -355,8 +355,6 @@ class Article {
                # Query variables :P
                $oldid = $this->getOldID();
 
-               $fname = 'Article::loadContent';
-
                # Pre-fill content with error message so that if something
                # fails we'll have something telling us what we intended.
 
@@ -692,7 +690,7 @@ class Article {
        }
 
        /**
-        * @todo Document
+        * @todo Document, fixme $offset never used.
         * @param $limit Integer: default 0.
         * @param $offset Integer: default 0.
         */
@@ -899,6 +897,7 @@ class Article {
                                        $wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) );
                                }
                                $targetUrl = $rt->escapeLocalURL();
+                               # fixme unused $titleText :
                                $titleText = htmlspecialchars( $rt->getPrefixedText() );
                                $link = $sk->makeLinkObj( $rt );
 
@@ -1273,10 +1272,6 @@ class Article {
                wfProfileOut( $fname );
        }
 
-       function getTextOfLastEditWithSectionReplacedOrAdded($section, $text, $summary = '', $edittime = NULL) {
-               $this->replaceSection( $section, $text, $summary, $edittime );
-       }
-
        /**
         * @return string Complete article text, or null if error
         */
@@ -1395,7 +1390,6 @@ class Article {
                }
 
                $isminor = $minor && $wgUser->isAllowed('minoredit');
-               $redir = (int)$this->isRedirect( $text );
 
                $text = $this->preSaveTransform( $text );
                $dbw =& wfGetDB( DB_MASTER );
@@ -1529,6 +1523,7 @@ class Article {
        /**
         * After we've either updated or inserted the article, update
         * the link tables and redirect to the new page.
+        * @todo FIXME some function arguments never used
         */
        function showArticle( $text, $subtitle , $sectionanchor = '', $me2, $now, $summary, $oldid ) {
                global $wgOut;
@@ -2484,6 +2479,7 @@ class Article {
                        'comment'    => $comment,
                        'minor_edit' => $minor ? 1 : 0,
                        ) );
+               # fixme : $revisionId never used
                $revisionId = $revision->insertOn( $dbw );
                $this->updateRevisionOn( $dbw, $revision );
                $dbw->commit();
index 69756dc..ed9bc00 100644 (file)
@@ -49,7 +49,6 @@ class CategoryPage extends Article {
 
        function closeShowCategory() {
                global $wgOut, $wgRequest;
-               $pageConditions = array();
                $from = $wgRequest->getVal( 'from' );
                $until = $wgRequest->getVal( 'until' );
                $wgOut->addHTML( $this->doCategoryMagic( $from, $until ) );
@@ -72,7 +71,6 @@ class CategoryPage extends Article {
                $articles_start_char = array();
                $children = array();
                $children_start_char = array();
-               $data = array();
                if( $wgCategoryMagicGallery ) {
                        $ig = new ImageGallery();
                }
index ab30a13..59c410f 100644 (file)
@@ -330,7 +330,6 @@ class EnhancedChangesList extends ChangesList {
                $rc->numberofWatchingusers = $baseRC->numberofWatchingusers;
 
                # Make "cur" and "diff" links
-               $titleObj = $rc->getTitle();
                if( $rc->unpatrolled ) {
                        $rcIdQuery = "&rcid={$rc_id}";
                } else {
index 133f4a1..8376f06 100644 (file)
@@ -541,7 +541,6 @@ class Database {
         * @return string executable SQL
         */
        function fillPrepared( $preparedQuery, $args ) {
-               $n = 0;
                reset( $args );
                $this->preparedArgs =& $args;
                return preg_replace_callback( '/(\\\\[?!&]|[?!&])/',
index e7a3f9c..1009688 100644 (file)
@@ -366,7 +366,7 @@ class Exif {
        /**
         * @todo document
         */
-       function makeFormattedData( $data = null ) {
+       function makeFormattedData( ) {
                $format = new FormatExif( $this->getFilteredData() );
                $this->mFormattedExifData = $format->getFormattedData();
        }
index 5502d9c..d30dd97 100644 (file)
@@ -1303,6 +1303,7 @@ define('TS_ORACLE', 6);
  */
 function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
        $uts = 0;
+       $da = array();
        if ($ts==0) {
                $uts=time();
        } elseif (preg_match("/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/",$ts,$da)) {
index 1529a73..a5f987f 100644 (file)
@@ -99,7 +99,7 @@ class HTMLForm {
                if ( $this->mRequest->wasPosted() ) {
                        $arr = $this->mRequest->getArray( $varname );
                        if ( is_array( $arr ) ) {
-                               foreach ( $_POST[$varname] as $index=>$element ) {
+                               foreach ( $_POST[$varname] as $index => $element ) {
                                        $s .= htmlspecialchars( $element )."\n";
                                }
                        }
index 013cdba..88ffbeb 100644 (file)
@@ -95,10 +95,9 @@ class Image
         * Get the memcached keys
         * Returns an array, first element is the local cache key, second is the shared cache key, if there is one
         */
-       function getCacheKeys( $shared = false ) {
+       function getCacheKeys( ) {
                global $wgDBname, $wgUseSharedUploads, $wgSharedUploadDBname, $wgCacheSharedUploads;
 
-               $foundCached = false;
                $hashedName = md5($this->name);
                $keys = array( "$wgDBname:Image:$hashedName" );
                if ( $wgUseSharedUploads && $wgSharedUploadDBname && $wgCacheSharedUploads ) {
index c9b2146..d589d8c 100644 (file)
@@ -164,7 +164,8 @@ class Job {
                global $wgParser;
                $fname = 'Job::refreshLinks';
                wfProfileIn( $fname );
-               
+
+               # FIXME: $dbw never used.
                $dbw =& wfGetDB( DB_MASTER );
 
                $linkCache =& LinkCache::singleton();
index 66df19f..5741e0c 100644 (file)
@@ -50,7 +50,7 @@ class LogPage {
        }
 
        function saveContent() {
-               if( wfReadOnly() ) return;
+               if( wfReadOnly() ) return false;
 
                global $wgUser;
                $fname = 'LogPage::saveContent';
index 00eedd2..e7b64f6 100644 (file)
@@ -32,6 +32,7 @@ class element {
 
        /**
        * This finds the ATTRS element and returns the ATTR sub-children as a single string
+       * @todo FIXME $parser always empty when calling makeXHTML()
        */
        function getSourceAttrs() {
                $ret = '';
@@ -110,7 +111,7 @@ class element {
                #       foreach ( array_keys ( $this->children ) AS $x )
                #          $this->fixLinkTails ( $parser , $x ) ;
 
-               foreach ($this->children as $key => $child) {
+               foreach ($this->children as $child) {
                        if (is_string($child)) {
                                $ret .= $child;
                        } elseif ($child->name != 'ATTRS') {
@@ -522,7 +523,7 @@ class xml2php {
  */
 class ParserXML extends Parser {
        /**#@+
-        * @access private
+        * @private
         */
        # Persistent:
        var $mTagHooks, $mListType;
@@ -544,7 +545,7 @@ class ParserXML extends Parser {
        /**
         * Constructor
         *
-        * @access public
+        * @public
         */
        function ParserXML() {
                $this->mTemplates = array ();
@@ -556,7 +557,7 @@ class ParserXML extends Parser {
        /**
         * Clear Parser state
         *
-        * @access private
+        * @private
         */
        function clearState() {
                $this->mOutput = new ParserOutput;
index 45277d5..6b63e62 100644 (file)
@@ -338,7 +338,7 @@ class Sanitizer {
                                'h2', 'h3', 'h4', 'h5', 'h6', 'cite', 'code', 'em', 's',
                                'strike', 'strong', 'tt', 'var', 'div', 'center',
                                'blockquote', 'ol', 'ul', 'dl', 'table', 'caption', 'pre',
-                               'ruby', 'rt' , 'rb' , 'rp', 'p', 'span'
+                               'ruby', 'rt' , 'rb' , 'rp', 'p', 'span', 'u'
                        );
                        $htmlsingle = array(
                                'br', 'hr', 'li', 'dt', 'dd'
@@ -365,7 +365,6 @@ class Sanitizer {
 
                # Remove HTML comments
                $text = Sanitizer::removeHTMLcomments( $text );
-
                $bits = explode( '<', $text );
                $text = array_shift( $bits );
                if(!$wgUseTidy) {
index c79609a..d864199 100644 (file)
@@ -215,9 +215,10 @@ class UtfNormal {
 
        /**
         * Load the basic composition data if necessary
-        * @access private
+        * @private
         */
        function loadData() {
+               # fixme : are $utfCanonicalComp, $utfCanonicalDecomp really used?
                global $utfCombiningClass, $utfCanonicalComp, $utfCanonicalDecomp;
                if( !isset( $utfCombiningClass ) ) {
                        require_once( 'UtfNormalData.inc' );
@@ -486,7 +487,7 @@ class UtfNormal {
        /**
         * @param string $string
         * @return string
-        * @access private
+        * @private
         */
        function NFC( $string ) {
                return UtfNormal::fastCompose( UtfNormal::NFD( $string ) );
@@ -495,7 +496,7 @@ class UtfNormal {
        /**
         * @param string $string
         * @return string
-        * @access private
+        * @private
         */
        function NFD( $string ) {
                UtfNormal::loadData();
@@ -507,7 +508,7 @@ class UtfNormal {
        /**
         * @param string $string
         * @return string
-        * @access private
+        * @private
         */
        function NFKC( $string ) {
                return UtfNormal::fastCompose( UtfNormal::NFKD( $string ) );
@@ -516,7 +517,7 @@ class UtfNormal {
        /**
         * @param string $string
         * @return string
-        * @access private
+        * @private
         */
        function NFKD( $string ) {
                global $utfCompatibilityDecomp;
@@ -532,7 +533,7 @@ class UtfNormal {
         * Perform decomposition of a UTF-8 string into either D or KD form
         * (depending on which decomposition map is passed to us).
         * Input is assumed to be *valid* UTF-8. Invalid code will break.
-        * @access private
+        * @private
         * @param string $string Valid UTF-8 string
         * @param array $map hash of expanded decomposition map
         * @return string a UTF-8 string decomposed, not yet normalized (needs sorting)
@@ -593,7 +594,7 @@ class UtfNormal {
        /**
         * Sorts combining characters into canonical order. This is the
         * final step in creating decomposed normal forms D and KD.
-        * @access private
+        * @private
         * @param string $string a valid, decomposed UTF-8 string. Input is not validated.
         * @return string a UTF-8 string with combining characters sorted in canonical order
         */
@@ -642,7 +643,7 @@ class UtfNormal {
        /**
         * Produces canonically composed sequences, i.e. normal form C or KC.
         *
-        * @access private
+        * @private
         * @param string $string a valid UTF-8 string in sorted normal form D or KD. Input is not validated.
         * @return string a UTF-8 string with canonical precomposed characters used where possible
         */
index 4780d8e..34ea629 100644 (file)
@@ -14,7 +14,6 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) {
 
        $fname = 'refreshLinks';
        $dbr =& wfGetDB( DB_SLAVE );
-       $dbw =& wfGetDB( DB_MASTER );
        $start = intval( $start );
 
        # Don't generate TeX PNGs (lack of a sensible current directory causes errors anyway)
@@ -63,8 +62,6 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) {
                        }
                        fixLinksFromArticle( $id );
                }
-
-
        }
 }
 
index 969526d..9cb3ef3 100644 (file)
@@ -25,7 +25,6 @@ class SkinCologneBlue extends Skin {
        }
 
        function doBeforeContent() {
-               global $wgOut, $wgTitle;
 
                $s = "";
                $qb = $this->qbSetting();
@@ -99,7 +98,7 @@ class SkinCologneBlue extends Skin {
        }
 
        function doGetUserStyles() {
-               global $wgOut, $wgStyleSheetPath;
+               global $wgOut;
                $s = parent::doGetUserStyles();
                $qb = $this->qbSetting();
 
@@ -165,8 +164,6 @@ class SkinCologneBlue extends Skin {
                        }
                }
 
-
-
                return $s;
        }
 
index d269db5..0d209bd 100644 (file)
@@ -90,7 +90,7 @@ class SkinStandard extends Skin {
        }
 
        function doAfterContent() {
-               global $wgUser, $wgOut, $wgContLang;
+               global $wgContLang;
                $fname =  'SkinStandard::doAfterContent';
                wfProfileIn( $fname );
                wfProfileIn( $fname.'-1' );