File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 2525
2626namespace SCSS ;
2727
28- use BagOStuff ;
2928use CSSJanus ;
3029use Exception ;
30+ use MediaWiki \MediaWikiServices ;
3131use MediaWiki \ResourceLoader \Context ;
3232use MediaWiki \ResourceLoader \FileModule ;
3333use MediaWiki \ResourceLoader \FilePath ;
34- use ObjectCache ;
34+ use ObjectCacheFactory ;
3535use ScssPhp \ScssPhp \Compiler ;
36+ use Wikimedia \ObjectCache \BagOStuff ;
3637
3738/**
3839 * ResourceLoader module based on local JavaScript/SCSS files.
@@ -138,12 +139,16 @@ protected function retrieveStylesFromCache( Context $context ): void {
138139
139140 protected function getCache (): BagOStuff {
140141 if ( $ this ->cache === null ) {
141- $ this ->cache = ObjectCache:: getInstance ( $ this ->getCacheType () );
142+ $ this ->cache = $ this -> getObjectCacheFactory ()-> getInstance ( $ this ->getCacheType () );
142143 }
143144
144145 return $ this ->cache ;
145146 }
146147
148+ private function getObjectCacheFactory (): ObjectCacheFactory {
149+ return MediaWikiServices::getInstance ()->getObjectCacheFactory ();
150+ }
151+
147152 private function getCacheType (): int {
148153 return array_key_exists ( 'egScssCacheType ' , $ GLOBALS ) ? (int )$ GLOBALS [ 'egScssCacheType ' ] : -1 ;
149154 }
@@ -168,7 +173,7 @@ protected function getCacheKey( Context $context ): string {
168173 // have to hash the module config, else it may become too long
169174 $ configHash = md5 ( $ styles . $ vars );
170175
171- $ this ->cacheKey = ObjectCache:: getLocalClusterInstance ()->makeKey (
176+ $ this ->cacheKey = $ this -> getObjectCacheFactory ()-> getLocalClusterInstance ()->makeKey (
172177 'ext ' ,
173178 'scss ' ,
174179 $ configHash ,
You can’t perform that action at this time.
0 commit comments