private function min($js, $filename) { try { $n = $this->parser->parse($js, $filename, 1); return $this->parseTree($n); } catch (Exception $e) { echo $e->getMessage() . "\n"; } return false; }
public static function minify($js, $filename = '') { static $instance = null; // this is a singleton if ($instance === null) { $instance = new JSMinPlus(); } return $instance->min($js, $filename); }