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)); } } } }
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); } }
public function register(\PHPPHP\Engine\Executor $executor) { $this->registerCoreConstants($executor->getConstantStore()); parent::register($executor); }