protected function append($filename, $origfilename = null) { if (substr($filename, -5) == ".less") { $script = Cache::Pub($filename, ".css"); if ($script->check()) { Logger::info("Compile less file {$filename}"); $less = new Less(); $less->setOriginalDir(dirname($origfilename)); $less->compileFile($filename, $script->getFilename()); } $filename = $script->getFilename(); } parent::append($filename, $origfilename); }
protected function findImport($url) { if ($this->origdir) { $partial = $this->origdir . '/' . $url; if ($res = AbstractResources::find($partial)) { return $res; } if ($res = AbstractResources::find($partial . '.less')) { return $res; } } foreach ((array) $this->importDir as $dir) { $full = $dir . (substr($dir, -1) != '/' ? '/' : '') . $url; if ($this->fileExists($file = $full . '.less') || $this->fileExists($file = $full)) { return $file; } } return; }