Пример #1
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface   $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  *
  * @return int|null|void
  * @throws \RuntimeException
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $app = AppFactory::make(forge('paths')->toArray());
     //@formatter:off
     forge()->make(Application::class);
     forge()->make(Attributes::class);
     forge()->make(Blade::class);
     forge()->make(BladeViewConfigurationInterface::class);
     forge()->make(BladeView::class);
     forge()->make(Config::class);
     forge()->make(Connections::class);
     forge()->make(Database::class);
     forge()->make(DB::class);
     forge()->make(GlobalScope::class);
     forge()->make(NineBase::class);
     forge()->make(Paths::class);
     forge()->make(TwigViewConfigurationInterface::class);
     forge()->make(TwigView::class);
     app('db.connection');
     app('db');
     //@formatter:on
     forge()->makePhpStormMeta();
     $headerStyle = new OutputFormatterStyle('white', 'default', ['bold']);
     $output->getFormatter()->setStyle('header', $headerStyle);
     $output->writeln('<header>Generated PhpStorm code-completion file.</header>');
 }
Пример #2
0
 /**
  * **Make a new Application instance.**
  *
  * @param array $paths
  *
  * @return Application
  */
 public static function make(array $paths) : Application
 {
     // The Application is, in effect, a singleton...
     // so if the application already exists then simply return it.
     if (NULL !== static::$instance and NULL !== Forge::getApplication()) {
         return Forge::getApplication();
     }
     // cache AppFactory instance.
     static::$instance ?: new static($paths);
     // block anything else from making a new Application.
     static::$booted = TRUE;
     // make the application
     $application = static::$instance->makeApplication($paths);
     Forge::setApplication($application);
     return $application;
 }