sfMinifyTSPlugin
0.2.1beta
for sf 1.2 MIT
Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads.
It names the combined, minified files based on the modification time of each component file, so editing CSS or JavaScript files will cause a new combined version to be created automatically. This makes it easier to set far-future expiry dates on assets.
Based on sfMinifyPlugin by Gordon Franke. Adds support for unique file names based on modification times of combined files.
Developers
| Name |
Status |
Email |
Ally B |
lead |
moc.elpmaxe <<ta>> elpmaxe
|
License
Copyright (c) 1982, 1986, 1990, 1991, 1993
The Regents of the University of California. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software must display the following acknowledgement: “This product includes software developed by the University of California, Berkeley and its contributors.â€
4. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS†AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Releases for sf 1.2
| Version |
License |
API |
Released |
|
0.2.1beta
|
MIT license |
0.2.0beta
|
10/07/2009 |
|
0.2.0beta
|
MIT license |
0.2.0beta
|
03/06/2009 |
|
0.1.0beta
|
MIT license |
0.1.0beta
|
28/05/2009 |
Changelog for release 0.2.1 - 10/07/2009
Added support for configuring the name of the cache directory web path. This is useful if you want to conceal your use of symfony and this plugin. Also fixed an issue with selectively disabling the compression of either js or css.
Other releases
Release 0.2.1 - 10/07/2009
Added support for configuring the name of the cache directory web path. This is useful if you want to conceal your use of symfony and this plugin. Also fixed an issue with selectively disabling the compression of either js or css.
Release 0.2.0 - 03/06/2009
Fixed issues with the filter not working correctly, and it not being possible to disable the plugin easily.
Release 0.1.0 - 28/05/2009
First release. Based on sfMinifyPlugin - 1.2.4 by Gordon Franke.
sfMinify plugin
Integrates the minify library see http://code.google.com/p/minify/ into symfony.
Overview
Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads.
Names the combined, minified files based on the modification time of each component file,
so editing CSS or JavaScript files will cause a new combined version to be created
automatically. This makes it easier to set far-future expiry dates on assets.
Based on sfMinifyPlugin by Gordon Franke. Adds support for unique file names based on
modification times of combined files.
Usage
- create a symlink in your web directory pointing to
plugins/sfMinifyTSPlugin/web/ or run symfony plugin:publish-assets
- clear the symfony cache with
symfony cc
- then run
symfony minify:permissions
Filter or Helper
you can activate minify over as a filter or with helpers
change the common filter in your filters.yml to
common:
class: sfMinifyTSFilter # Filter class
param:
javascripts: true
stylesheets: true
or add/change the helper in your layout file (default layout.php) to
use_helper('SfMinifyTS');
minify_include_javascripts();
minify_include_stylesheets();
Configuration
you can enable and disable javascript or stylesheet minify by setting the params in filter.yml by default both types will be minified. You can also optionally create an alias to the cache path directory if you want to conceal your use of this plugin. Create a directory alias in your apache config file, e.g.:
[plain]
# an alias for the minify cache directory
Alias /cache /var/www/html/mysite/web/sfMinifyTSPlugin/cache
then add an extra parameter to your filters.yml file, cache_dir:
[plain]
common:
class: sfMinifyTSFilter # Filter class
param:
javascripts: true
stylesheets: true
cache_dir: /cache/ # must have leading and trailing slashes
All compressed files will then be created in the the usual web/sfMinifyTSPlugin/cache directory, but will be served from /cache
Compression
to compress the files simply set the compressed option to on in settings.yml
[plain]
all:
.settings:
compressed: on
Tasks
This package provides 2 tasks:
minify:clear-cache - extends the default symfony clear-cache task to clear the minify cache directory as well. It also adds a new type minify to only clear the minify cache.
minify:fix-permissions - fixes the permissions on the minify cache directory to make it world-writeable