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; }
/** * Create cache object * * @param $file Script * @param array $aArguments * @return \sylma\parser\cached\documented */ protected function createCache(fs\file $file, array $aArguments, $bExternal = false) { return \Sylma::includeFile($file->getRealPath(), $aArguments, $bExternal); }
protected function addFile(fs\file $file, $bReal = false) { return array('script' => array('@src' => $bReal ? '/' . $file->getRealPath() : (string) $file, '@type' => 'text/javascript')); }
protected function addFile(fs\file $file, $bReal = false) { $aResult = array('link' => array('@href' => $bReal ? '/' . $file->getRealPath() : (string) $file, '@type' => 'text/css', '@media' => 'all', '@rel' => 'stylesheet')); return $aResult; }
public function callScript(fs\file $file, common\_window $window, $return = null, $bReturn = true) { $arguments = $window->getVariable('aSylmaArguments'); //$closure = $window->createClosure(array($arguments)); //$closure->addContent($window->callFunction('include', $return, array($file->getName()))); $call = $window->createCall($window->getSylma(), 'includeFile', $return, array($file->getRealPath(), $arguments, $window->getVariable('bSylmaExternal'))); if ($bReturn) { $result = $window->createAssign($window->getVariable('result'), $call); } else { $result = $call; } return $result; }