Пример #1
0
 protected function prepareArgumented(common\_window $window)
 {
     $window->createVariable('aSylmaArguments', 'php-array');
     $window->checkVariable(self::ARGUMENTS_NAME, '\\' . get_class($this->create('argument')));
     $window->checkVariable('contexts', '\\' . get_class($this->create('argument')));
     return $window;
 }
Пример #2
0
 protected function createSwitch(common\_window $window)
 {
     $call = $window->createCall($window->getVariable(self::ARGUMENTS_NAME), 'shift', 'php-string');
     $result = $window->createSwitch($call);
     return $result;
 }
Пример #3
0
 protected function createInstanciation(common\_window $window, array $aArguments)
 {
     switch ($this->getReturn()) {
         case 'result':
             $sReturn = current($aArguments);
             break;
         case 'array':
             $sReturn = $window->argToInstance($aArguments);
             break;
         case '':
         case 'default':
             $sReturn = $window->createInstanciate($window->getSelf()->getInstance(), $aArguments);
             break;
         default:
             $this->launchException("Unknown @return value : " . $this->getReturn());
     }
     $window->setReturn($sReturn);
 }
Пример #4
0
 public function reflectCall(common\_window $window, php\basic\_ObjectVar $var, array $aArguments = array())
 {
     $this->validateArguments($aArguments);
     $result = $window->createCall($var, $this->getName(), $this->getReturn(), $aArguments);
     return $result;
 }
Пример #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;
 }
Пример #6
0
 public function addInstance(common\_window $window, dom\collection $children)
 {
     $aArguments = $this->parseArguments($children);
     if ($file = $this->getFile()) {
         $require = $window->callFunction('require_once', $window->argToInstance('php-bool'), array($file->getRealPath()));
         $window->add($require);
     }
     $instance = $window->loadInstance($this->getName(), $file);
     return $window->createInstanciate($instance, $aArguments);
 }