A PHP class for optimizing and serving JavaScript sources using Google's Closure Compiler web service. The sources will be compiled on demand and cached locally for performance.
Example usage:
include("libs/php-closure.php");
$c = new PhpClosure();
$c->add("my-app.js")
->add("popup.js")
->advancedMode()
->useClosureLibrary()
->cacheDir("/tmp/js-cache/")
->write();
This was put together pretty quickly for use on my website. Patches and improvements welcome!
Dan Pupius (personal website).
Copyright 2010 Daniel Pupius. Apache License, Version 2.0.