Exemplo n.º 1
0
 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);
 }