Ljonka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315489

Change subject: [WIP] move special extension registration settings to callback 
function, TODO: check css icons
......................................................................

[WIP] move special extension registration settings to callback function, TODO: 
check css icons

Change-Id: Ie5681025f946e6ff460d8a28e23e6af91fbfdd0a
---
M BlueSpice.hooks.php
M BlueSpiceFoundation.php
M extension.json
M includes/AutoLoader.php
M includes/DefaultSettings.php
M includes/Defines.php
6 files changed, 53 insertions(+), 33 deletions(-)


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

diff --git a/BlueSpice.hooks.php b/BlueSpice.hooks.php
index 12f9235..09c37c3 100644
--- a/BlueSpice.hooks.php
+++ b/BlueSpice.hooks.php
@@ -1,6 +1,8 @@
 <?php
 #$wgHooks['UnitTestsList'][] = 'BsCoreHooks::onUnitTestsList';
 
+global $wgHooks, $wgDBtype;
+
 // START cache invalidation hooks
 $wgHooks['PageContentSaveComplete'][] = 
'BsCacheHelper::onPageContentSaveComplete';
 // END cache invalidation hooks
diff --git a/BlueSpiceFoundation.php b/BlueSpiceFoundation.php
index f2066cc..3eb0b85 100644
--- a/BlueSpiceFoundation.php
+++ b/BlueSpiceFoundation.php
@@ -27,36 +27,43 @@
  */
 /* Changelog
  */
-wfLoadExtension( 'BlueSpiceFoundation' );
 
-if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
-       include_once( __DIR__ . '/vendor/autoload.php' );
+class BlueSpiceFoundation {
+       public static function onRegistry(){
+               if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) {
+                       include_once( __DIR__ . '/vendor/autoload.php' );
+               }
+
+               global $wgScriptPath;
+
+               $wgFooterIcons['poweredby']['bluespice'] = array(
+                       "src" => 
"$wgScriptPath/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-poweredby_bluespice_88x31.png",
+                       "url" => "http://bluespice.com";,
+                       "alt" => "Powered by BlueSpice",
+               );
+
+               require_once( __DIR__."/includes/AutoLoader.php");
+               require_once( __DIR__."/includes/Defines.php" );
+               require_once( __DIR__."/includes/DefaultSettings.php" );
+               require_once( __DIR__."/resources/Resources.php");
+
+               // Register hooks
+               require_once( 'BlueSpice.hooks.php' );
+               //Setup
+
+               // initalise BlueSpice as first extension in a fully 
initialised environment
+               global $wgExtensionFunctions;
+               array_unshift(
+                       $wgExtensionFunctions,
+                       'BsCore::doInitialise'
+               );
+
+               //make old ajax functions available, remove this after 
replacement implemented
+               global $wgAjaxExportList;
+               $wgAjaxExportList[] = 
'BsCommonAJAXInterface::getTitleStoreData';
+               $wgAjaxExportList[] = 
'BsCommonAJAXInterface::getNamespaceStoreData';
+               $wgAjaxExportList[] = 'BsCommonAJAXInterface::getUserStoreData';
+               $wgAjaxExportList[] = 
'BsCommonAJAXInterface::getCategoryStoreData';
+               $wgAjaxExportList[] = 'BsCommonAJAXInterface::getFileUrl';
+       }
 }
-
-$wgFooterIcons['poweredby']['bluespice'] = array(
-       "src" => 
"$wgScriptPath/extensions/BlueSpiceFoundation/resources/bluespice/images/bs-poweredby_bluespice_88x31.png",
-       "url" => "http://bluespice.com";,
-       "alt" => "Powered by BlueSpice",
-);
-
-require_once( __DIR__."/includes/AutoLoader.php");
-require_once( __DIR__."/includes/Defines.php" );
-require_once( __DIR__."/includes/DefaultSettings.php" );
-require_once( __DIR__."/resources/Resources.php");
-
-// Register hooks
-require_once( 'BlueSpice.hooks.php' );
-//Setup
-
-// initalise BlueSpice as first extension in a fully initialised environment
-array_unshift(
-       $wgExtensionFunctions,
-       'BsCore::doInitialise'
-);
-
-//make old ajax functions available, remove this after replacement implemented
-$wgAjaxExportList[] = 'BsCommonAJAXInterface::getTitleStoreData';
-$wgAjaxExportList[] = 'BsCommonAJAXInterface::getNamespaceStoreData';
-$wgAjaxExportList[] = 'BsCommonAJAXInterface::getUserStoreData';
-$wgAjaxExportList[] = 'BsCommonAJAXInterface::getCategoryStoreData';
-$wgAjaxExportList[] = 'BsCommonAJAXInterface::getFileUrl';
\ No newline at end of file
diff --git a/extension.json b/extension.json
index dd0b284..517e73a 100644
--- a/extension.json
+++ b/extension.json
@@ -244,9 +244,11 @@
                "BSEntityRegistry": "includes/EntityRegistry.php",
                "BSEntityConfig": "includes/entityconfigs/EntityConfig.php",
                "BSEntityContent": "includes/content/EntityContent.php",
-               "BSEntityContentHandler": 
"includes/content/EntityContentHandler.php"
+               "BSEntityContentHandler": 
"includes/content/EntityContentHandler.php",
+               "BlueSpiceFoundation": "./BlueSpiceFoundation.php"
        },
        "bsgConfigFiles": [],
        "load_composer_autoloader": true,
-       "manifest_version": 1
+       "manifest_version": 1,
+       "callback": "BlueSpiceFoundation::onRegistry"
 }
diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index 0b598fd..17db80b 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -14,6 +14,7 @@
 $GLOBALS['wgAutoloadClasses']['BsExtensionManager'] = 
__DIR__."/ExtensionManager.class.php";
 
 //TODO: Remove this
+global $wgVersion;
 if ( version_compare( $wgVersion, '1.19.0', '>' ) ) {
        $GLOBALS['wgAutoloadClasses']['DatabaseOracle'] = 
__DIR__."/db/DatabaseOraclePost120.php";
        $GLOBALS['wgAutoloadClasses']['OracleUpdater']  = 
__DIR__."/db/OracleUpdater.php";
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 7728971..10293b3 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -32,6 +32,10 @@
        die( 1 );
 }
 
+global $wgNamespacesWithSubpages, $wgApiFrameOptions, $wgRSSUrlWhitelist;
+global $wgExternalLinkTarget, $wgCapitalLinkOverrides, $wgRestrictDisplayTitle;
+global $wgUrlProtocols, $wgVerifyMimeType, $wgAllowJavaUploads;
+
 //Default settings needed for BlueSpice
 $wgNamespacesWithSubpages[NS_MAIN] = true;
 $wgApiFrameOptions = 'SAMEORIGIN';
@@ -56,6 +60,9 @@
  * the color will determine a div that is placed above the bs-wrapper
  * with the text element as a headline in it
  */
+
+global $bsgTestSystem, $bsgPermissionConfig, $bsgSystemNamespaces;
+global $bsgConfigFiles, $wgResourceLoaderLESSVars, $bsgExtensions;
 $bsgTestSystem = false;
 
 $bsgPermissionConfig = array(
diff --git a/includes/Defines.php b/includes/Defines.php
index 7b1c944..820a291 100644
--- a/includes/Defines.php
+++ b/includes/Defines.php
@@ -22,6 +22,7 @@
        define('BSDATADIR',   BSROOTDIR . DS . 'data'); //Present
 
        //New constants
+       global $IP;
        $sTMPUploadDir  = empty($wgUploadDirectory)    ? $IP . DS . 'images'    
       : $wgUploadDirectory;
        $sTMPCacheDir   = empty($wgFileCacheDirectory) ? $sTMPUploadDir . DS . 
'cache' : $wgFileCacheDirectory;
        $sTMPUploadPath = empty($wgUploadPath) ?  "$wgScriptPath/images" : 
$wgUploadPath;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5681025f946e6ff460d8a28e23e6af91fbfdd0a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation
Gerrit-Branch: master
Gerrit-Owner: Ljonka <l.verhovs...@gmail.com>

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

Reply via email to