Author: ornicar2
Date: 2010-02-11 01:21:29 +0100 (Thu, 11 Feb 2010)
New Revision: 27874
Modified:
plugins/diemPlugin/trunk/dmCorePlugin/lib/response/asset/compressor/dmStylesheetCompressor.php
Log:
[Diem]
- now stylesheets containing @import are never cached
Modified:
plugins/diemPlugin/trunk/dmCorePlugin/lib/response/asset/compressor/dmStylesheetCompressor.php
===================================================================
---
plugins/diemPlugin/trunk/dmCorePlugin/lib/response/asset/compressor/dmStylesheetCompressor.php
2010-02-11 00:13:16 UTC (rev 27873)
+++
plugins/diemPlugin/trunk/dmCorePlugin/lib/response/asset/compressor/dmStylesheetCompressor.php
2010-02-11 00:21:29 UTC (rev 27874)
@@ -14,12 +14,25 @@
protected function isCachable($stylesheet, array $options = array())
{
+ // don't cache user asset if it's protected
if($this->options['protect_user_assets'] && strncmp($stylesheet, '/dm', 3)
!== 0)
{
return false;
}
-
- return !isset($options['condition']);
+
+ // don't cache stylesheet if included with any condition
+ if(isset($options['condition']))
+ {
+ return false;
+ }
+
+ // don't cache stylesheet if it contains an @import rule
+ if(false !==
strpos(file_get_contents(sfConfig::get('sf_web_dir').$stylesheet), '@import'))
+ {
+ return false;
+ }
+
+ return true;
}
protected function processCacheKey($cacheKey)
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.