Get Runner

@return callable
347616
public function getRunner()
    {
        if (!isset($this->runner)) {
            $this->runner = new Runner\Delegate();
        }
        
        return $this->runner;
    }
76530
protected function cachePool()
    {
        if (!isset($this->cachePool)) {
            throw new RuntimeException(sprintf(
                'Cache Pool is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->cachePool;
    }
149695
protected function getAuthUser() {
    $principalFactory = ObjectFactory::getInstance('principalFactory');
    $session = ObjectFactory::getInstance('session');
    return $principalFactory->getUser($session->getAuthUser());
  }
1095847
protected function runCallable()
    {
        $callable = $this->action['uses'];

        $parameters = $this->resolveMethodDependencies(
            $this->parametersWithoutNulls(), new ReflectionFunction($callable)
        );

        return call_user_func_array($callable, $parameters);
    }
1337898
public function onRun()
    {
        if (!$this->checkUserSecurity()) {
            if (empty($this->property('redirect'))) {
                throw new \InvalidArgumentException('Redirect property is empty');
            }
            
            $redirectUrl = $this->controller->pageUrl($this->property('redirect'));
            return Redirect::guest($redirectUrl);
        }

        $this->page['user'] = $this->user();
    }
1274060
public function runner($runner)
    {
        if ($runner instanceof Runner) {
            $this->runner = $runner;
        } else {
            $this->runner = $this->getRunner($runner);
        }

        return $this;
    }
646662
private static ScriptRunner getRunner() throws IOException {
		if (sharedRunner.get() == null) {
			//create JavaScript runner
			ScriptRunner runner = ScriptRunnerFactory.createRunner();
			
			//load bundled scripts
			try {
				runner.loadScript(CSL.class.getResource("dump.js"));
				runner.loadScript(CSL.class.getResource("citeproc.js"));
				runner.loadScript(CSL.class.getResource("formats.js"));
				runner.loadScript(CSL.class.getResource("loadsys.js"));
			} catch (ScriptRunnerException e) {
				//should never happen because bundled JavaScript files
				//should be OK indeed
				throw new RuntimeException("Invalid bundled javascript file", e);
			}
			
			sharedRunner.set(runner);
		}
		return sharedRunner.get();
	}
774149
protected function getMonologHandler()
    {
        return (new StreamHandler($this->path('storage', 'logs/netforce.log'), Logger::DEBUG))->setFormatter(new LineFormatter(null, null, true, true));
    }
509480
public function getResponse()
    {
        if (is_null($this->response)) {
            $this->response = $this->getRunner()->run();
        }
        return $this->response;
    }
1313980
def setup_runner(self):
        
        runner = ApplicationRunner(
            url=self.config['transport_host'],
            realm=u'realm1',
            extra={
                'config': self.config,
                'handlers': self.handlers,
            }
        )
        return runner
328176
public function run()
    {
        try {
            return $this
                ->preRun()
                ->check();
        } catch (Exception $e) {
            return $this
                ->setMessage($e->getMessage())
                ->setCode($e->getCode());
        }
    }
155019
private function getWhoopsRunner()
    {
        $whoops = new Whoops();
        $whoops->allowQuit(false);
        $whoops->writeToOutput(false);

        return $whoops;
    }
542074
protected function runnableRetriever()
    {
        $runnable = $this->getRunnable();

        if ($runnable && is_callable($runnable)) {
            return $runnable;
        }

        return function ($server, $process) {
            $this->dispatchEvent('Run', $server, $process);
        };
    }
1240172
public function get()
    {
        if (! $this->singleton) {
            return call_user_func($this->loader);
        }
        if ($this->object === null) {
            $this->object = call_user_func($this->loader);
        }

        return $this->object;
    }
83674
public function getLoader()
    {
        if (null === $this->loader) {
            if (strpos('@PHP-BIN@', '@PHP-BIN') === 0) {
                $base = dirname(__FILE__) . '/';
                set_include_path($base . PATH_SEPARATOR . get_include_path());
            } else {
                $base = '@PEAR-DIR@/Phrozn/';
            }

            //Autoload candidates.
            $dirs = array($base . '..', getcwd());

            foreach ($dirs as $dir) {
                $file = $dir . '/vendor/autoload.php';
                if (file_exists($file)) {
                    $this->loader = include $file;
                    break;
                }
            }

            if (null === $this->loader) {
                throw new \RuntimeException("Unable to locate autoloader.");
            }
        }

        return $this->loader;
    }
63262
public function currentRun()
	{
		if (!$this->_currentRun)
		{
			$this->_currentRun = $this->runs()
				->whereEquals('import_id', $this->get('id'))
				->ordered()
				->row();
		}

		return $this->_currentRun;
	}
1301701
public static ScriptRunner createRunner() {
		RunnerType t = runner.get();
		
		switch (t) {
		case AUTO:
			if (supportsV8()) {
				return createV8Runner();
			}
			//fall back to JRE
			return createJreRunner();
		
		case JRE:
			return createJreRunner();
		
		case V8:
			return createV8Runner();
		
		default:
			throw new RuntimeException("Invalid runner type");
		}
	}