public function init() { self::$css = []; self::$js = []; $ci =& get_instance(); $config = empty($ci->config->config) ? [] : $ci->config->config; $auto_pick = empty($config['minify_auto']) ? true : (bool) $config['minify_auto']; $this->auto_pick = $auto_pick === null ? true : $this->auto_pick; }
function process($html) { // setup $min = new Minify(); // map the dom $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; @$dom->loadHTML($html); // minification if (!DEBUG) { $dom = $min->less($dom, $this->template); $dom = $min->css($dom, $this->template); $dom = $min->js($dom, $this->template); } else { if ($this->useRequire()) { // require is "on" in debug mode $dom = $min->requireDebug($dom, $this->template); } } // process require configuration $this->createClient($dom); $output = $dom->saveHTML(); // output the final markup - minify if not in debug return DEBUG ? $output : $min->html($output); }