From: Antoine Musso Date: Mon, 1 May 2006 10:53:59 +0000 (+0000) Subject: unused variables as per #3692 X-Git-Tag: 1.31.0-rc.0~57294 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=473cd5cbccc6b6b9442b57aba0ba02a0a35845a6;p=lhc%2Fweb%2Fwiklou.git unused variables as per #3692 --- diff --git a/config/index.php b/config/index.php index 135127b6db..71eceb5e8a 100644 --- a/config/index.php +++ b/config/index.php @@ -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 diff --git a/includes/Article.php b/includes/Article.php index 9e2c9d064b..52ecca4bdd 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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(); diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 69756dc377..ed9bc0025a 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -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(); } diff --git a/includes/ChangesList.php b/includes/ChangesList.php index ab30a13dae..59c410fe98 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -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 { diff --git a/includes/Database.php b/includes/Database.php index 133f4a1ac0..8376f06fd3 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -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( '/(\\\\[?!&]|[?!&])/', diff --git a/includes/Exif.php b/includes/Exif.php index e7a3f9c7fc..100968824d 100644 --- a/includes/Exif.php +++ b/includes/Exif.php @@ -366,7 +366,7 @@ class Exif { /** * @todo document */ - function makeFormattedData( $data = null ) { + function makeFormattedData( ) { $format = new FormatExif( $this->getFilteredData() ); $this->mFormattedExifData = $format->getFormattedData(); } diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5502d9ca7c..d30dd97197 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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)) { diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 1529a730ce..a5f987f812 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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"; } } diff --git a/includes/Image.php b/includes/Image.php index 013cdbaf1e..88ffbeb23b 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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 ) { diff --git a/includes/JobQueue.php b/includes/JobQueue.php index c9b2146f3a..d589d8c019 100644 --- a/includes/JobQueue.php +++ b/includes/JobQueue.php @@ -164,7 +164,8 @@ class Job { global $wgParser; $fname = 'Job::refreshLinks'; wfProfileIn( $fname ); - + + # FIXME: $dbw never used. $dbw =& wfGetDB( DB_MASTER ); $linkCache =& LinkCache::singleton(); diff --git a/includes/LogPage.php b/includes/LogPage.php index 66df19f557..5741e0cee7 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -50,7 +50,7 @@ class LogPage { } function saveContent() { - if( wfReadOnly() ) return; + if( wfReadOnly() ) return false; global $wgUser; $fname = 'LogPage::saveContent'; diff --git a/includes/ParserXML.php b/includes/ParserXML.php index 00eedd22ce..e7b64f6e92 100644 --- a/includes/ParserXML.php +++ b/includes/ParserXML.php @@ -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; diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 45277d5270..6b63e6242c 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -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) { diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php index c79609a29f..d86419934b 100644 --- a/includes/normal/UtfNormal.php +++ b/includes/normal/UtfNormal.php @@ -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 */ diff --git a/maintenance/refreshLinks.inc b/maintenance/refreshLinks.inc index 4780d8e3d8..34ea6294d0 100644 --- a/maintenance/refreshLinks.inc +++ b/maintenance/refreshLinks.inc @@ -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 ); } - - } } diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 969526d15c..9cb3ef32dd 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -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; } diff --git a/skins/Standard.php b/skins/Standard.php index d269db529d..0d209bd4a0 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -90,7 +90,7 @@ class SkinStandard extends Skin { } function doAfterContent() { - global $wgUser, $wgOut, $wgContLang; + global $wgContLang; $fname = 'SkinStandard::doAfterContent'; wfProfileIn( $fname ); wfProfileIn( $fname.'-1' );