From: Timo Tijhof Date: Tue, 10 Apr 2018 14:07:18 +0000 (+0100) Subject: resourceloader: Remove deprecated ResourceLoaderGetLessVars hook X-Git-Tag: 1.31.0-rc.0~137^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;ds=sidebyside;h=cec597e2b33272c3114ef09f5c6001d44984af5b;p=lhc%2Fweb%2Fwiklou.git resourceloader: Remove deprecated ResourceLoaderGetLessVars hook Deprecated since 1.30, only had one caller (MobileFrontend) which has been fixed since. Bug: T140804 Change-Id: I39b594e3082ebe321bae463780cfadbfb3de1d5c --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 051f6d02bd..06d2c01a32 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -334,6 +334,9 @@ changes to languages because of Phabricator reports. * HTMLForm & VFormHTMLForm::isVForm(), deprecated in 1.25, have been removed. * The ProfileSection class, deprecated in 1.25 and unused, has been removed. * Wikimedia\Rdbms\SavepointPostgres is deprecated. +* The ResourceLoaderGetLessVars hook, deprecated in 1.30, has been removed. + Use ResourceLoaderModule::getLessVars() to expose local variables instead + of global ones. == Compatibility == MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported, diff --git a/docs/hooks.txt b/docs/hooks.txt index f35d610395..d932148e4d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2795,12 +2795,6 @@ configuration variables to JavaScript. Things that depend on the current page or request state must be added through MakeGlobalVariablesScript instead. &$vars: array( variable name => value ) -'ResourceLoaderGetLessVars': DEPRECATED! Called in ResourceLoader::getLessVars -to add global LESS variables. Loaded after $wgResourceLoaderLESSVars is added. -Global LESS variables are deprecated. Use ResourceLoaderModule::getLessVars() -instead to expose variables only in modules that need them. -&$lessVars: array of variables already added - 'ResourceLoaderJqueryMsgModuleMagicWords': Called in ResourceLoaderJqueryMsgModule to allow adding magic words for jQueryMsg. The value should be a string, and they can depend only on the diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 5ddb99bdc1..90c314068d 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1723,10 +1723,8 @@ MESSAGE; * @return array Map of variable names to string CSS values. */ public function getLessVars() { - if ( !$this->lessVars ) { - $lessVars = $this->config->get( 'ResourceLoaderLESSVars' ); - Hooks::run( 'ResourceLoaderGetLessVars', [ &$lessVars ] ); - $this->lessVars = $lessVars; + if ( $this->lessVars === null ) { + $this->lessVars = $this->config->get( 'ResourceLoaderLESSVars' ); } return $this->lessVars; }