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; }
protected function createSwitch(common\_window $window) { $call = $window->createCall($window->getVariable(self::ARGUMENTS_NAME), 'shift', 'php-string'); $result = $window->createSwitch($call); return $result; }
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); }
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; }
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; }
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); }