Jayprakash12345 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405271 )

Change subject: Convert PaginateText to use extension registration
......................................................................

Convert PaginateText to use extension registration

Bug: T185305
Change-Id: Ied098567d995059eec7f42ffde8a6b1609158b3f
---
M PaginateText.php
A extension.json
2 files changed, 59 insertions(+), 43 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PaginateText 
refs/changes/71/405271/2

diff --git a/PaginateText.php b/PaginateText.php
index 39609fe..eb101d0 100644
--- a/PaginateText.php
+++ b/PaginateText.php
@@ -9,46 +9,16 @@
  * @author Ike Hecht, 2014
  * @license GNU General Public Licence 2.0 or later
  */
-$wgExtensionCredits['other'][] = array(
-       'path' => __FILE__,
-       'name' => 'PaginateText',
-       'author' => array(
-               'Ike Hecht',
-       ),
-       'version' => '0.1.0',
-       'url' => 'https://www.mediawiki.org/wiki/Extension:PaginateText',
-       'descriptionmsg' => 'paginatetext-desc',
-       'license-name' => 'GPL-2.0+',
-);
-
-/* Setup */
-
-// Register files
-$wgAutoloadClasses['PaginateTextHooks'] = __DIR__ . '/PaginateText.hooks.php';
-$wgMessagesDirs['PaginateText'] = __DIR__ . '/i18n';
-
-// Register hooks
-$wgHooks['ParserFirstCallInit'][] = 'PaginateTextHooks::addTag';
-$wgHooks['BeforePageDisplay'][] = 'PaginateTextHooks::addModules';
-
-// Register modules
-$wgResourceModules['ext.PaginateText'] = array(
-       'scripts' => array(
-               'modules/ext.PaginateText.js',
-       ),
-       'styles' => array(
-               'modules/ext.PaginateText.css',
-       ),
-       'dependencies' => array(
-               'ext.PaginateText.TextPager'
-       ),
-       'localBasePath' => __DIR__,
-       'remoteExtPath' => 'PaginateText',
-);
-$wgResourceModules['ext.PaginateText.TextPager'] = array(
-       'scripts' => array(
-               'modules/jquery_textpager/jquery.textpager.js',
-       ),
-       'localBasePath' => __DIR__,
-       'remoteExtPath' => 'PaginateText',
-);
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'PaginateText' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['PaginateText'] = __DIR__ . '/i18n';
+       wfWarn(
+               'Deprecated PHP entry point used for the PaginateText 
extension. ' .
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the PaginateText extension requires MediaWiki 
1.29+' );
+}
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..832bc28
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,46 @@
+{
+       "name": "PaginateText",
+       "version": "0.1.0",
+       "author": [
+               "Ike Hecht"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:PaginateText";,
+       "descriptionmsg": "paginatetext-desc",
+       "license-name": "GPL-2.0+",
+       "type": "other",
+       "MessagesDirs": {
+               "PaginateText": [
+                       "i18n"
+               ]
+       },
+       "AutoloadClasses": {
+               "PaginateTextHooks": "PaginateText.hooks.php"
+       },
+       "ResourceModules": {
+               "ext.PaginateText": {
+                       "scripts": [
+                               "modules/ext.PaginateText.js"
+                       ],
+                       "styles": [
+                               "modules/ext.PaginateText.css"
+                       ],
+                       "dependencies": [
+                               "ext.PaginateText.TextPager"
+                       ]
+               },
+               "ext.PaginateText.TextPager": {
+                       "scripts": [
+                               "modules/jquery_textpager/jquery.textpager.js"
+                       ]
+               }
+       },
+       "ResourceFileModulePaths": {
+               "localBasePath": "",
+               "remoteExtPath": "PaginateText"
+       },
+       "Hooks": {
+               "ParserFirstCallInit": "PaginateTextHooks::addTag",
+               "BeforePageDisplay": "PaginateTextHooks::addModules"
+       },
+       "manifest_version": 2
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied098567d995059eec7f42ffde8a6b1609158b3f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PaginateText
Gerrit-Branch: master
Gerrit-Owner: Jayprakash12345 <0freerunn...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to