Mailing List Archive

[MediaWiki-commits] [Gerrit] mediawiki...GoogleDocTag[master]: Convert GoogleDocsTag to use extension registation
Jayprakash12345 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406016 )

Change subject: Convert GoogleDocsTag to use extension registation
......................................................................

Convert GoogleDocsTag to use extension registation

Bug: T185621
Change-Id: I00b6b8867fae24c736bfb302daf65841828dc13f
---
M GoogleDocTag.php
A extension.json
2 files changed, 36 insertions(+), 14 deletions(-)


git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GoogleDocTag refs/changes/16/406016/1

diff --git a/GoogleDocTag.php b/GoogleDocTag.php
index 3e5635f..68a88bf 100644
--- a/GoogleDocTag.php
+++ b/GoogleDocTag.php
@@ -1,16 +1,15 @@
<?php

-$wgExtensionCredits['parserhook'][] = array(
- 'path' => __FILE__,
- 'name' => 'GoogleDocTag',
- 'descriptionmsg' => 'googledoctag-desc',
- 'author' => array( 'Reddo', 'Luis Felipe Schenone' ),
- 'version' => '0.4.0',
- 'url' => 'http://www.mediawiki.org/wiki/Extension:GoogleDocTag',
-);
-
-$wgMessagesDirs['GoogleDocTag'] = __DIR__ . '/i18n';
-
-$wgAutoloadClasses['GoogleDocTag'] = __DIR__ . '/GoogleDocTag.body.php';
-
-$wgHooks['ParserFirstCallInit'][] = 'GoogleDocTag::setParserHook';
+if ( function_exists( 'wfLoadExtension' ) ) {
+ wfLoadExtension( 'GoogleDocTag' );
+ // Keep i18n globals so mergeMessageFileList.php doesn't break
+ $wgMessagesDirs['GoogleDocTag'] = __DIR__ . '/i18n';
+ wfWarn(
+ 'Deprecated PHP entry point used for the GoogleDocTag extension. ' .
+ 'Please use wfLoadExtension instead, ' .
+ 'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
+ );
+ return;
+} else {
+ die( 'This version of the GoogleDocTag extension requires MediaWiki 1.29+' );
+}
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..90fb327
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,23 @@
+{
+ "name": "GoogleDocTag",
+ "version": "0.5.0",
+ "author": [
+ "Reddo",
+ "Luis Felipe Schenone"
+ ],
+ "url": "http://www.mediawiki.org/wiki/Extension:GoogleDocTag",
+ "descriptionmsg": "googledoctag-desc",
+ "type": "parserhook",
+ "MessagesDirs": {
+ "GoogleDocTag": [
+ "i18n"
+ ]
+ },
+ "AutoloadClasses": {
+ "GoogleDocTag": "GoogleDocTag.body.php"
+ },
+ "Hooks": {
+ "ParserFirstCallInit": "GoogleDocTag::setParserHook"
+ },
+ "manifest_version": 2
+}

--
To view, visit https://gerrit.wikimedia.org/r/406016
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00b6b8867fae24c736bfb302daf65841828dc13f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GoogleDocTag
Gerrit-Branch: master
Gerrit-Owner: Jayprakash12345 <0freerunning@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits