基于PHP的javascript loader优化器?

I'm building a web-app framework and I'm looking for a way to compile javascript & css source files at runtime and I'm hoping for some suggestions.

I have used Require.js however the optimizer seems to depend on Node.js or Java/Rhino being installed which isnt ideal as I'd like to keep the dependencies down so that it can be run on any WAMP/LAMP environment (i.e. no Java/rhino or Node needed)

Ideally it would be something which at runtime looks for source updates and complies/minifies the js into a single flat file for instance <script src="js.php">

I have tried php packer however my tests have shown this to cause a bunch of javascript errors whenever I use it also its 6 years old now and doesnt seem to be actively in development.

YUI compressor & Google Closure again to my knowledge require Java.

Any suggestions welcomed!

Minify seems to do exactly that. It serves minified Javascript and CSS files. It adds ETags in the headers and send 304 HTTP codes if it wasn't updated since last visit.

I suggest to keep a look here:

I'm still looking for some code structure example where using dependencies manager and compressed utility like r.js do; but in php I didn't find nothing manage the code compression for require.js.