コード例 #1
0
ファイル: Application.php プロジェクト: notadd/framework
 /**
  * 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));
 }
コード例 #2
0
ファイル: Theme.php プロジェクト: darrengopower/framework
 /**
  * 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;
 }
コード例 #3
0
 /**
  * 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');
 }
コード例 #4
0
 /**
  * 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();
 }
コード例 #5
0
ファイル: Server.php プロジェクト: darrengopower/framework
 /**
  * @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);
 }
コード例 #6
0
ファイル: Kernel.php プロジェクト: notadd/framework
 /**
  * @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();
 }
コード例 #7
0
ファイル: HandleExceptions.php プロジェクト: notadd/framework
 /**
  * @return \Illuminate\Contracts\Debug\ExceptionHandler
  */
 protected function getExceptionHandler()
 {
     return $this->app->make('Illuminate\\Contracts\\Debug\\ExceptionHandler');
 }