Jatin Dhoot
Jatin Dhoot

Reputation: 4364

Zend Framework CSS / JS minifier-obfuscator?

I am working on project which is having more than 10 CSS + JS files.

I want to minify/compress/obfuscate CSS and JS.

One approach is I can do this manually.

But apart from manual effort is there any function/method available in Zend Framework to achieve this goal?

Thanks in advance!

Upvotes: 4

Views: 3729

Answers (5)

babinik
babinik

Reputation: 648

Mic suggestion is nice, but for me it is much easier to use management/build tool like maven.apache.org (for php) to do this stuff and a much more required automation (for instance testing). And I'm using self written tool for js obfuscation cactus, which can be used as separate console tool as well as maven plugin.

Upvotes: 0

Cobby
Cobby

Reputation: 5454

Haven't tried it yet, but bundle-phu is probably what you are looking for.

Upvotes: 0

Adam Pointer
Adam Pointer

Reputation: 1492

Try Minify I have used it in several ZF projects. Just install it in /public_html/min it will then minify and compress css and javascript on the fly and has a cache feature. On the whole the peformance is very good and the script has a small footprint.

Upvotes: 4

tawfekov
tawfekov

Reputation: 5122

As Mic suggest ,its very good to YUI + Shell command and i can add another suggestion outside of ZF field google pagespeed mod has many filter than can achieve your goals easily

http://code.google.com/speed/page-speed/docs/filter-js-minify.html

http://code.google.com/speed/page-speed/docs/filter-css-rewrite.html

Upvotes: 0

Mic
Mic

Reputation: 25154

We wrote a shell script that runs all the files through YUI compressor and then bundle them all together. It may look complex initially but it's not. This script ended up being our one-command-deployment for our app.

This shell does plenty of other thing specific to our backend architecture(git, Erlang,...) so I can't extract this specific part easily. But Yahoo's doc is well done.

Upvotes: 2

Related Questions