JSMIN for PHP4
In my last post PHP Speedy for WordPress it only supported a php5 version of JSmin, I have sourced a php4 version for you to use in your script. I will also include an example of how to modify PHP Speedy to include this script.
Download JSMin for php4 Here.
To Include this in PHP Speedy:
Edit: php_speedy.php
Replace:
require_once(‘libs/php/jsmin5.php’);
$jsmin = new JSMin(null);
With:
if(substr(phpversion(),0,1) == 5) {
require_once(‘libs/php/jsmin5.php’);
$jsmin = new JSMin(null);
}
if(substr(phpversion(),0,1) == 4) {
require_once(‘libs/php/jsmin4.php’);
$jsmin = new JSMin(null);
}
Copy the jsmin4.php to: /path/to/php_speedy/libs/php/jsmin4.php
Rename: /path/to/php_speedy/libs/php/jsmin.php – to - /path/to/php_speedy/libs/php/jsmin5.php
Awesome! Thank you for sourcing this to php4, works like a charm.