Pmiazga has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/337633 )
Change subject: Hygiene: Move Popups.hooks into includes folder
......................................................................
Hygiene: Move Popups.hooks into includes folder
Lets keep all extenion PHP files in one folder
Change-Id: I225019b895df038c1d43a082ac4244053d0b96dd
---
M extension.json
R includes/PopupsHooks.php
M tests/phpunit/PopupsHooksTest.php
3 files changed, 22 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups
refs/changes/33/337633/1
diff --git a/extension.json b/extension.json
index f1965e4..c47f3c5 100644
--- a/extension.json
+++ b/extension.json
@@ -9,7 +9,7 @@
"license-name": "GPL-2.0+",
"type": "betafeatures",
"AutoloadClasses": {
- "PopupsHooks": "Popups.hooks.php",
+ "Popups\\PopupsHooks": "includes/PopupsHooks.php",
"Popups\\PopupsContext": "includes/PopupsContext.php",
"Popups\\PopupsGadgetsIntegration":
"includes/PopupsGadgetsIntegration.php"
},
@@ -18,25 +18,25 @@
},
"Hooks": {
"GetBetaFeaturePreferences": [
- "PopupsHooks::onGetBetaPreferences"
+ "Popups\\PopupsHooks::onGetBetaPreferences"
],
"BeforePageDisplay": [
- "PopupsHooks::onBeforePageDisplay"
+ "Popups\\PopupsHooks::onBeforePageDisplay"
],
"ResourceLoaderTestModules": [
- "PopupsHooks::onResourceLoaderTestModules"
+ "Popups\\PopupsHooks::onResourceLoaderTestModules"
],
"ResourceLoaderGetConfigVars": [
- "PopupsHooks::onResourceLoaderGetConfigVars"
+ "Popups\\PopupsHooks::onResourceLoaderGetConfigVars"
],
"GetPreferences": [
- "PopupsHooks::onGetPreferences"
+ "Popups\\PopupsHooks::onGetPreferences"
],
"UserGetDefaultOptions": [
- "PopupsHooks::onUserGetDefaultOptions"
+ "Popups\\PopupsHooks::onUserGetDefaultOptions"
],
"MakeGlobalVariablesScript": [
- "PopupsHooks::onMakeGlobalVariablesScript"
+ "Popups\\PopupsHooks::onMakeGlobalVariablesScript"
]
},
"MessagesDirs": {
diff --git a/Popups.hooks.php b/includes/PopupsHooks.php
similarity index 95%
rename from Popups.hooks.php
rename to includes/PopupsHooks.php
index 1d71090..3aa87d5 100644
--- a/Popups.hooks.php
+++ b/includes/PopupsHooks.php
@@ -18,8 +18,18 @@
* @file
* @ingroup extensions
*/
-use Popups\PopupsContext;
+namespace Popups;
+use User;
+use OutputPage;
+use Skin;
+use ResourceLoader;
+
+/**
+ * Hooks definitions for Popups extension
+ *
+ * @package Popups
+ */
class PopupsHooks {
const PREVIEWS_PREFERENCES_SECTION = 'rendering/reading';
@@ -119,8 +129,8 @@
$testModules['qunit']['ext.popups.tests.stubs'] = [
'scripts' => [
- 'tests/qunit/ext.popups/stubs/index.js',
- 'tests/qunit/ext.popups/stubs/user.js',
+ '../tests/qunit/ext.popups/stubs/index.js',
+ '../tests/qunit/ext.popups/stubs/user.js',
],
'dependencies' => [
'ext.popups', // The mw.popups is required.
diff --git a/tests/phpunit/PopupsHooksTest.php
b/tests/phpunit/PopupsHooksTest.php
index d381a51..be57235 100644
--- a/tests/phpunit/PopupsHooksTest.php
+++ b/tests/phpunit/PopupsHooksTest.php
@@ -20,6 +20,7 @@
*/
require_once ( 'PopupsContextTestWrapper.php' );
use Popups\PopupsContext;
+use Popups\PopupsHooks;
/**
* Integration tests for Page Preview hooks
--
To view, visit https://gerrit.wikimedia.org/r/337633
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I225019b895df038c1d43a082ac4244053d0b96dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Pmiazga <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits