Zend Framework CSS / JS minifier -obfuscator?

I am working on a project that contains more than 10 CSS + JS files.

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

One approach is that I can do it manually.

But besides manual effort, is there any function / method in the Zend Framework to achieve this?

Thanks in advance!

+4
source share
5 answers

We wrote a shell script that runs all the files through the YUI compressor , and then binds them all together. It may look complicated at first, but it is not. This script turned out to be our one-command deployment for our application.

This shell has many other features specific to our internal architecture (git, Erlang, ...), so I cannot easily extract this specific part. But yahoo doc is well done.

+2
source

Try Minify. I have used it in several ZF projects. Just set it to / public _html / min, after which it minimizes and compresses css and javascript on the fly and has a cache function. In general, the performance is very good, and the script has a small area.

+4
source

As Mic suggests, a very good YUI + Shell team, and I can add another sentence outside the ZF field google pagepeed mod has many filters, which can easily achieve your goals.

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

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

0
source

Not tried yet, but bundle-phu is what you are looking for.

0
source

Mic's suggestion is good, but it’s much easier for me to use a control / build tool like maven.apache.org (for php ) to make this stuff and much more necessary automation (like testing). And I use my own tool for js obfuscation cactus , which can be used as a separate console tool or the maven plugin.

0
source

Source: https://habr.com/ru/post/1348055/


All Articles