public function importDocument(dom\handler $doc, fs\file $file) { $bElement = \Sylma::read('template/debug/source'); if (!$file->getControler()->getName()) { foreach ($doc->queryx('//*') as $el) { $el->createAttribute('build:source', (string) $file, $this->getNamespace()); if ($bElement) { $el->createAttribute('build:element', $this->getManager('formater')->buildLink($el->asLink()), $this->getNamespace()); } } } return $doc; }
protected function parseLess(fs\file $file) { $sResult = ''; $less = new Prefixer(); //$less->setImportDir($file->getParent()->getRealPath()); //echo (string) $file->getControler()->getDirectory()->getRealPath(); $less->setImportDir($file->getControler()->getDirectory()->getRealPath()); try { $sResult = $less->compileFile($file->getRealPath()); } catch (\Exception $e) { throw \Sylma::loadException($e); } return $sResult; }