[MediaWiki-commits] [Gerrit] mediawiki...Special404[master]: Extension registration

2018-01-06 Thread Gabrielchihonglee (Code Review)
Gabrielchihonglee has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402589 )

Change subject: Extension registration
..

Extension registration

Changing the plugin file to match with the latest extension registration 
requirements.

Bug: T184334
Change-Id: I50817616b7597e3d99de3371f599e63f482d5d3c
---
M Special404.php
1 file changed, 11 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Special404 
refs/changes/89/402589/1

diff --git a/Special404.php b/Special404.php
index 4093780..47173f0 100644
--- a/Special404.php
+++ b/Special404.php
@@ -1,39 +1,13 @@
 https://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
- * @link https://www.mediawiki.org/wiki/Extension:Special404 Documentation
- */
-
-// Ensure that the script cannot be executed outside of MediaWiki.
-if ( !defined( 'MEDIAWIKI' ) ) {
-die( 'This is an extension to MediaWiki and cannot be run standalone.' );
+if ( function_exists( 'wfLoadExtension' ) ) {
+   wfLoadExtension( 'Special4040' );
+   // Keep i18n globals so mergeMessageFileList.php doesn't break
+   $wgMessagesDirs['CookieWarning'] = __DIR__ . '/i18n';
+   /* wfWarn(
+   'Deprecated PHP entry point used for CookieWarning extension. 
Please use wfLoadExtension' .
+   'instead, see 
https://www.mediawiki.org/wiki/Extension_registration for more details.'
+   ); */
+   return true;
+} else {
+   die( 'This version of the Special404  extension requires MediaWiki 
1.23+' );
 }
-
-// Display extension properties on MediaWiki.
-$wgExtensionCredits['specialpage'][] = array(
-   'path' => __FILE__,
-   'author' => 'Daniel Friesen',
-   'name' => 'Special404',
-   'url' => 'https://www.mediawiki.org/wiki/Extension:Special404',
-   'descriptionmsg' => 'special404-desc',
-   'license-name' => 'GPL-2.0+',
-);
-
-// Register extension messages and other localisation.
-$wgMessagesDirs['Special404'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Special404Alias'] = __DIR__ . 
'/Special404.alias.php';
-
-// Register special page with MediaWiki.
-$wgSpecialPages['Error404'] = 'Special404';
-
-// Load extension's classes.
-$wgAutoloadClasses['Special404'] = __DIR__ . '/Special404_body.php';
-
-// Enable this to force an automatic 301 Moved Permanently redirect if a 
matching title exists
-// This might be useful if you used to use root /Article urls and moved to 
something else
-$egSpecial404RedirectExistingRoots = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50817616b7597e3d99de3371f599e63f482d5d3c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Special404
Gerrit-Branch: master
Gerrit-Owner: Gabrielchihonglee 

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


[MediaWiki-commits] [Gerrit] mediawiki...Special404[master]: Extension registration

2018-01-06 Thread Gabrielchihonglee (Code Review)
Gabrielchihonglee has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402577 )

Change subject: Extension registration
..

Extension registration

Updating the extension Special404 to  match with the latest extension 
registration requirements by addting the extension.json file.

Bug: T184334
Change-Id: I9863e3d5b03d9c559ebf45d54261835e32ba5fd4
---
A extension.json
1 file changed, 23 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Special404 
refs/changes/77/402577/1

diff --git a/extension.json b/extension.json
new file mode 100644
index 000..d9c550a
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,23 @@
+{
+   "name": "Special404",
+   "author": "Daniel Friesen",
+   "url": "https://www.mediawiki.org/wiki/Extension:Special404;,
+   "descriptionmsg": "special404-desc",
+   "license-name": "GPL-2.0+",
+   "type": "specialpage",
+   "SpecialPages": {
+   "Error404": "Special404"
+   },
+   "MessagesDirs": {
+   "Special404": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "Special404Alias": "Special404.alias.php"
+   },
+   "AutoloadClasses": {
+   "Special404": "Special404_body.php"
+   },
+   "manifest_version": 2
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9863e3d5b03d9c559ebf45d54261835e32ba5fd4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Special404
Gerrit-Branch: master
Gerrit-Owner: Gabrielchihonglee 

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