Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 3
0
 protected function addFile(fs\file $file, $bReal = false)
 {
     return array('script' => array('@src' => $bReal ? '/' . $file->getRealPath() : (string) $file, '@type' => 'text/javascript'));
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }