function includeFile($fname1) { /* try loading .pcss first */ $fname = preg_replace('/\\.css$/', '.pcss', $fname1); if (!file_exists($fname)) { $fname = $fname1; } $f = file_get_contents($fname); if (!$f) { $this->error('Unable to include file ' . $fname); } $p = new ParseCSS(); $p->setState($this->o); $s = $p->parse($f); $this->errors = array_merge($this->errors, $p->getErrors()); $this->o->addSheet($s); }
<?php function d() { } function warn() { } require_once "parsecss.php"; require_once "cssoutput.php"; $c = new ParseCSS(); $file = file_get_contents('test.css'); $s = $c->parse($file); $o = new OutputCSS(); echo $o->outputStylesheet($s);