Exemplo n.º 1
0
 public function execute(Engine\Executor $executor, array $args, Engine\Zval\Ptr $return = null, \PHPPHP\Engine\Objects\ClassInstance $ci = null, \PHPPHP\Engine\Objects\ClassEntry $ce = null)
 {
     $rawArgs = $this->compileArguments($args);
     ob_start();
     $ret = call_user_func_array($this->callback, $rawArgs);
     $out = ob_get_clean();
     if ($out) {
         $executor->getOutput()->write($out);
     }
     if ($return) {
         $return->setValue($this->compileReturn($ret));
     }
 }
Exemplo n.º 2
0
 public function handle(\PHPPHP\Engine\Executor $executor, $level, $message, $file, $line, $extra = '', $addFunc = true)
 {
     if ($executor->executorGlobals->error_reporting & $level) {
         $prefix = static::getErrorLevelName($level);
         $func = $addFunc && $executor->executorGlobals->call ? $executor->executorGlobals->call->getName() . '(): ' : '';
         $output = sprintf("%s: %s%s in %s on line %d%s", $prefix, $func, $message, $file, $line, $extra);
         if ($executor->executorGlobals->display_errors) {
             $executor->getOutput()->write("\n{$output}\n", true);
         }
         if ($level & (E_PARSE | E_ERROR | E_COMPILE_ERROR | E_RECOVERABLE_ERROR)) {
             $executor->shutdown();
             throw new \PHPPHP\Engine\ErrorOccurredException();
         }
     }
 }
Exemplo n.º 3
0
 public function __construct(\PHPPHP\Engine\Executor $executor)
 {
     $this->executor = $executor;
     $this->parent = $executor->getOutput();
 }