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

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

Convert DebugMode to use extension registration

Bug: T184363
Change-Id: If5fcc897ca0bd7546c85424973121aa3201ca075
---
M DebugMode.php
A extension.json
2 files changed, 47 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DebugMode 
refs/changes/27/402627/1

diff --git a/DebugMode.php b/DebugMode.php
index 7d790e7..1e0d045 100644
--- a/DebugMode.php
+++ b/DebugMode.php
@@ -1,66 +1,14 @@
 <?php
-/*
- * Copyright (C) 2014 Ike Hecht
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- */
+if ( function_exists( 'wfLoadExtension' ) ) {
+       wfLoadExtension( 'DebugMode' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['DebugMode'] = __DIR__ . '/i18n';
+       /* wfWarn(
+               'Deprecated PHP entry point used for DebugMode extension. 
Please use wfLoadExtension' .
+               'instead, see 
https://www.mediawiki.org/wiki/Extension_registration for more details.'
+       ); */
+       return true;
+} else {
+       die( 'This version of the DebugMode extension requires MediaWiki 1.29+' 
);
+}
 
-/**
- * DebugMode extension - Puts wiki into debug mode
- *
- * For more info see http://mediawiki.org/wiki/Extension:DebugMode
- *
- * @file
- * @ingroup Extensions
- * @author Ike Hecht
- * @license GNU General Public License 2.0 or later
- */
-$wgExtensionCredits['other'][] = array(
-       'path' => __FILE__,
-       'name' => 'DebugMode',
-       'author' => 'Ike Hecht',
-       'version' => '0.1.0 beta',
-       'url' => 'https://www.mediawiki.org/wiki/Extension:DebugMode',
-       'descriptionmsg' => 'debugmode-desc',
-       'license-name' => 'GPL-2.0-or-later'
-);
-
-$wgMessagesDirs['DebugMode'] = __DIR__ . '/i18n';
-$wgAutoloadClasses['DebugMode'] = __DIR__ . '/DebugMode.class.php';
-$wgAutoloadClasses['DebugModeUtils'] = __DIR__ . '/DebugMode.utils.php';
-
-$wgAutoloadClasses['VarSetter'] = __DIR__ . '/VarSetters/VarSetter.php';
-$wgAutoloadClasses['GlobalVarSetter'] = __DIR__ . 
'/VarSetters/GlobalVarSetter.php';
-$wgAutoloadClasses['PhpFunctionVarSetter'] = __DIR__ . 
'/VarSetters/PhpFunctionVarSetter.php';
-$wgAutoloadClasses['PhpIniVarSetter'] = __DIR__ . 
'/VarSetters/PhpIniVarSetter.php';
-
-$wgExtensionFunctions[] = 'DebugModeUtils::setup';
-
-/* Configuration */
-
-/**
- * Should be set using named constants in the DebugMode class using bitwise 
operators.
- * Can be set to true to enable all debugging or false to do nothing.
- * Note: Setting to false does not turn debugging off! It just leaves the 
existing settings alone.
- */
-$wgDebugMode = DebugModeUtils::getDefault();
-
-/**
- * An array of variables that should be ignored by the extension. Can be used 
for more fine-tuning
- * of variables than allowed by $wgDebugMode.
- * These vars can be any named variables known to the extension, including 
MediaWiki globals and
- * php settings.
- */
-$wgDebugModeIgnoreVars = array();
diff --git a/extension.json b/extension.json
new file mode 100644
index 0000000..0971926
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,35 @@
+{
+    "name": "DebugMode",
+    "version": "0.1.0 beta",
+    "author": "Ike Hecht",
+    "url": "https://www.mediawiki.org/wiki/Extension:DebugMode";,
+    "descriptionmsg": "debugmode-desc",
+    "license-name": "GPL-2.0-or-above",
+    "type": "other",
+    "ExtensionFunctions": [
+               "DebugModeUtils::setup"
+       ],
+    "MessagesDirs": {
+        "DebugMode": [
+                       "i18n"
+               ]
+    },
+    "AutoloadClasses": {
+        "DebugMode": "DebugMode.class.php",
+        "DebugModeUtils": "DebugMode.utils.php",
+        "VarSetter": "VarSetters/VarSetter.php",
+        "GlobalVarSetter": "VarSetters/GlobalVarSetter.php",
+        "PhpFunctionVarSetter": "VarSetters/PhpFunctionVarSetter.php",
+        "PhpIniVarSetter": "VarSetters/PhpIniVarSetter.php"
+    },
+    "config": {
+        "DebugMode": {
+            "value": 59
+        },
+        "DebugModeIgnoreVars": {
+            "value": []
+        }
+    },
+    "manifest_version": 2
+}
+

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5fcc897ca0bd7546c85424973121aa3201ca075
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DebugMode
Gerrit-Branch: master
Gerrit-Owner: Gabrielchihonglee <chihonglee...@gmail.com>

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

Reply via email to