Make base font repository path configurable via $wgULSFontRepositoryBasePath
This patch adds a configuration variable, '$wgULSFontRepositoryBasePath', which specifies the base path to the font repository. By default, the variable is set to its existing value, which is $wgExtensionAssetsPath + '/UniversalLanguageSelector/data/fontrepo/fonts/'. However, adding a discrete configuration variable makes it possible to configure ULS to use a custom URL scheme that is more suitable for large static assets that change infrequently. Change-Id: Idbe57072c4f3258757eb691e54cab5429cadcfda
This commit is contained in:
@@ -256,7 +256,8 @@ class UniversalLanguageSelectorHooks {
|
||||
*/
|
||||
public static function addConfig( &$vars ) {
|
||||
global $wgULSGeoService, $wgULSIMEEnabled, $wgULSPosition, $wgULSNoWebfontsSelectors,
|
||||
$wgULSAnonCanChangeLanguage, $wgULSEventLogging, $wgULSNoImeSelectors;
|
||||
$wgULSAnonCanChangeLanguage, $wgULSEventLogging, $wgULSNoImeSelectors,
|
||||
$wgULSFontRepositoryBasePath, $wgExtensionAssetsPath;
|
||||
|
||||
// Place constant stuff here (not depending on request context)
|
||||
if ( is_string( $wgULSGeoService ) ) {
|
||||
@@ -269,6 +270,13 @@ class UniversalLanguageSelectorHooks {
|
||||
$vars['wgULSNoImeSelectors'] = $wgULSNoImeSelectors;
|
||||
$vars['wgULSNoWebfontsSelectors'] = $wgULSNoWebfontsSelectors;
|
||||
|
||||
if ( is_string( $wgULSFontRepositoryBasePath ) ) {
|
||||
$vars['wgULSFontRepositoryBasePath'] = $wgULSFontRepositoryBasePath;
|
||||
} else {
|
||||
$vars['wgULSFontRepositoryBasePath'] = $wgExtensionAssetsPath .
|
||||
'/UniversalLanguageSelector/data/fontrepo/fonts/';
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user