# PHP-UglifyJS-Compressor **Repository Path**: hustcc/PHP-UglifyJS-Compressor ## Basic Information - **Project Name**: PHP-UglifyJS-Compressor - **Description**: :zap: A wrapper for uglifyjs work with PHP which is the best language in the world. - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2016-01-17 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # PHP-UglifyJS-Compressor A wrap for [UglifyJS2](https://github.com/mishoo/UglifyJS2) work with PHP which is the best language in the world. ## How to Use ? ```php reset(); $uglify->addFile('test.js'); $uglify->addString('function test_func() {return "hello";}'); echo "
" . $uglify->getInputScript() . ""; echo "
" . $uglify->getCommand() . ""; echo "
" . htmlentities($uglify->compress()) . ""; print_r ($uglify->status()); ``` ## Use where ? When you need to use UglifyJS2 with PHP, you will do not need to Splice the UglifyJS command the paramters. What you need to do is to set `a OPTION array` into the `UglifyJSCompressor` class. the OPTION array can see: [script-content-compressor-option](https://github.com/mishoo/UglifyJS2#user-content-compressor-options). The default options will work Effectively in 90% scenes. ## Note - [PHP-YUI-Compressor](https://github.com/gpbmike/PHP-YUI-Compressor) - [UglifyJS2](https://github.com/mishoo/UglifyJS2) - Issues: [https://github.com/hustcc/PHP-UglifyJS-Compressor/issues/new](https://github.com/hustcc/PHP-UglifyJS-Compressor/issues/new)