[MediaWiki-commits] [Gerrit] mediawiki...Loops[master]: Fix a typo for escaped method, remove deprecated i18n file
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/330327 ) Change subject: Fix a typo for escaped method, remove deprecated i18n file .. Fix a typo for escaped method, remove deprecated i18n file Also some minor changes to comments to fit PHP coding conventions Bug: T154487 Change-Id: I771e7f88f5ac27b0ed036fe28eaa8cab67592864 --- D Loops.i18n.php M Loops.php 2 files changed, 16 insertions(+), 51 deletions(-) Approvals: jenkins-bot: Verified Siebrand: Looks good to me, approved diff --git a/Loops.i18n.php b/Loops.i18n.php deleted file mode 100644 index d346f64..000 --- a/Loops.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShimeb827136401c6f57' ) ) { - function wfJsonI18nShimeb827136401c6f57( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimeb827136401c6f57'; -} diff --git a/Loops.php b/Loops.php index c988501..f87d8c5 100644 --- a/Loops.php +++ b/Loops.php @@ -29,7 +29,6 @@ // language files: $wgMessagesDirs['Loops'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['Loops' ] = ExtLoops::getDir() . '/Loops.i18n.php'; $wgExtensionMessagesFiles['LoopsMagic'] = ExtLoops::getDir() . '/Loops.i18n.magic.php'; // hooks registration: @@ -46,7 +45,7 @@ * extension logic stuff. */ class ExtLoops { - const VERSION = '0.5.0'; + const VERSION = '0.5.1'; /** * Configuration variable defining maximum allowed number of loops ('-1' => no limit). @@ -117,10 +116,9 @@ } - - # Parser Functions # - - + /** +* Parser functions +*/ public static function pfObj_while( Parser &$parser, $frame, $args ) { return self::perform_while( $parser, $frame, $args, false ); } @@ -214,7 +212,7 @@ * #fornumargs: | keyVarName | valVarName | code */ public static function pfObj_fornumargs( Parser &$parser, $frame, $args ) { - /* + /** * get numeric arguments, don't use PPFrame::getNumberedArguments because it would * return explicitely numbered arguments only. */ @@ -228,8 +226,10 @@ ksort( $tNumArgs ); // sort from lowest to highest if( count( $args ) > 3 ) { - // compatbility to pre 0.4 but consistency with other Loop functions. - // this way the first argument can be ommitted like '#fornumargs: |varKey |varVal |code' + /** +*compatbility to pre 0.4 but consistency with other Loop functions. +* this way the first argument can be ommitted like '#fornumargs: |varKey |varVal |code' +*/ array_shift( $args ); } @@ -308,9 +308,9 @@ } - ### - # Loops Count # - ### + /** +* Loops count +*/ /** * Returns how many loops have been performed for a given Parser instance. @@ -357,13 +357,13 @@ if( trim( $output ) !== '' ) { $output .= "\n"; } - return $output .= '' . wfMessage( 'loops_max' )->inContentLanguage()->escape() . ''; + re
[MediaWiki-commits] [Gerrit] mediawiki...Loops[master]: Fix a typo for escaped method, remove deprecated i18n file
SamanthaNguyen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/330327 ) Change subject: Fix a typo for escaped method, remove deprecated i18n file .. Fix a typo for escaped method, remove deprecated i18n file Bug: T154487 Change-Id: I771e7f88f5ac27b0ed036fe28eaa8cab67592864 --- D Loops.i18n.php M Loops.php 2 files changed, 16 insertions(+), 50 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Loops refs/changes/27/330327/1 diff --git a/Loops.i18n.php b/Loops.i18n.php deleted file mode 100644 index d346f64..000 --- a/Loops.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShimeb827136401c6f57' ) ) { - function wfJsonI18nShimeb827136401c6f57( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShimeb827136401c6f57'; -} diff --git a/Loops.php b/Loops.php index c988501..8c9e3a6 100644 --- a/Loops.php +++ b/Loops.php @@ -46,7 +46,7 @@ * extension logic stuff. */ class ExtLoops { - const VERSION = '0.5.0'; + const VERSION = '0.5.1'; /** * Configuration variable defining maximum allowed number of loops ('-1' => no limit). @@ -117,10 +117,9 @@ } - - # Parser Functions # - - + /** +* Parser functions +*/ public static function pfObj_while( Parser &$parser, $frame, $args ) { return self::perform_while( $parser, $frame, $args, false ); } @@ -214,7 +213,7 @@ * #fornumargs: | keyVarName | valVarName | code */ public static function pfObj_fornumargs( Parser &$parser, $frame, $args ) { - /* + /** * get numeric arguments, don't use PPFrame::getNumberedArguments because it would * return explicitely numbered arguments only. */ @@ -228,8 +227,10 @@ ksort( $tNumArgs ); // sort from lowest to highest if( count( $args ) > 3 ) { - // compatbility to pre 0.4 but consistency with other Loop functions. - // this way the first argument can be ommitted like '#fornumargs: |varKey |varVal |code' + /** +*compatbility to pre 0.4 but consistency with other Loop functions. +* this way the first argument can be ommitted like '#fornumargs: |varKey |varVal |code' +*/ array_shift( $args ); } @@ -308,9 +309,9 @@ } - ### - # Loops Count # - ### + /** +* Loops count +*/ /** * Returns how many loops have been performed for a given Parser instance. @@ -357,13 +358,13 @@ if( trim( $output ) !== '' ) { $output .= "\n"; } - return $output .= '' . wfMessage( 'loops_max' )->inContentLanguage()->escape() . ''; + return $output .= '' . wfMessage( 'loops_max' )->inContentLanguage()->escaped() . ''; } - ## - # Hooks handling # - ## + /** +* Hooks handling +*/ public static function onParserClearState( Parser &$parser ) { // reset loops cou