Ejemplo n.º 1
0
 public function register(\PHPPHP\Engine\Executor $executor)
 {
     $ret = array();
     $aliases = (require_once __DIR__ . '/aliases.php');
     $functionStore = $executor->getFunctionStore();
     foreach ($aliases as $alias) {
         if (!$functionStore->exists($alias[0])) {
             $functionStore->register($alias[0], new FunctionData\InternalProxy($alias[0], $alias[1], $alias[2]));
         }
     }
     $this->registerConstants($executor);
 }
Ejemplo n.º 2
0
 public function register(\PHPPHP\Engine\Executor $executor)
 {
     $functionStore = $executor->getFunctionStore();
     foreach ($this->getFunctions() as $name => $functionData) {
         $functionStore->register($name, $functionData);
     }
     $constantStore = $executor->getConstantStore();
     foreach ($this->getConstants() as $name => $value) {
         $constantStore->register($name, Engine\Zval::factory($value));
     }
     $classStore = $executor->getClassStore();
     foreach ($this->getClasses() as $ce) {
         $classStore->register($ce);
     }
 }