Ejemplo n.º 1
0
 protected function registerConstants(\PHPPHP\Engine\Executor $executor)
 {
     $store = $executor->getConstantStore();
     foreach (get_defined_constants(true) as $group => $set) {
         if ($group == 'user') {
             continue;
         }
         foreach ($set as $name => $value) {
             if (!$store->exists($name)) {
                 $store->register($name, Zval::factory($value));
             }
         }
     }
 }
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);
     }
 }
Ejemplo n.º 3
0
 public function register(\PHPPHP\Engine\Executor $executor)
 {
     $this->registerCoreConstants($executor->getConstantStore());
     parent::register($executor);
 }