Esempio n. 1
0
 protected static function render_file($path)
 {
     $css = parent::render_file($path);
     $css = str_replace('url(/', 'url(' . URL_ROOT . '/', $css);
     $css = str_replace('url("/', 'url("' . URL_ROOT . '/', $css);
     return $css;
 }
Esempio n. 2
0
 protected static function render_file($path)
 {
     $cache_path = $path . '-cache.css';
     if (!file_exists($cache_path) || filemtime($cache_path) < filemtime($path)) {
         $out = parent::render_file($path);
         $less = new lessc();
         $less->importDir = dirname($path);
         //$less->registerFunction('url', array('LessCompiler', 'url'));
         $css = $less->parse($out);
         $css = str_replace('url("/', 'url("' . URL_ROOT . '/', $css);
         file_put_contents($cache_path, $css);
     }
     return file_get_contents($cache_path);
 }
Esempio n. 3
0
function insert($name)
{
    return ResourceCompiler::insert($name);
}