admin管理员组

文章数量:1357276

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

I want to minify/press/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!

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

I want to minify/press/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!

Share Improve this question asked Apr 14, 2011 at 8:51 Jatin DhootJatin Dhoot 4,3649 gold badges42 silver badges59 bronze badges
Add a ment  | 

5 Answers 5

Reset to default 4

Try Minify I have used it in several ZF projects. Just install it in /public_html/min it will then minify and press 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.

We wrote a shell script that runs all the files through YUI pressor and then bundle them all together. It may look plex initially but it's not. This script ended up being our one-mand-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.

As Mic suggest ,its very good to YUI + Shell mand 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./speed/page-speed/docs/filter-js-minify.html

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

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

Mic suggestion is nice, but for me it is much easier to use management/build tool like maven.apache (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.

本文标签: javascriptZend Framework CSSJS minifierobfuscatorStack Overflow