diff options
Diffstat (limited to 'lib/private/Template/SCSSCacher.php')
-rw-r--r-- | lib/private/Template/SCSSCacher.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php index 433d5e5d0bf..0f5be9643b4 100644 --- a/lib/private/Template/SCSSCacher.php +++ b/lib/private/Template/SCSSCacher.php @@ -39,6 +39,7 @@ use OCP\Files\NotPermittedException; use OCP\Files\SimpleFS\ISimpleFile; use OCP\Files\SimpleFS\ISimpleFolder; use OCP\ICache; +use OCP\ICacheFactory; use OCP\IConfig; use OCP\ILogger; use OCP\IURLGenerator; @@ -69,6 +70,9 @@ class SCSSCacher { /** @var null|string */ private $injectedVariables; + /** @var ICacheFactory */ + private $cacheFactory; + /** * @param ILogger $logger * @param Factory $appDataFactory @@ -76,7 +80,7 @@ class SCSSCacher { * @param IConfig $config * @param \OC_Defaults $defaults * @param string $serverRoot - * @param ICache $depsCache + * @param ICacheFactory $cacheFactory */ public function __construct(ILogger $logger, Factory $appDataFactory, @@ -84,14 +88,15 @@ class SCSSCacher { IConfig $config, \OC_Defaults $defaults, $serverRoot, - ICache $depsCache) { + ICacheFactory $cacheFactory) { $this->logger = $logger; $this->appData = $appDataFactory->get('css'); $this->urlGenerator = $urlGenerator; $this->config = $config; $this->defaults = $defaults; $this->serverRoot = $serverRoot; - $this->depsCache = $depsCache; + $this->cacheFactory = $cacheFactory; + $this->depsCache = $cacheFactory->createDistributed('SCSS-' . md5($this->urlGenerator->getBaseUrl())); } /** @@ -263,7 +268,7 @@ class SCSSCacher { */ public function resetCache() { $this->injectedVariables = null; - $this->depsCache->clear(); + $this->cacheFactory->createDistributed('SCSS-')->clear(); $appDirectory = $this->appData->getDirectoryListing(); foreach ($appDirectory as $folder) { foreach ($folder->getDirectoryListing() as $file) { |