summaryrefslogtreecommitdiff
path: root/extensions/Poem
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Poem')
-rw-r--r--extensions/Poem/Poem.i18n.php35
-rw-r--r--extensions/Poem/Poem.php44
-rw-r--r--extensions/Poem/extension.json27
3 files changed, 39 insertions, 67 deletions
diff --git a/extensions/Poem/Poem.i18n.php b/extensions/Poem/Poem.i18n.php
deleted file mode 100644
index 748ec734..00000000
--- a/extensions/Poem/Poem.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 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( 'wfJsonI18nShim6c20180b417f57bc' ) ) {
- function wfJsonI18nShim6c20180b417f57bc( $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'][] = 'wfJsonI18nShim6c20180b417f57bc';
-}
diff --git a/extensions/Poem/Poem.php b/extensions/Poem/Poem.php
index e43b199d..3362060b 100644
--- a/extensions/Poem/Poem.php
+++ b/extensions/Poem/Poem.php
@@ -1,34 +1,14 @@
<?php
-# MediaWiki Poem extension v1.1
-#
-# Based on example code from
-# http://www.mediawiki.org/wiki/Manual:Extending_wiki_markup
-#
-# Other code is © 2005 Nikola Smolenski <smolensk@eunet.yu>
-# and © 2011 Zaran <zaran.krleza@gmail.com>
-#
-# Anyone is allowed to use this code for any purpose.
-#
-# To install, copy the extension to your extensions directory and add line
-# require_once( "$IP/extensions/Poem/Poem.php" );
-# to the bottom of your LocalSettings.php
-#
-# To use, put some text between <poem></poem> tags
-#
-# For more information see its page at
-# http://www.mediawiki.org/wiki/Extension:Poem
-$wgExtensionCredits['parserhook'][] = array(
- 'path' => __FILE__,
- 'name' => 'Poem',
- 'author' => array( 'Nikola Smolenski', 'Brion Vibber', 'Steve Sanbeg' ),
- 'url' => 'https://www.mediawiki.org/wiki/Extension:Poem',
- 'descriptionmsg' => 'poem-desc',
-);
-
-$dir = __DIR__ . '/';
-$wgParserTestFiles[] = $dir . 'poemParserTests.txt';
-$wgAutoloadClasses['Poem'] = $dir . 'Poem.class.php';
-$wgMessagesDirs['Poem'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Poem'] = $dir . 'Poem.i18n.php';
-$wgHooks['ParserFirstCallInit'][] = 'Poem::init';
+if ( function_exists( 'wfLoadExtension' ) ) {
+ wfLoadExtension( 'Poem' );
+ // Keep i18n globals so mergeMessageFileList.php doesn't break
+ $wgMessagesDirs['Poem'] = __DIR__ . '/i18n';
+ /* wfWarn(
+ 'Deprecated PHP entry point used for Poem extension. Please use wfLoadExtension instead, ' .
+ 'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
+ ); */
+ return true;
+} else {
+ die( 'This version of the Poem extension requires MediaWiki 1.25+' );
+}
diff --git a/extensions/Poem/extension.json b/extensions/Poem/extension.json
new file mode 100644
index 00000000..1b8672ee
--- /dev/null
+++ b/extensions/Poem/extension.json
@@ -0,0 +1,27 @@
+{
+ "name": "Poem",
+ "author": [
+ "Nikola Smolenski",
+ "Brion Vibber",
+ "Steve Sanbeg"
+ ],
+ "url": "https://www.mediawiki.org/wiki/Extension:Poem",
+ "descriptionmsg": "poem-desc",
+ "type": "parserhook",
+ "MessagesDirs": {
+ "Poem": [
+ "i18n"
+ ]
+ },
+ "Hooks": {
+ "ParserFirstCallInit": [
+ "Poem::init"
+ ]
+ },
+ "AutoloadClasses": {
+ "Poem": "Poem.class.php"
+ },
+ "ParserTestFiles": [
+ "poemParserTests.txt"
+ ]
+}