From c40d38a5be8b625e74a651688236203e854f5dd0 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 31 Oct 2010 23:19:40 +0000 Subject: [PATCH] Remove a few more unused variables Add a couple of braces to unobvious if --- includes/ConfEditor.php | 1 - includes/GlobalFunctions.php | 2 -- includes/LogEventsList.php | 1 - includes/MessageCache.php | 1 - includes/Skin.php | 8 +------- includes/User.php | 1 - includes/UserMailer.php | 3 ++- includes/db/DatabaseIbm_db2.php | 1 - includes/installer/Installer.php | 2 +- maintenance/tests/parser/parserTest.inc | 3 +-- skins/Vector.php | 6 +++--- 11 files changed, 8 insertions(+), 21 deletions(-) diff --git a/includes/ConfEditor.php b/includes/ConfEditor.php index 4bd55ac35f..d62a9ceb1b 100644 --- a/includes/ConfEditor.php +++ b/includes/ConfEditor.php @@ -510,7 +510,6 @@ class ConfEditor { $indent = false; } if ( $indent !== false && $arrowPos !== false ) { - $textToInsert = "$indent$key "; $arrowIndentLength = $arrowPos - $pos - $indentLength - strlen( $key ); if ( $arrowIndentLength > 0 ) { $arrowIndent = str_repeat( ' ', $arrowIndentLength ); diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6fc7f16c46..c082acc712 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -425,13 +425,11 @@ function wfErrorLog( $text, $file ) { # Needs the sockets extension if ( preg_match( '!^(tcp|udp):(?://)?\[([0-9a-fA-F:]+)\]:(\d+)(?:/(.*))?$!', $file, $m ) ) { // IPv6 bracketed host - $protocol = $m[1]; $host = $m[2]; $port = intval( $m[3] ); $prefix = isset( $m[4] ) ? $m[4] : false; $domain = AF_INET6; } elseif ( preg_match( '!^(tcp|udp):(?://)?([a-zA-Z0-9.-]+):(\d+)(?:/(.*))?$!', $file, $m ) ) { - $protocol = $m[1]; $host = $m[2]; if ( !IP::isIPv4( $host ) ) { $host = gethostbyname( $host ); diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index c9b91f1488..820793a9ef 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -460,7 +460,6 @@ class LogEventsList { if( count($paramArray) >= 1 ) { $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); // $paramArray[1] is a CSV of the IDs - $Ids = explode( ',', $paramArray[0] ); $query = $paramArray[0]; // Link to each hidden object ID, $paramArray[1] is the url param $revert = '(' . $this->skin->link( diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 0afb2df3dd..1e98d5a3cb 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -634,7 +634,6 @@ class MessageCache { */ function getMsgFromNamespace( $title, $code ) { global $wgAdaptiveMessageCache; - $big = false; $this->load( $code ); if ( isset( $this->mCache[$code][$title] ) ) { diff --git a/includes/Skin.php b/includes/Skin.php index f31fc9b07e..cc1f2f52ea 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -531,17 +531,11 @@ class Skin extends Linker { */ function setupUserCss( OutputPage $out ) { global $wgRequest; - global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, $wgSquidMaxage; + global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs; wfProfileIn( __METHOD__ ); $this->setupSkinUserCss( $out ); - - $siteargs = array( - 'action' => 'raw', - 'maxage' => $wgSquidMaxage, - ); - // Add any extension CSS foreach ( $out->getExtStyle() as $url ) { $out->addStyle( $url ); diff --git a/includes/User.php b/includes/User.php index 80ecd460b3..25e0e520ae 100644 --- a/includes/User.php +++ b/includes/User.php @@ -693,7 +693,6 @@ class User { } # Reject various classes of invalid names - $name = $t->getText(); global $wgAuth; $name = $wgAuth->getCanonicalName( $t->getText() ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 3033779689..4121245048 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -471,13 +471,14 @@ class EmailNotification { $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'created' ); } - if ($wgEnotifImpersonal && $this->oldid) + if ($wgEnotifImpersonal && $this->oldid) { /* * For impersonal mail, show a diff link to the last * revision. */ $keys['$NEWPAGE'] = wfMsgForContent('enotif_lastdiff', $this->title->getFullURL("oldid={$this->oldid}&diff=next")); + } $body = strtr( $body, $keys ); $pagetitle = $this->title->getPrefixedText(); diff --git a/includes/db/DatabaseIbm_db2.php b/includes/db/DatabaseIbm_db2.php index b695d0b705..60a419055b 100644 --- a/includes/db/DatabaseIbm_db2.php +++ b/includes/db/DatabaseIbm_db2.php @@ -607,7 +607,6 @@ EOF; } else { print '
  • Foreign keys done
  • '; } - $res = null; // TODO: populate interwiki links diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index e4168188db..266a631525 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -683,7 +683,7 @@ abstract class Installer { } # Get a list of available locales. - $lines = $ret = false; + $ret = false; $lines = wfShellExec( '/usr/bin/locale -a', $ret ); if ( $ret ) { diff --git a/maintenance/tests/parser/parserTest.inc b/maintenance/tests/parser/parserTest.inc index a62d628bfa..afd2f811a2 100644 --- a/maintenance/tests/parser/parserTest.inc +++ b/maintenance/tests/parser/parserTest.inc @@ -515,7 +515,6 @@ class ParserTest { private function parseOptions( $instring ) { $opts = array(); - $lines = explode( "\n", $instring ); // foo // foo=bar // foo="bar baz" @@ -554,7 +553,7 @@ class ParserTest { if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) { foreach ( $matches as $bits ) { - $match = array_shift( $bits ); + array_shift( $bits ); $key = strtolower( array_shift( $bits ) ); if ( count( $bits ) == 0 ) { $opts[$key] = true; diff --git a/skins/Vector.php b/skins/Vector.php index d61c1f8541..679d244af8 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -680,7 +680,7 @@ class VectorTemplate extends QuickTemplate {
    msg('namespaces') ?>
    html('userlangattributes') ?>> - data['namespace_urls'] as $key => $link ): ?> + data['namespace_urls'] as $link ): ?>
  • >>
  • @@ -692,7 +692,7 @@ class VectorTemplate extends QuickTemplate {

    - data['variant_urls'] as $key => $link ): ?> + data['variant_urls'] as $link ): ?> @@ -702,7 +702,7 @@ class VectorTemplate extends QuickTemplate {

    msg('variants') ?>