public function load()
 {
     parent::load();
     if (php_uname('s') === 'Linux') {
         $this->initialStatus = $this->interpreter->getStatus();
     } else {
         $this->initialStatus = false;
     }
 }
Пример #2
0
 public function callFunction($func)
 {
     $args = func_get_args();
     $func = array_shift($args);
     try {
         $ret = call_user_func_array(array($func, 'call'), $args);
         if ($ret === false) {
             // Per the documentation on LuaSandboxFunction::call, a return value
             // of false means that something went wrong and it's PHP's fault,
             // so throw a "real" exception.
             throw new MWException(__METHOD__ . ': LuaSandboxFunction::call returned false');
         }
         return $ret;
     } catch (LuaSandboxTimeoutError $e) {
         throw $this->engine->newException('scribunto-common-timeout');
     } catch (LuaSandboxError $e) {
         throw $this->convertSandboxError($e);
     }
 }
Пример #3
0
 /**
  * Get the parser options
  *
  * @return ParserOptions parser options
  */
 protected function getParserOptions()
 {
     return $this->engine->getParser()->getOptions();
 }