summaryrefslogtreecommitdiffstats
path: root/lib/private/Template
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-12-07 01:27:49 +0100
committerRobin Appelman <robin@icewind.nl>2018-12-07 01:27:49 +0100
commit20519434879dd0ee9278d0871d92e9c11295adfd (patch)
treebbf6bfa0e2adc544edadc604075325be822bd9e4 /lib/private/Template
parent43cb51d374421cca2bef3008b3adad9d9668a726 (diff)
downloadnextcloud-server-20519434879dd0ee9278d0871d92e9c11295adfd.tar.gz
nextcloud-server-20519434879dd0ee9278d0871d92e9c11295adfd.zip
more caching for theming
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Template')
-rw-r--r--lib/private/Template/IconsCacher.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/Template/IconsCacher.php b/lib/private/Template/IconsCacher.php
index aab3295405d..0d838c4d06d 100644
--- a/lib/private/Template/IconsCacher.php
+++ b/lib/private/Template/IconsCacher.php
@@ -58,6 +58,9 @@ class IconsCacher {
private $iconList = 'icons-list.template';
+ private $cachedCss;
+ private $cachedList;
+
/**
* @param ILogger $logger
* @param Factory $appDataFactory
@@ -137,6 +140,8 @@ class IconsCacher {
$cachedVarsCssFile->putContent($data);
$list = ":root {\n$list\n}";
$cachedFile->putContent($list);
+ $this->cachedList = null;
+ $this->cachedCss = null;
}
return preg_replace($this->iconVarRE, '', $css);
@@ -204,7 +209,10 @@ class IconsCacher {
*/
public function getCachedCSS() {
try {
- return $this->folder->getFile($this->fileName);
+ if (!$this->cachedCss) {
+ $this->cachedCss = $this->folder->getFile($this->fileName);
+ }
+ return $this->cachedCss;
} catch (NotFoundException $e) {
return false;
}
@@ -216,7 +224,10 @@ class IconsCacher {
*/
public function getCachedList() {
try {
- return $this->folder->getFile($this->iconList);
+ if (!$this->cachedList) {
+ $this->cachedList = $this->folder->getFile($this->iconList);
+ }
+ return $this->cachedList;
} catch (NotFoundException $e) {
return false;
}