diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-03-09 23:25:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 23:25:17 +0100 |
commit | 6fd0e7e93995facfe75b26699ea462bb94fd03b9 (patch) | |
tree | 2584a8e55ceabcdc182df849d0c292041ab2c113 /lib | |
parent | db5fc4d3cbff68055d338f91bef44572b6c44fa6 (diff) | |
parent | 0c22a6696703225baabd6a4afaad5759745da8c5 (diff) | |
download | nextcloud-server-6fd0e7e93995facfe75b26699ea462bb94fd03b9.tar.gz nextcloud-server-6fd0e7e93995facfe75b26699ea462bb94fd03b9.zip |
Merge pull request #3791 from nextcloud/combine_sass
Combine sass
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Template/SCSSCacher.php | 21 | ||||
-rw-r--r-- | lib/private/legacy/template.php | 12 |
2 files changed, 19 insertions, 14 deletions
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php index d6f5a2c6fd3..744ea80761e 100644 --- a/lib/private/Template/SCSSCacher.php +++ b/lib/private/Template/SCSSCacher.php @@ -103,10 +103,17 @@ class SCSSCacher { private function isCached($fileNameCSS, $fileNameSCSS, ISimpleFolder $folder, $path) { try{ $cachedFile = $folder->getFile($fileNameCSS); - if( $cachedFile->getMTime() > filemtime($path.'/'.$fileNameSCSS) - && $cachedFile->getSize() > 0 ) { - return true; + if ($cachedFile->getSize() > 0) { + $depFile = $folder->getFile($fileNameCSS . '.deps'); + $deps = json_decode($depFile->getContent(), true); + + foreach ($deps as $file=>$mtime) { + if (!file_exists($file) || filemtime($file) > $mtime) { + return false; + } + } } + return true; } catch(NotFoundException $e) { return false; } @@ -140,6 +147,13 @@ class SCSSCacher { $cachedfile = $folder->newFile($fileNameCSS); } + $depFileName = $fileNameCSS . '.deps'; + try { + $depFile = $folder->getFile($depFileName); + } catch (NotFoundException $e) { + $depFile = $folder->newFile($depFileName); + } + // Compile try { $compiledScss = $scss->compile('@import "'.$fileNameSCSS.'";'); @@ -150,6 +164,7 @@ class SCSSCacher { try { $cachedfile->putContent($this->rebaseUrls($compiledScss, $webDir)); + $depFile->putContent(json_encode($scss->getParsedFiles())); $this->logger->debug($webDir.'/'.$fileNameSCSS.' compiled and successfully cached', ['app' => 'core']); return true; } catch(NotFoundException $e) { diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php index 09e3d130f49..8535e018879 100644 --- a/lib/private/legacy/template.php +++ b/lib/private/legacy/template.php @@ -106,19 +106,9 @@ class OC_Template extends \OC\Template\Base { } } - OC_Util::addStyle("tooltip",null,true); OC_Util::addStyle('jquery-ui-fixes',null,true); OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui',null,true); - OC_Util::addStyle("mobile",null,true); - OC_Util::addStyle("multiselect",null,true); - OC_Util::addStyle("fixes",null,true); - OC_Util::addStyle("global",null,true); - OC_Util::addStyle("apps",null,true); - OC_Util::addStyle("fonts",null,true); - OC_Util::addStyle("icons",null,true); - OC_Util::addStyle("header",null,true); - OC_Util::addStyle("inputs"); - OC_Util::addStyle("styles",null,true); + OC_Util::addStyle('server', null, true); // avatars \OC_Util::addScript('jquery.avatar', null, true); |