Author: rande Date: 2010-03-28 18:00:08 +0200 (Sun, 28 Mar 2010) New Revision: 28835
Modified: plugins/swCombinePlugin/trunk/CREDITS plugins/swCombinePlugin/trunk/README plugins/swCombinePlugin/trunk/lib/driver/javascript/swDriverJSMin.class.php plugins/swCombinePlugin/trunk/lib/driver/stylesheet/swDriverMinifyCssCompressor.class.php Log: [swCombinePlugin] fixed name classes, update documentation Modified: plugins/swCombinePlugin/trunk/CREDITS =================================================================== --- plugins/swCombinePlugin/trunk/CREDITS 2010-03-28 13:53:52 UTC (rev 28834) +++ plugins/swCombinePlugin/trunk/CREDITS 2010-03-28 16:00:08 UTC (rev 28835) @@ -1,5 +1,9 @@ CREDITS +The combine section is taken from sfCombinePlugin from Alexandre Mogère and François Zaninotto + + more information : http://www.symfony-project.org/plugins/sfCombinePlugin + The driver section is a fork of npAssetsOptimizerPlugin from Nicolas Perriault -more information : http://www.symfony-project.org/plugins/npAssetsOptimizerPlugin \ No newline at end of file + more information : http://www.symfony-project.org/plugins/npAssetsOptimizerPlugin \ No newline at end of file Modified: plugins/swCombinePlugin/trunk/README =================================================================== --- plugins/swCombinePlugin/trunk/README 2010-03-28 13:53:52 UTC (rev 28834) +++ plugins/swCombinePlugin/trunk/README 2010-03-28 16:00:08 UTC (rev 28835) @@ -5,6 +5,7 @@ ## How it works ? The plugin read all view.yml files and generates the correct combined files : + - stylesheets - javascript @@ -12,11 +13,22 @@ ## Benefits - - Combine files and optimizations are when you deploy the application + - Combine files and optimizations are performed when the application is deployed - The view cache file generates the correct path to the combined files, so there is not computation at runtime. ## Available optimizers + - Global + - swPassDriver : do nothing, use this if you want to combine your files with no optizations + + - Javascript + - swDriverGoogleClosureCompilerApi : use google closure algorithm + - swDriverJSMin : use JSMin algorithm + - swDriverJSMinPlus : user JSMin+ algorithm + + - Stylesheet + - swDriverCssmin : use Css min algorithm + - swDriverMinifyCssCompressor : use Minify Css Compressor algorithm ## Install @@ -102,12 +114,46 @@ - /css/draft/ui-theme.css - /css/mg-theme.css - - * clear your cache + * clear your cache + ./symfony cc - - * combine css and js with + + * combine css and js with ./symfony sw:combine frontend - ./symfony sw:combine backend \ No newline at end of file + ./symfony sw:combine backend + + +## Assets version (optional) + +This plugin has a hidden gem : asset versioning. When css files are combined, a version number is added to all externals references. This feature must be use with helper functions `sw_include_stylesheets()` and `sw_include_javascripts()`, this two helpers add the version number on each declared assets. + +The asset version format is : ASSET_FILE?_sw=ASSET_VERSION + +### What does it mean ? + +You can configure a long time expired value on your server by using simple regular expression. + + (.*)\?_sw=(.*) => expired in 1 month. + +Doing so, the user agent will not do any extras requests to the webserver. + +### Defining the asset version + + * edit your app.yml file by adding these lines + + [yml] + swToolbox: + swCombine: + version: 42 + + + * clear your cache + + ./symfony cc + + * regenerate the combined css and js files with + + ./symfony sw:combine frontend + ./symfony sw:combine backend \ No newline at end of file Modified: plugins/swCombinePlugin/trunk/lib/driver/javascript/swDriverJSMin.class.php =================================================================== --- plugins/swCombinePlugin/trunk/lib/driver/javascript/swDriverJSMin.class.php 2010-03-28 13:53:52 UTC (rev 28834) +++ plugins/swCombinePlugin/trunk/lib/driver/javascript/swDriverJSMin.class.php 2010-03-28 16:00:08 UTC (rev 28835) @@ -6,7 +6,7 @@ * @subpackage driver * @author Nicolas Perriault <[email protected]> */ -class swDriverJSMin extends npDriverBase +class swDriverJSMin extends swDriverBase { public function doProcessFile($file, $replace = false) { Modified: plugins/swCombinePlugin/trunk/lib/driver/stylesheet/swDriverMinifyCssCompressor.class.php =================================================================== --- plugins/swCombinePlugin/trunk/lib/driver/stylesheet/swDriverMinifyCssCompressor.class.php 2010-03-28 13:53:52 UTC (rev 28834) +++ plugins/swCombinePlugin/trunk/lib/driver/stylesheet/swDriverMinifyCssCompressor.class.php 2010-03-28 16:00:08 UTC (rev 28835) @@ -8,7 +8,7 @@ * * @see http://minify.googlecode.com/svn/trunk/min/lib/Minify/CSS/Compressor.php */ -class npDriverMinifyCssCompressor extends npDriverBase +class swDriverMinifyCssCompressor extends swDriverBase { public function doProcessFile($file, $replace = false) { -- 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.
