jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/405395 )

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


Convert NoTitle to use extension registration

Bug: T185370
Change-Id: I54f9d0c2369d10ec057f278dfc3e6f63d18802e3
---
M NoTitle.php
A extension.json
2 files changed, 41 insertions(+), 29 deletions(-)

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



diff --git a/NoTitle.php b/NoTitle.php
index fb1840e..d929850 100644
--- a/NoTitle.php
+++ b/NoTitle.php
@@ -18,32 +18,16 @@
  * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public 
License 3.0 or later
  */
 
-// Ensure that the script cannot be executed outside of MediaWiki.
-if ( !defined( 'MEDIAWIKI' ) ) {
-       die( 'This file is an extension to MediaWiki and cannot be used 
standalone.' );
-}
-
-// Display extension properties on MediaWiki.
-$wgExtensionCredits['parserhook'][] = array(
-       'path' => __FILE__,
-       'name' => 'NoTitle',
-       'version' => '0.3.0',
-       'author' => array(
-               'Carlo Cabanilla',
-               'Tony Boyles',
-               '...'
-       ),
-       'url' => 'https://www.mediawiki.org/wiki/Extension:NoTitle',
-       'descriptionmsg' => 'notitle-desc',
-       'license-name' => 'GPL-3.0+'
-);
-
-// Load extension classes.
-$wgAutoloadClasses['NoTitle'] = __DIR__ . '/NoTitle.body.php';
-
-// Register extension messages and other localisation.
-$wgMessagesDirs['NoTitle'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['NoTitleMagic'] = __DIR__ . 
'/NoTitle.i18n.magic.php';
-
-// Register extension hooks.
-$wgHooks['ParserBeforeTidy'][] = 'NoTitle::killTitle';
+ if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'NoTitle' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['NoTitle'] = __DIR__ . '/i18n';
+       wfWarn(
+               'Deprecated PHP entry point used for the NoTitle extension. ' .
+               'Please use wfLoadExtension instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the NoTitle extension requires MediaWiki 1.29+' );
+}
\ No newline at end of file
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..9ec4cc2
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,28 @@
+{
+       "name": "NoTitle",
+       "version": "0.3.0",
+       "author": [
+               "Carlo Cabanilla",
+               "Tony Boyles",
+               "..."
+       ],
+       "url": "https://www.mediawiki.org/wiki/Extension:NoTitle";,
+       "descriptionmsg": "notitle-desc",
+       "license-name": "GPL-3.0+",
+       "type": "parserhook",
+       "MessagesDirs": {
+               "NoTitle": [
+                       "i18n"
+               ]
+       },
+       "ExtensionMessagesFiles": {
+               "NoTitleMagic": "NoTitle.i18n.magic.php"
+       },
+       "AutoloadClasses": {
+               "NoTitle": "NoTitle.body.php"
+       },
+       "Hooks": {
+               "ParserBeforeTidy": "NoTitle::killTitle"
+       },
+       "manifest_version": 2
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I54f9d0c2369d10ec057f278dfc3e6f63d18802e3
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/NoTitle
Gerrit-Branch: master
Gerrit-Owner: Jayprakash12345 <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Johnduhart <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mainframe98 <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to