AssetPackager for CakePHP

By Brad Daily (bdaily)
Multiple javascript and CSS files simplify things in development, but in production they can begin to adversely affect your page loading times. With AssetPackager for CakePHP, we can have the best of both worlds by allowing multiple files during development and combining and compressing those files for deployment.

 

Comments 490

CakePHP Team Comments Author Comments
 

Comment

1 change if using bleeding edge 1.2


Brad

I've used this successfully for quite some time - works great for me. I've started qualifying the newer pre Beta (6025) cake and asset_packager now flags up a warning

Notice (8): Use of undefined constant DEBUG - assumed 'DEBUG' [APP/vendors/asset_packager/asset_helper.php, line 53]
Users on the bleeding edge will need to update the asset packager files with a simple fix....

39c39
< if (DEBUG == 0) {
---
> if (Configure::read('debug') == 0) {
53c53
< if (DEBUG == 0) {
---
> if (Configure::read('debug') == 0) {
Posted Nov 19, 2007 by Howard Glynn
 

Comment

2 Underscores and errors if asset config is not there

In the clean function i would also change:
include($this->jsPath . DS . '_asset_config.php');
and:
include($this->cssPath . DS . '_asset_config.php');

to:

@include($this->jsPath . DS . '_asset_config.php');
and:
@include($this->cssPath . DS . '_asset_config.php');

Also, please not that the shell does _not_ support underscores in the clean function!!!
Posted Aug 29, 2008 by Marius van Witzenburg
 

Comment

3 I may not update my own comment. thats too bad

In the clean function i would also change:
include($this->jsPath . DS . '_asset_config.php');
and:
include($this->cssPath . DS . '_asset_config.php');

to:

@include($this->jsPath . DS . '_asset_config.php');
and:
@include($this->cssPath . DS . '_asset_config.php');

Also, please not that the shell does _not_ support underscores in the clean function!!!

*** UPDATE ***:

New version here:

http://www.kitara.nl/caketools/AssetPackager_for_CakePHP.zip
Fixed the following:
- New version of jsmin from 1.1.0 to 1.1.1
- Underscore support
- Include errors
Posted Aug 29, 2008 by Marius van Witzenburg
 

Comment

4 Manual

Posted Aug 30, 2008 by Marius van Witzenburg
 

Comment

5 Awesome!

good, thanks for your hard job, now i wondering A pair of jordan shoes or ugg boots?
Posted May 13, 2009 by turen
 

Comment

6 Thank you very much.

Thank you very much. Exactly I needed this information. Club Penguin
Posted Jun 9, 2009 by john mish