I've been doing a lot of work on build automation in PHP for a framework library. I was about to start bashing at the keyboard when I thought... "someone's got to have done this before".
However after some digging I haven't found anything which can do exactly what I'm after and thought I'd ask around here:
I need a PHP script which can:
- Take a preset directory full of images (jpg/png/gif mixed)
- Sprite them all together into one file i.e. "UI.png" or something
- Open up a bunch of css files & scan for instances of the individual files
- replace the src
url() - Adjust any existing background positioning rules
It sounds like a lot to do but I can't be the first person to be considering this can I?
I've seen a few scripts around which do either the first part or attempt to do the 2nd part but with a tonne of config comments which I'd rather avoid.
Any ideas?