/** * Add a command, resolving through the application. * * @param string $command * * @return \Symfony\Component\Console\Command\Command */ public function resolve($command) { if (is_null($this->container)) { $this->container = Container::getInstance(); } return $this->add($this->container->make($command)); }
/** * Theme constructor. * @param $title * @param $alias */ public function __construct($title, $alias) { $this->alias = $alias; $this->application = Container::getInstance(); $this->setting = $this->application->make('setting'); $this->title = $title; }
/** * ExtensionRegistrar constructor. */ public function __construct() { $this->container = $this->getContainer(); $this->events = $this->container->make('events'); $this->router = $this->container->make('router'); $this->setting = $this->container->make('setting'); }
/** * Boot a fresh copy of the application configuration. * * @return mixed */ protected function getFreshConfiguration() { $application = new Application($this->laravel->basePath()); $application->singleton(HttpKernelContract::class, Kernel::class); $application->singleton(ConsoleKernelContract::class, ConsoleKernel::class); $application->singleton(ExceptionHandler::class, Handler::class); $application->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap(); return $application['config']->all(); }
/** * @return void */ public function console() { $this->application->singleton(ConsoleKernelContract::class, ConsoleKernel::class); $this->application->singleton(ExceptionHandler::class, Handler::class); $kernel = $this->application->make(ConsoleKernelContract::class); $status = $kernel->handle($input = new ArgvInput(), new ConsoleOutput()); $kernel->terminate($input, $status); exit($status); }
/** * @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Response $response * * @return void */ public function terminate($request, $response) { $middlewares = $this->app->shouldSkipMiddleware() ? [] : array_merge($this->gatherRouteMiddleware($request), $this->middleware); foreach ($middlewares as $middleware) { if (!is_string($middleware)) { continue; } list($name, $parameters) = $this->parseMiddleware($middleware); $instance = $this->app->make($name); if (method_exists($instance, 'terminate')) { $instance->terminate($request, $response); } } $this->app->terminate(); }
/** * @return \Illuminate\Contracts\Debug\ExceptionHandler */ protected function getExceptionHandler() { return $this->app->make('Illuminate\\Contracts\\Debug\\ExceptionHandler'); }