jenkins-bot has submitted this change and it was merged.
Change subject: Revert extension registration from ZeroPortal
......................................................................
Revert extension registration from ZeroPortal
Bug: T149759
Change-Id: I4eabd021bd3c8e2ad7b34905b2b5cbf3365f8283
---
M ZeroPortal.php
D extension.json
2 files changed, 72 insertions(+), 95 deletions(-)
Approvals:
Legoktm: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ZeroPortal.php b/ZeroPortal.php
index ef35ba9..4dd8566 100644
--- a/ZeroPortal.php
+++ b/ZeroPortal.php
@@ -1,16 +1,75 @@
<?php
+/**
+ * Extension ZeroRatedMobileAccess — Zero Rated Mobile Access.
+ *
+ * Require the ZeroBanner extension.
+ *
+ * @file
+ * @ingroup Extensions
+ * @author Patrick Reilly
+ * @author Yuri Astrakhan
+ * @copyright © 2011 Patrick Reilly, 2013 Yuri Astrakhan
+ * @licence GNU General Public Licence 2.0 or later
+ */
-if ( function_exists( 'wfLoadExtension' ) ) {
- wfLoadExtension( 'ZeroPortal' );
- // Keep i18n globals so mergeMessageFileList.php doesn't break
- $wgMessagesDirs['ZeroPortal'] = __DIR__ . '/i18n';
- $wgExtensionMessagesFiles['ZeroPortalAlias'] = __DIR__ .
'/ZeroPortal.alias.php';
- /*wfWarn(
- 'Deprecated PHP entry point used for ZeroPortal extension. ' .
- 'Please use wfLoadExtension instead, ' .
- 'see https://www.mediawiki.org/wiki/Extension_registration for
more details.'
- );*/
- return;
-} else {
- die( 'This version of the ZeroPortal extension requires MediaWiki
1.28+' );
+// Needs to be called within MediaWiki; not standalone
+if ( !defined( 'MEDIAWIKI' ) ) {
+ echo( "This is a MediaWiki extension and cannot run standalone.\n" );
+ die( -1 );
}
+
+// Extension credits that will show up on Special:Version
+$wgExtensionCredits['other'][] = array(
+ 'path' => __FILE__,
+ 'name' => 'ZeroPortal',
+ 'version' => '1.0.0',
+ 'author' => array( 'Yuri Astrakhan' ),
+ 'descriptionmsg' => 'zeroportal-desc',
+ 'url' => 'https://www.mediawiki.org/wiki/Extension:ZeroPortal',
+ 'license-name' => 'GPL-2.0+',
+);
+
+$wgMessagesDirs['ZeroPortal'] = __DIR__ . '/i18n';
+$wgExtensionMessagesFiles['ZeroPortal'] = __DIR__ . '/ZeroPortal.i18n.php';
+
+$wgAutoloadClasses['ZeroPortal\\ApiZeroPortal'] = __DIR__ .
'/includes/ApiZeroPortal.php';
+$wgAutoloadClasses['ZeroPortal\\ConfigPageHooks'] = __DIR__ .
'/includes/ConfigPageHooks.php';
+$wgAutoloadClasses['ZeroPortal\\LuaLibrary'] = __DIR__ .
'/includes/LuaLibrary.php';
+$wgAutoloadClasses['ZeroPortal\\PortalSpecialPage'] = __DIR__ .
'/includes/PortalSpecialPage.php';
+$wgAutoloadClasses['ZeroPortal\\ConfigMerger'] = __DIR__ .
'/includes/ConfigMerger.php';
+$wgAutoloadClasses['ZeroPortal\\ZeroConfigView'] = __DIR__ .
'/includes/ZeroConfigView.php';
+
+$wgResourceModules['zeroportal.config'] = array(
+ 'dependencies' => 'zerobanner.config.styles', // defined in ZeroBanner
ext, used for sample banners
+ 'localBasePath' => __DIR__,
+ 'remoteExtPath' => 'ZeroPortal',
+ 'styles' => array( 'modules/zero.config.css' ),
+ 'position' => 'top',
+);
+
+$wgResourceModules['zeroportal.portalstyles'] = array(
+ 'localBasePath' => __DIR__,
+ 'remoteExtPath' => 'ZeroPortal',
+ 'styles' => array( 'modules/zero.resets.less',
'modules/zero.content.less' ),
+ 'position' => 'top',
+);
+
+$wgAPIModules['zeroportal'] = 'ZeroPortal\ApiZeroPortal';
+$wgHooks['BeforePageDisplay'][] =
'ZeroPortal\ConfigPageHooks::onBeforePageDisplay';
+$wgHooks['ScribuntoExternalLibraries'][] =
'ZeroPortal\LuaLibrary::onScribuntoExternalLibraries';
+
+// Set our own view class for the JsonZeroConfig model, and configure local
storage
+$wgJsonConfigModels['JsonZeroConfig']['view'] = 'ZeroPortal\ZeroConfigView';
+$wgJsonConfigs['JsonZeroConfig']['store'] = true;
+
+$wgSpecialPages['ZeroPortal'] = 'ZeroPortal\PortalSpecialPage';
+$wgExtensionMessagesFiles['ZeroPortalAlias'] = __DIR__ . DIRECTORY_SEPARATOR .
'ZeroPortal.alias.php';
+
+$wgZeroPortalImpersonateUser = false;
+
+$wgExtensionFunctions[] = function( ) {
+ if ( !defined( 'NS_ZERO' ) ) {
+ echo( "ZeroBanner extension has not been added\n" );
+ die( -1 );
+ }
+};
diff --git a/extension.json b/extension.json
deleted file mode 100644
index e073a00..0000000
--- a/extension.json
+++ /dev/null
@@ -1,82 +0,0 @@
-{
- "name": "ZeroPortal",
- "version": "1.1.0",
- "author": [
- "Yuri Astrakhan"
- ],
- "url": "https://www.mediawiki.org/wiki/Extension:ZeroPortal",
- "descriptionmsg": "zeroportal-desc",
- "license-name": "GPL-2.0+",
- "type": "other",
- "ExtensionFunctions": [
- "ZeroPortal\\ConfigPageHooks::onExtensionFunctions"
- ],
- "SpecialPages": {
- "ZeroPortal": "ZeroPortal\\PortalSpecialPage"
- },
- "APIModules": {
- "zeroportal": "ZeroPortal\\ApiZeroPortal"
- },
- "MessagesDirs": {
- "ZeroPortal": [
- "i18n"
- ]
- },
- "ExtensionMessagesFiles": {
- "ZeroPortalAlias": "ZeroPortal.alias.php"
- },
- "AutoloadClasses": {
- "ZeroPortal\\ApiZeroPortal": "includes/ApiZeroPortal.php",
- "ZeroPortal\\ConfigPageHooks": "includes/ConfigPageHooks.php",
- "ZeroPortal\\LuaLibrary": "includes/LuaLibrary.php",
- "ZeroPortal\\PortalSpecialPage":
"includes/PortalSpecialPage.php",
- "ZeroPortal\\ConfigMerger": "includes/ConfigMerger.php",
- "ZeroPortal\\ZeroConfigView": "includes/ZeroConfigView.php"
- },
- "ResourceModules": {
- "zeroportal.config": {
- "dependencies": "zerobanner.config.styles",
- "styles": [
- "modules/zero.config.css"
- ],
- "position": "top"
- },
- "zeroportal.portalstyles": {
- "styles": [
- "modules/zero.resets.less",
- "modules/zero.content.less"
- ],
- "position": "top"
- }
- },
- "ResourceFileModulePaths": {
- "localBasePath": "",
- "remoteExtPath": "ZeroPortal"
- },
- "Hooks": {
- "BeforePageDisplay":
"ZeroPortal\\ConfigPageHooks::onBeforePageDisplay",
- "ScribuntoExternalLibraries":
"ZeroPortal\\LuaLibrary::onScribuntoExternalLibraries"
- },
- "config": {
- "JsonConfigs": {
- "merge_strategy": "array_replace_recursive",
- "value": {
- "JsonZeroConfig": {
- "store": true
- }
- }
- },
- "JsonConfigModels": {
- "merge_strategy": "array_replace_recursive",
- "value": {
- "JsonZeroConfig": {
- "view": "ZeroPortal\\ZeroConfigView"
- }
- }
- },
- "ZeroPortalImpersonateUser": {
- "value": false
- }
- },
- "manifest_version": 2
-}
--
To view, visit https://gerrit.wikimedia.org/r/319861
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4eabd021bd3c8e2ad7b34905b2b5cbf3365f8283
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ZeroPortal
Gerrit-Branch: REL1_28
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits