使用php对js进行混淆加密,具体方法如下:
//js路径
$jsPath = __DIR__.'/assets/js/*';
//不需要压缩的JS
$exclude = array(
'jQuery.ui.position.min.js',
'easy_validator.pack.js',
'easydialog.min.js',
'jquery.ad-gallery.js',
'jquery.autocomplete.js',
'jquery.bgiframe.min.js',
'jquery.fancybox-1.3.4.pack.js',
'jquery.min.js',
'jquery.mousewheel-3.0.4.pack.js',
'jquery.uploadify.js',
'jquery.validationEngine-zh_CN.js',
'jquery.validationEngine.js',
'exportting.js',
'highcharts.js',
'jquery.bgiframe.min.js',
);
//js混淆加密并更换名称
foreach(glob($jsPath) as $filePath)
{
$fileName = array_pop(explode('/',$filePath))