Permalink
Browse files

Merge branch 'develop'

  • Loading branch information...
Keith Loy
Keith Loy committed Mar 21, 2012
2 parents 7eee457 + 2f6931e commit c07337faec78afe7aca2b668e980c8602a70c977
Showing with 22 additions and 34 deletions.
  1. +19 −29 src/Assetix/Compiler.php
  2. +3 −5 src/Assetix/Filter/MyCssRewriteFilter.php
View
@@ -78,14 +78,8 @@ public function css($group = '', $files = array(), $is_ie = false)
$assets = array('@'.$group);
$filters = array();
$filters[] = 'less';
- if ($is_ie === true or $this->_is_debug() === true)
- {
- $filters[] = 'css_rewrite';
- }
- else
- {
- $filters[] = 'css_embed';
- }
+ $is_ie === false and $filters[] = '?css_embed';
+ $filters[] = 'css_rewrite';
return $this->_render($assets, $filters);
}
@@ -98,14 +92,8 @@ public function less($group = '', $files = array(), $is_ie = false)
$assets = array('@'.$group);
$filters = array();
$filters[] = 'less';
- if ($is_ie === true or $this->_is_debug() === true)
- {
- $filters[] = 'css_rewrite';
- }
- else
- {
- $filters[] = 'css_embed';
- }
+ $is_ie === false and $filters[] = '?css_embed';
+ $filters[] = 'css_rewrite';
return $this->_render($assets, $filters);
}
@@ -118,14 +106,8 @@ public function styl($group = '', $files = array(), $is_ie = false)
$assets = array('@'.$group);
$filters = array();
$filters[] = 'styl';
- if ($is_ie === true or $this->_is_debug() === true)
- {
- $filters[] = 'css_rewrite';
- }
- else
- {
- $filters[] = 'css_embed';
- }
+ $is_ie === false and $filters[] = '?css_embed';
+ $filters[] = 'css_rewrite';
return $this->_render($assets, $filters);
}
@@ -295,16 +277,16 @@ protected function _get_fm()
protected function _setup_filters()
{
$config = $this->_get_config();
- $this->_add_filter('yui_js', new Yui\JsCompressorFilter($config['yuicompressor_path']));
+
+ // Stylesheet filters
$less = new LessFilter($config['node_path'], $config['node_paths']);
$styl = new StylusFilter($config['node_path'], $config['node_paths']);
+ // Enable compression
if ($this->_is_debug() === false)
{
$less->setCompress(true);
$styl->setCompress(true);
}
- $this->_add_filter('css_rewrite', new MyCssRewriteFilter(
- $config['css_rewrite_replacement'], $config['css_rewrite_pattern']));
$this->_add_filter('less', $less);
$this->_add_filter('styl', $styl);
$css_embed = new CssEmbedFilter($config['cssembed_path']);
@@ -315,11 +297,19 @@ protected function _setup_filters()
$css_embed->setMhtml(false);
$css_embed->setCharset('utf8');
$this->_add_filter('css_embed', $css_embed);
- $this->_add_filter('underscore', new UnderscoreFilter(
- $config['underscore_namespace']), $config['underscore_ext']);
+ $css_rewrite = new MyCssRewriteFilter($config['css_rewrite_replacement'],
+ $config['css_rewrite_pattern']);
+ $this->_add_filter('css_rewrite', $css_rewrite);
+
+ // Javascript filters
+ $this->_add_filter('yui_js', new Yui\JsCompressorFilter($config['yuicompressor_path']));
$this->_add_filter('coffee', new CoffeeScriptFilter(
$config['coffee_path'], $config['node_path']));
+
+ // Javascript template filters
$this->_add_filter('handlebars', new HandlebarsFilter(
$config['handlebars_path'], $config['node_path']));
+ $this->_add_filter('underscore', new UnderscoreFilter(
+ $config['underscore_namespace']), $config['underscore_ext']);
}
}
@@ -41,7 +41,9 @@ public function __construct($replacement = '\\1/assets/production/', $pattern =
$this->pattern = $pattern;
}
- public function filterLoad(AssetInterface $asset)
+ public function filterLoad(AssetInterface $asset){}
+
+ public function filterDump(AssetInterface $asset)
{
$replacement = $this->getReplacement();
$pattern = $this->getPattern();
@@ -51,10 +53,6 @@ public function filterLoad(AssetInterface $asset)
$asset->setContent($content);
}
- public function filterDump(AssetInterface $asset)
- {
- }
-
public function setReplacement($replacement)
{
$this->replacement = $replacement;

0 comments on commit c07337f

Please sign in to comment.