예제 #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
파일: View.php 프로젝트: TheProjecter/sylma
 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);
 }