* Removing a handful of unused globals.
authorNick Jenkins <nickj@users.mediawiki.org>
Tue, 23 Jan 2007 07:29:58 +0000 (07:29 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Tue, 23 Jan 2007 07:29:58 +0000 (07:29 +0000)
* $stack is not modified in Profiler::calltreeCount(), no need to pass-by-ref.
* Add FIXME marker to non-cross-platform line.
* A freshly created string does not need to be returned by reference. [Xml::namespaceSelector() and HTMLnamespaceselector() ].

includes/Parser.php
includes/Profiler.php
includes/ProtectionForm.php
includes/SpecialResetpass.php
includes/Wiki.php
includes/Xml.php
includes/XmlFunctions.php

index 8f04aa2..1d27f90 100644 (file)
@@ -722,7 +722,7 @@ class Parser
                $descriptorspec = array(
                        0 => array('pipe', 'r'),
                        1 => array('pipe', 'w'),
-                       2 => array('file', '/dev/null', 'a')
+                       2 => array('file', '/dev/null', 'a')  // FIXME: this line in UNIX-specific, it generates a warning on Windows, because /dev/null is not a valid Windows file.
                );
                $pipes = array();
                $process = proc_open("$wgTidyBin -config $wgTidyConf $wgTidyOpts$opts", $descriptorspec, $pipes);
index 8485edb..8307690 100644 (file)
@@ -287,7 +287,7 @@ class Profiler {
         * @return Integer
         * @private
         */
-       function calltreeCount($stack, $start) {
+       function calltreeCount($stack, $start) {
                $level = $stack[$start][1];
                $count = 0;
                for ($i = $start -1; $i >= 0 && $stack[$i][1] > $level; $i --) {
index 56eae6e..2d9d31b 100644 (file)
@@ -28,7 +28,7 @@ class ProtectionForm {
        var $mExpiry = null;
 
        function __construct( &$article ) {
-               global $wgRequest, $wgUser, $wgLang;
+               global $wgRequest, $wgUser;
                global $wgRestrictionTypes, $wgRestrictionLevels;
                $this->mArticle =& $article;
                $this->mTitle =& $article->mTitle;
index cde582b..b83375f 100644 (file)
@@ -68,7 +68,7 @@ class PasswordResetForm extends SpecialPage {
        }
        
        function showForm() {
-               global $wgOut, $wgUser, $wgLang, $wgRequest;
+               global $wgOut, $wgUser, $wgRequest;
                
                $self = SpecialPage::getTitleFor( 'Resetpass' );                
                $form  =
index cb5cce5..e5849a1 100644 (file)
@@ -148,7 +148,7 @@ class MediaWiki {
                {
                        $targetUrl = $title->getFullURL();
                        // Redirect to canonical url, make it a 301 to allow caching
-                       global $wgServer, $wgUsePathInfo;
+                       global $wgUsePathInfo;
                        if( $targetUrl == $wgRequest->getFullRequestURL() ) {
                                $message = "Redirect loop detected!\n\n" .
                                        "This means the wiki got confused about what page was " .
index 30b9eac..4485626 100644 (file)
@@ -69,7 +69,7 @@ class Xml {
         * @param $includehidden Bool: include hidden namespaces?
         * @return String: Html string containing the namespace selector
         */
-       public static function &namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {
+       public static function namespaceSelector($selected = '', $allnamespaces = null, $includehidden=false) {
                global $wgContLang;
                if( $selected !== '' ) {
                        if( is_null( $selected ) ) {
index cbdcf5c..326c495 100644 (file)
@@ -15,7 +15,7 @@ function wfOpenElement( $element, $attribs = null ) {
 function wfCloseElement( $element ) {
        return "</$element>";
 }
-function &HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) {
+function HTMLnamespaceselector($selected = '', $allnamespaces = null, $includehidden=false) {
        return Xml::namespaceSelector( $selected, $allnamespaces, $includehidden );
 }
 function wfSpan( $text, $class, $attribs=array() ) {