diff options
author | daniel <dkinzler@wikimedia.org> | 2021-12-13 00:04:04 +0100 |
---|---|---|
committer | daniel <dkinzler@wikimedia.org> | 2022-01-18 21:51:35 +0100 |
commit | da99bcd6aa195cb2e0aea3a30188143080700976 (patch) | |
tree | 1260dfd26d7c2218f23ac53153d45a371abe3084 /includes/Settings/Cache | |
parent | 22ece356e49cb6bd1a884a4d4a59ec0f00f5dcc5 (diff) | |
download | mediawikicore-da99bcd6aa195cb2e0aea3a30188143080700976.tar.gz mediawikicore-da99bcd6aa195cb2e0aea3a30188143080700976.zip |
SettingsBuilder: load settings recursively
Allows settings files to include other settings files.
Change-Id: Ieab7def1ada8b255e60c58927850a58e18309f6e
Diffstat (limited to 'includes/Settings/Cache')
-rw-r--r-- | includes/Settings/Cache/CachedSource.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/includes/Settings/Cache/CachedSource.php b/includes/Settings/Cache/CachedSource.php index c840636440ad..7e1cf55f29d1 100644 --- a/includes/Settings/Cache/CachedSource.php +++ b/includes/Settings/Cache/CachedSource.php @@ -3,6 +3,7 @@ namespace MediaWiki\Settings\Cache; use BagOStuff; +use MediaWiki\Settings\Source\SettingsIncludeLocator; use MediaWiki\Settings\Source\SettingsSource; /** @@ -11,7 +12,7 @@ use MediaWiki\Settings\Source\SettingsSource; * @since 1.38 * @todo mark as stable before the 1.38 release */ -class CachedSource implements SettingsSource { +class CachedSource implements SettingsSource, SettingsIncludeLocator { /** @var BagOStuff */ private $cache; @@ -115,4 +116,13 @@ class CachedSource implements SettingsSource { 'generation' => $finish - $start, ]; } + + public function locateInclude( string $location ): string { + if ( $this->source instanceof SettingsIncludeLocator ) { + return $this->source->locateInclude( $location ); + } else { + // Just return the location as-is + return $location; + } + } } |