Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/270864
Change subject: PHP CBF automated fixed ...................................................................... PHP CBF automated fixed Some manual reverts and additions. Change-Id: Ibedeb57ba16553c7a05b1886ca472ba9324fcadb --- M SpecialRally.php M TranslateSettings.php M TranslatewikiSettings.php M bin/scripts/mlebstats.php M bin/scripts/snedUdpMessage.php M groups/MathJax/Checker.php M groups/MediaWiki/MediaWikiTopMessageGroup.php M groups/OpenStreetMap/Insertables.php M groups/Wikimedia/crosswatchChecker.php M irc-relay/logfilter.php M melange/BundleCreater.php M melange/melange.php M melange/mwtestconf.php 13 files changed, 64 insertions(+), 71 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/64/270864/1 diff --git a/SpecialRally.php b/SpecialRally.php index 75f6156..396e63b 100644 --- a/SpecialRally.php +++ b/SpecialRally.php @@ -53,11 +53,12 @@ $allGroups = MessageGroups::singleton()->getGroups(); foreach ( $allGroups as $groupId => $messageGroup ) { if ( in_array( $groupId, $allowedGroups ) ) { - if( $messageGroup->isMeta() ) { + if ( $messageGroup->isMeta() ) { // @todo Ugly work around for MediaWikiTopMessageGroup::getGroups() // not existing. - if( $messageGroup->getId() === 'core-0-mostused' ) + if ( $messageGroup->getId() === 'core-0-mostused' ) { continue; + } $groups = $messageGroup->getGroups(); foreach ( $groups as $gid => $groupDetails ) { @@ -155,13 +156,13 @@ $messageData = TranslateUtils::figureMessage( $row->rc_title ); // Language totals - if( isset( $languages[$messageData[1]] ) ) { + if ( isset( $languages[$messageData[1]] ) ) { $languages[$messageData[1]]++; } else { $languages[$messageData[1]] = 1; } // Per user per language totals - if( isset( $userLangs[$row->rc_user_text][$messageData[1]] ) ) { + if ( isset( $userLangs[$row->rc_user_text][$messageData[1]] ) ) { $userLangs[$row->rc_user_text][$messageData[1]]++; } else { $userLangs[$row->rc_user_text][$messageData[1]] = 1; @@ -235,7 +236,7 @@ $res = $dbr->select( $tables, $fields, $conds, __METHOD__ ); $total = 0; - $output->addHtml( "The following pages qualify for user {$user->getName()}: <ul>"); + $output->addHtml( "The following pages qualify for user {$user->getName()}: <ul>" ); $userName = $user->getName(); foreach ( $res as $_ ) { @@ -255,7 +256,7 @@ $title = preg_replace( '~/[a-z-]+$~i', '', $_->rc_title ); $group = TranslateUtils::messageKeyToGroup( $_->rc_namespace, $title ); - if ( !isset($allowedGroups[$group]) ) { + if ( !isset( $allowedGroups[$group] ) ) { $output->addHtml( '<li><s>' . Linker::linkKnown( Title::makeTitle( $_->rc_namespace, $_->rc_title ) ) . @@ -272,7 +273,7 @@ } if ( $total == 501 ) { $output->addHtml( - "<li>Translations over 500 are omitted.</li>"); + "<li>Translations over 500 are omitted.</li>" ); continue; } diff --git a/TranslateSettings.php b/TranslateSettings.php index 818dfff..df4ccf4 100644 --- a/TranslateSettings.php +++ b/TranslateSettings.php @@ -5,7 +5,7 @@ $GROUPS = __DIR__ . '/groups'; // 2015-05-18 Really broken now. Disabled. -//$wgSpecialPages['Magic'] = 'SpecialMagic'; +// $wgSpecialPages['Magic'] = 'SpecialMagic'; $wgTranslateNewsletterPreference = true; $wgTranslateCacheDirectory = "/resources/caches/translatewiki.net"; @@ -173,7 +173,7 @@ 'fiu-vro' => 'This language code should remain unused. Localise in vro please.', 'gan' => 'This language code should remain unused. Localise in gan-hant or gan-hans please.', 'gom' => 'This language code should remain unused. Localise in gom-deva please.', - #'got' => 'This is an [http://www.sil.org/iso639-3/documentation.asp?id=got ancient language] without enough information to create a localisation. It cannot be localised in translatewiki.net.', + # 'got' => 'This is an [http://www.sil.org/iso639-3/documentation.asp?id=got ancient language] without enough information to create a localisation. It cannot be localised in translatewiki.net.', 'hif' => 'This language code should remain unused. Localise in hif-latn please.', 'ike' => 'This language code should remain unused. Localise in ike-cans or ike-latn please.', 'iu' => 'This language code should remain unused. Localise in ike-cans or ike-latn please.', diff --git a/TranslatewikiSettings.php b/TranslatewikiSettings.php index 25633e3..fb059b3 100644 --- a/TranslatewikiSettings.php +++ b/TranslatewikiSettings.php @@ -1,8 +1,8 @@ <?php -### -# Performance etc. -### +/** + * Performance etc. + */ $wgMainCacheType = CACHE_MEMCACHED; $wgMessageCacheType = 'apc'; @@ -17,9 +17,9 @@ $wgJobRunRate = 0; $wgJobTypeConf['default'] = array( 'class' => 'JobQueueDB', 'order' => 'random', 'claimTTL' => 60 ); -### -# Experimentalism -### +/** + * Experimentalism + */ $wgWellFormedXml = false; $wgExperimentalHtmlIds = true; $wgAllUnicodeFixes = true; @@ -30,14 +30,14 @@ $wgPageLanguageUseDB = true; $wgResourceLoaderValidateJS = false; -#$wgIncludeLegacyJavaScript = false; +# $wgIncludeLegacyJavaScript = false; $wgLegacyJavaScriptGlobals = false; $wgDeprecationReleaseLimit = '1.24'; -### -# Unsorted -### +/** + * Unsorted + */ $wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = ""; $wgRightsText = ""; @@ -46,9 +46,9 @@ $wgUseTidy = false; $wgMaxShellMemory = 1024 * 200; -### -# Names -### +/** + * Names + */ $wgSitename = 'translatewiki.net'; $wgEnableCanonicalServerLink = true; @@ -69,9 +69,9 @@ // For Vector skin which does not support imageless icons except in the deprecated way. $wgFooterIcons['netcup'][] = "<div class='mw_poweredby'><a href=\"http://www.netcup.de/\" title=\"Powered by netcup - netcup.de – Webhosting, vServer, Servermanagement\" target=\"_blank\">Powered by netcup - netcup.de – Webhosting, vServer, Servermanagement</a></div>"; -### -# Changes list -### +/** + * Changes list + */ $wgRCMaxAge = 5 * 365 * 24 * 3600; // 5 years $wgShowUpdatedMarker = true; $wgUseRCPatrol = false; @@ -83,15 +83,15 @@ $wgMaximumMovedPages = 300; $wgCategoryCollation = 'uca-default'; -### -# Ajax spicy etc -### +/** + * Ajax spicy etc + */ $wgUseAutomaticEditSummaries = false; $wgUseInstantCommons = true; -### -# User (account) settings -### +/** + * User (account) settings + */ $wgAllowUserJs = true; $wgAllowUserCss = true; $wgMinimalPasswordLength = 6; @@ -131,7 +131,7 @@ $wgDefaultUserOptions['usenewrc'] = 1; # Disabled 2012-08-20 / Nike / Too spammy/buggy. -#$wgDefaultUserOptions['lqtnotifytalk'] = true; +# $wgDefaultUserOptions['lqtnotifytalk'] = true; $wgDefaultUserOptions['watchcreations'] = true; $wgCaptchaTriggers['createaccount'] = true; // Special:Userlogin&type=signup @@ -141,9 +141,9 @@ $wgCaptchaTriggers['addurl'] = true; // Check on edits that add URLs $wgCaptchaTriggers['badlogin'] = true; // Special:Userlogin after failure -### -# Upload -### +/** + * Upload + */ $wgEnableUploads = true; $wgAllowCopyUploads = true; $wgUseImageMagick = false; @@ -153,9 +153,9 @@ $wgSVGConverter = 'rsvg'; $wgSVGConverters['rsvg'] = '$path/rsvg-convert -w $width -h $height $input -o $output'; -### -# Namespaces -### +/** + * Namespaces + */ $wgNamespaceAliases['Betawiki'] = NS_PROJECT; $wgNamespaceAliases['Betawiki_talk'] = NS_PROJECT_TALK; $wgMetaNamespace = 'Project'; @@ -193,15 +193,15 @@ $wgContentNamespaces[] = NS_MEDIAWIKI; $wgContentNamespaces[] = NS_TRANSLATING; -### -# Skins -### +/** + * Skins + */ require_once "$IP/skins/Vector/Vector.php"; require_once "$IP/skins/MonoBook/MonoBook.php"; -### -# Extensions -### +/** + * Extensions + */ // Extensions which we don't specify any configuration wfLoadExtensions( array( @@ -224,7 +224,6 @@ $EXT = "$IP/extensions"; require_once "$EXT/AdminLinks/AdminLinks.php"; require_once "$EXT/LiquidThreads/LiquidThreads.php"; - wfLoadExtension( 'CleanChanges' ); $wgCCUserFilter = true; @@ -369,9 +368,9 @@ require_once "$EXT/Echo/Echo.php"; $wgEchoBundleEmailInterval = 14400; -### -# Dynamic code starts here -### +/** + * Dynamic code starts here + */ if ( $wgCanonicalServer !== "https://translatewiki.net" ) { $wgHooks['SiteNoticeAfter'][] = function ( &$siteNotice ) { $siteNotice = " @@ -400,7 +399,8 @@ header( "HTTP/1.1 403 Forbidden" ); exit(); } - } catch ( MWException $e ) {} + } catch ( MWException $e ) { + } }; $wgHooks['LanguageGetNamespaces'][] = function ( &$list ) { diff --git a/bin/scripts/mlebstats.php b/bin/scripts/mlebstats.php index e391464..c34f13d 100644 --- a/bin/scripts/mlebstats.php +++ b/bin/scripts/mlebstats.php @@ -22,7 +22,6 @@ return substr( $haystack, -strlen( $needle ) ) === $needle; } - function getStatsFromFile( $path ) { $offsetToDownloads = 0; $stats = array( @@ -107,7 +106,6 @@ ksort( $combined ); $sorted = arrayToList( $combined ); - printf( "%-13s | %-13s\n", 'Most popular', 'In order' ); echo "---------------------------------\n"; $len = count( $combined ); @@ -157,7 +155,6 @@ } } - $lastmonth = mktime( 0, 0, 0, date( 'm' ) - 1, 1, date( 'Y' ) ); $index = date( 'Y-n', $lastmonth ); $pretty = date( 'Y-m', $lastmonth ); @@ -169,7 +166,6 @@ } else { echo "Unable to print stats for $pretty\n\n"; } - echo "All time statistics since 2013-10\n\n"; @@ -184,7 +180,7 @@ ob_end_clean(); if ( $emails ) { - mail( implode( ', ', $emails ) , 'MLEB download statistics', $buffer ); + mail( implode( ', ', $emails ), 'MLEB download statistics', $buffer ); } else { echo $buffer; } diff --git a/bin/scripts/snedUdpMessage.php b/bin/scripts/snedUdpMessage.php index 1ee5786..b85bbef 100644 --- a/bin/scripts/snedUdpMessage.php +++ b/bin/scripts/snedUdpMessage.php @@ -302,4 +302,4 @@ // UDP should have been sent, or at least we tried. return true; -} /* UdpSend() */ \ No newline at end of file +} /* UdpSend() */ diff --git a/groups/MathJax/Checker.php b/groups/MathJax/Checker.php index a211e86..219ca78 100644 --- a/groups/MathJax/Checker.php +++ b/groups/MathJax/Checker.php @@ -5,7 +5,6 @@ * @license GPL-2.0+ */ - class MathJaxMessageChecker extends MessageChecker { protected function variablesCheck( $messages, $code, &$warnings ) { return parent::parameterCheck( $messages, $code, $warnings, '/\\$[0-9]/' ); diff --git a/groups/MediaWiki/MediaWikiTopMessageGroup.php b/groups/MediaWiki/MediaWikiTopMessageGroup.php index 7885e84..975f714 100644 --- a/groups/MediaWiki/MediaWikiTopMessageGroup.php +++ b/groups/MediaWiki/MediaWikiTopMessageGroup.php @@ -43,7 +43,7 @@ $lots = $this->getParentGroup()->getKeys(); $fewer = array_intersect( $few, $lots ); - if ( count ( $fewer ) < count( $few ) ) { + if ( count( $fewer ) < count( $few ) ) { error_log( 'Invalid top messages: ' . implode( ', ', array_diff( $few, $fewer ) ) ); } diff --git a/groups/OpenStreetMap/Insertables.php b/groups/OpenStreetMap/Insertables.php index b6005ab..ea53abd 100644 --- a/groups/OpenStreetMap/Insertables.php +++ b/groups/OpenStreetMap/Insertables.php @@ -24,7 +24,6 @@ }, $matches ); $insertables = array_merge( $insertables, $new ); - return $insertables; } } diff --git a/groups/Wikimedia/crosswatchChecker.php b/groups/Wikimedia/crosswatchChecker.php index 1d46204..42885d7 100644 --- a/groups/Wikimedia/crosswatchChecker.php +++ b/groups/Wikimedia/crosswatchChecker.php @@ -14,6 +14,6 @@ * @param $warnings \array Array where warnings are appended to. */ protected function CrosswatchVariablesCheck( $messages, $code, &$warnings ) { - return parent::parameterCheck( $messages, $code, $warnings, '/<[a-zA-Z\=\{\}\s_\|]{2,}>|{{[a-zA-Z_\|]+}}/'); + return parent::parameterCheck( $messages, $code, $warnings, '/<[a-zA-Z\=\{\}\s_\|]{2,}>|{{[a-zA-Z_\|]+}}/' ); } } diff --git a/irc-relay/logfilter.php b/irc-relay/logfilter.php index b59912b..6434a20 100644 --- a/irc-relay/logfilter.php +++ b/irc-relay/logfilter.php @@ -9,7 +9,7 @@ * @file */ -if( isset( $_SERVER['argv'][1] ) ) { +if ( isset( $_SERVER['argv'][1] ) ) { $file = $_SERVER['argv'][1]; } else { exit( "OMG\n" ); diff --git a/melange/BundleCreater.php b/melange/BundleCreater.php index 92f5937..deb98c4 100644 --- a/melange/BundleCreater.php +++ b/melange/BundleCreater.php @@ -33,14 +33,14 @@ $this->checkout_release(); $this->install_mediawiki(); // Broken - //$this->run_tests(); + // $this->run_tests(); $this->prepare_notes(); $this->create_tag(); $this->push_tag(); $this->create_archive(); $this->prepare_announcement(); // Needs some refactor - //$this->final_steps(); + // $this->final_steps(); } public function clone_mediawiki() { @@ -342,6 +342,4 @@ exec( "git push origin $cTag" ); } } - - } diff --git a/melange/melange.php b/melange/melange.php index 007eeb5..73eeb9c 100644 --- a/melange/melange.php +++ b/melange/melange.php @@ -7,7 +7,7 @@ $cmd = str_replace( '-', '_', $argv[1] ); } -require( 'BundleCreater.php' ); +require 'BundleCreater.php'; $bundler = new BundleCreater( $conf, getcwd() ); if ( method_exists( $bundler, $cmd ) ) { @@ -23,4 +23,4 @@ } echo "- " . $name . "\n"; } -} \ No newline at end of file +} diff --git a/melange/mwtestconf.php b/melange/mwtestconf.php index 2fa08c7..5004a00 100644 --- a/melange/mwtestconf.php +++ b/melange/mwtestconf.php @@ -1,9 +1,9 @@ <?php -ini_set( 'display_errors', 1); -ini_set( 'ignore_repeated_errors', 1); +ini_set( 'display_errors', 1 ); +ini_set( 'ignore_repeated_errors', 1 ); error_reporting( E_ALL | E_STRICT ); -date_default_timezone_set('UTC'); +date_default_timezone_set( 'UTC' ); $wgIncludeLegacyJavaScript = false; $wgLegacyJavaScriptGlobals = false; @@ -14,5 +14,5 @@ $wgDevelopmentWarnings = true; $EXT = "$IP/../extensions"; -require( "$EXT/Translate/Translate.php" ); -require( "$EXT/cldr/cldr.php" ); +require "$EXT/Translate/Translate.php"; +require "$EXT/cldr/cldr.php"; -- To view, visit https://gerrit.wikimedia.org/r/270864 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibedeb57ba16553c7a05b1886ca472ba9324fcadb Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits