jenkins-bot has submitted this change and it was merged.

Change subject: Add extension.json, reduce PHP entry point.
......................................................................


Add extension.json, reduce PHP entry point.

Also fix `composer test` long line warning.
This is I629e04f2 applied to new separate repo.

Bug: T104283
Change-Id: Ibb4a07902320a9467af6a4b7b8c2e2db0bd5e993
---
M BoilerPlate.php
A extension.json
2 files changed, 65 insertions(+), 58 deletions(-)

Approvals:
  Spage: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/BoilerPlate.php b/BoilerPlate.php
index 822af05..4f9a370 100644
--- a/BoilerPlate.php
+++ b/BoilerPlate.php
@@ -1,60 +1,15 @@
 <?php
-/**
- * BoilerPlate extension - the thing that needs you.
- *
- * For more info see http://mediawiki.org/wiki/Extension:BoilerPlate
- *
- * @file
- * @ingroup Extensions
- * @author Your Name, 2015
- */
 
-$wgExtensionCredits['other'][] = array(
-       'path' => __FILE__,
-       'name' => 'BoilerPlate',
-       'author' => array(
-               'Your Name',
-       ),
-       'version'  => '0.0.0',
-       'url' => 'https://www.mediawiki.org/wiki/Extension:BoilerPlate',
-       'descriptionmsg' => 'boilerplate-desc',
-       'license-name' => 'MIT',
-);
-
-/* Setup */
-
-// Register files
-$wgAutoloadClasses['BoilerPlateHooks'] = __DIR__ . '/BoilerPlate.hooks.php';
-$wgAutoloadClasses['SpecialHelloWorld'] = __DIR__ . 
'/specials/SpecialHelloWorld.php';
-$wgMessagesDirs['BoilerPlate'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['BoilerPlateAlias'] = __DIR__ . 
'/BoilerPlate.i18n.alias.php';
-
-// Register hooks
-#$wgHooks['NameOfHook'][] = 'BoilerPlateHooks::onNameOfHook';
-
-// Register special pages
-$wgSpecialPages['HelloWorld'] = 'SpecialHelloWorld';
-
-// Register modules
-$wgResourceModules['ext.boilerPlate.foo'] = array(
-       'scripts' => array(
-               'modules/ext.boilerPlate.js',
-               'modules/ext.boilerPlate.foo.js',
-       ),
-       'styles' => array(
-               'modules/ext.boilerPlate.foo.css',
-       ),
-       'messages' => array(
-       ),
-       'dependencies' => array(
-       ),
-
-       'localBasePath' => __DIR__,
-       'remoteExtPath' => 'examples/BoilerPlate',
-);
-
-
-/* Configuration */
-
-// Enable Foo
-#$wgBoilerPlateEnableFoo = true;
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'BoilerPlate' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['BoilerPlate'] = __DIR__ . '/i18n';
+       $wgExtensionMessagesFiles['BoilerPlateAlias'] = __DIR__ . 
'/BoilerPlate.i18n.alias.php';
+       wfWarn(
+               'Deprecated PHP entry point used for BoilerPlate extension. 
Please use wfLoadExtension ' .
+               'instead, see 
https://www.mediawiki.org/wiki/Extension_registration for more details.'
+       );
+       return true;
+} else {
+       die( 'This version of the BoilerPlate extension requires MediaWiki 
1.25+' );
+}
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..6fcd63c
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,52 @@
+{
+       "name": "BoilerPlate",
+       "version": "0.0.0",
+       "author": [
+               "Your Name"
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:BoilerPlate";,
+       "descriptionmsg": "boilerplate-desc",
+       "license-name": "MIT",
+       "type": "other",
+       "AutoloadClasses": {
+               "BoilerPlateHooks": "BoilerPlate.hooks.php",
+               "SpecialHelloWorld": "specials/SpecialHelloWorld.php"
+       },
+       "config": {
+               "BoilerPlateEnableFoo": true
+       },
+       "ExtensionMessagesFiles": {
+               "BoilerPlateAlias": "BoilerPlate.i18n.alias.php"
+       },
+       "Hooks": {
+               "NameOfHook": [
+                       "BoilerPlateHooks::onNameOfHook"
+               ]
+       },
+       "MessagesDirs": {
+               "BoilerPlate": [
+                       "i18n"
+               ]
+       },
+       "ResourceModules": {
+               "ext.boilerPlate.foo": {
+                       "scripts": [
+                               "modules/ext.boilerPlate.js",
+                               "modules/ext.boilerPlate.foo.js"
+                       ],
+                       "styles": [
+                               "modules/ext.boilerPlate.foo.css"
+                       ],
+                       "messages": [],
+                       "dependencies": []
+               }
+       },
+       "ResourceFileModulePaths": {
+               "localBasePath": "",
+               "remoteExtPath": "examples/BoilerPlate"
+       },
+       "SpecialPages": {
+               "HelloWorld": "SpecialHelloWorld"
+       },
+       "manifest_version": 1
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibb4a07902320a9467af6a4b7b8c2e2db0bd5e993
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/BoilerPlate
Gerrit-Branch: master
Gerrit-Owner: Spage <sp...@wikimedia.org>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Spage <sp...@wikimedia.org>
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