Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b70cbf173a
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (42 sloc) 1.554 kb
* Wrapper for the PHP version of CSS Tidy to allow it to accept command line arguments.
* (I tried the linux version but I couldn't get the binary to work or the source to compile without errors..)
* Requires php5-cli to work:
* sudo aptitude install php5-cli
* Copyright Nathan Friedly -
* MIT License
exit("usage:\n$ php $argv[0] source.css destination.css\n");
// fire up css tidy
$css = new csstidy();
// put all settings on "no shenanigans" mode
// read in the source file
$source_css = file_get_contents($argv[1]) or die("Error reading source file $argv[1]\n");
//echo "source css: \n\n" . substr($source_css,0,300) . "...\n\n";
// and spit out the results
$result = $css->print->plain();
//echo "parsed css: \n\n" . substr($result,0,300) . "...\n\n";
file_put_contents($argv[2], $result) or die ("Error writing to destination file $argv[2]\n");
Jump to Line
Something went wrong with that request. Please try again.