. * * @file * @ingroup Skins * * @codeCoverageIgnore */ call_user_func( function () { if ( !defined( 'MEDIAWIKI' ) ) { die( 'This file is part of a MediaWiki extension, it is not a valid entry point.' ); } if ( !defined( 'BS_VERSION' ) ) { die( 'Error: The Chameleon skin depends on the Bootstrap extension. You need to install the Bootstrap extension first.' ); } // define the skin's version define( 'CHAMELEON_VERSION', '1.7.1' ); // set credits $GLOBALS[ 'wgExtensionCredits' ][ 'skin' ][ ] = array( 'path' => __FILE__, 'name' => 'Chameleon', 'descriptionmsg' => 'chameleon-desc', 'author' => '[https://www.mediawiki.org/wiki/User:F.trott Stephan Gambke]', 'url' => 'https://www.mediawiki.org/wiki/Skin:Chameleon', 'version' => CHAMELEON_VERSION, 'license-name' => 'GPL-3.0+', ); // register skin $GLOBALS[ 'wgValidSkinNames' ][ 'chameleon' ] = 'Chameleon'; // register message file for i18n $GLOBALS[ 'wgExtensionMessagesFiles' ][ 'Chameleon' ] = __DIR__ . '/Chameleon.i18n.php'; $GLOBALS[ 'wgMessagesDirs' ][ 'Chameleon' ] = __DIR__ . '/resources/i18n'; /** * Using callbacks for hook registration * * The hook registry should contain as less knowledge about a process as * necessary therefore a callback is used as Factory/Builder that instantiates * a business / domain object. * * GLOBAL state should be encapsulated by the callback and not leaked into * a instantiated class */ /** * @see https://www.mediawiki.org/wiki/Manual:Hooks/BeforeInitialize */ $GLOBALS[ 'wgHooks' ][ 'SetupAfterCache' ][ ] = function() { $setupAfterCache = new \Skins\Chameleon\Hooks\SetupAfterCache( \Bootstrap\BootstrapManager::getInstance(), $GLOBALS, $GLOBALS['wgRequest'] ); $setupAfterCache->process(); }; // set default skin layout $GLOBALS[ 'egChameleonLayoutFile' ] = dirname( __FILE__ ) . '/layouts/standard.xml'; // enable the VisualEditor for this skin $GLOBALS[ 'egChameleonEnableVisualEditor' ] = true; } );