/**
  * Handle the command.
  *
  * @param ExtensionCollection $extensions
  */
 public function handle(ExtensionCollection $extensions)
 {
     /* @var Extension $extension */
     foreach ($extensions as $extension) {
         $this->installers->add(new Installer(trans('streams::installer.seeding', ['seeding' => trans($extension->getName())]), function (Kernel $console) use($extension) {
             $console->call('db:seed', ['--addon' => $extension->getNamespace(), '--force' => true]);
         }));
     }
 }
 /**
  * Handle the command.
  *
  * @param ExtensionCollection $extensions
  */
 public function handle(ExtensionCollection $extensions)
 {
     /* @var Extension $extension */
     foreach ($extensions as $extension) {
         $this->installers->add(new Installer(trans('streams::installer.installing', ['installing' => trans($extension->getName())]), function (Kernel $console) use($extension) {
             $console->call('extension:install', ['extension' => $extension->getNamespace()]);
         }));
     }
 }
 /**
  * Handle the command.
  *
  * @param ModuleCollection $modules
  */
 public function handle(ModuleCollection $modules)
 {
     /* @var Module $module */
     foreach ($modules as $module) {
         if ($module->getNamespace() == 'anomaly.module.installer') {
             continue;
         }
         $this->installers->add(new Installer(trans('streams::installer.seeding', ['seeding' => trans($module->getName())]), function (Kernel $console) use($module) {
             $console->call('db:seed', ['--addon' => $module->getNamespace(), '--force' => true]);
         }));
     }
 }
示例#4
0
 /**
  * Handle the command.
  *
  * @return InstallerCollection
  */
 public function handle()
 {
     $installers = new InstallerCollection();
     $this->dispatch(new LoadCoreInstallers($installers));
     $this->dispatch(new LoadApplicationInstallers($installers));
     $this->dispatch(new LoadModuleInstallers($installers));
     $this->dispatch(new LoadExtensionInstallers($installers));
     $installers->add(new Installer('Updating environment file.', function (Kernel $console) {
         $console->call('env:set', ['line' => 'INSTALLED=true']);
     }));
     return $installers;
 }
 /**
  * Handle the command.
  *
  * @param Container $container
  */
 public function handle(Container $container)
 {
     $step = 1;
     $total = $this->installers->count();
     /* @var Installer $installer */
     while ($installer = $this->installers->shift()) {
         if ($this->command) {
             $this->command->info("{$step}/{$total} " . trans($installer->getMessage()));
         }
         $container->call($installer->getTask());
         $step++;
     }
 }
示例#6
0
 /**
  * Execute the console command.
  */
 public function fire(Dispatcher $events, Application $application, AddonManager $manager)
 {
     $this->dispatch(new ConfirmLicense($this));
     $data = new Collection();
     $this->dispatch(new SetStreamsData($data));
     $this->dispatch(new SetDatabaseData($data, $this));
     $this->dispatch(new SetApplicationData($data, $this));
     $this->dispatch(new SetAdminData($data, $this));
     $this->dispatch(new SetOtherData($data, $this));
     $this->dispatch(new WriteEnvironmentFile($data->all()));
     $this->dispatch(new ReloadEnvironmentFile());
     $this->dispatch(new ConfigureDatabase());
     $this->dispatch(new SetDatabasePrefix());
     $this->dispatch(new LocateApplication());
     $installers = new InstallerCollection();
     $this->dispatch(new LoadCoreInstallers($installers));
     $this->dispatch(new LoadApplicationInstallers($installers));
     $this->dispatch(new LoadModuleInstallers($installers));
     $this->dispatch(new LoadExtensionInstallers($installers));
     $this->dispatch(new RunInstallers($installers, $this));
     $this->call('env:set', ['line' => 'INSTALLED=true']);
     $this->dispatch(new ReloadEnvironmentFile());
     $installers->add(new Installer('streams::installer.running_migrations', function (Kernel $console) {
         $console->call('migrate', ['--force' => true, '--no-addons' => true]);
     }));
     $manager->register();
     // Register all of our addons.
     $events->fire(new StreamsHasInstalled($installers));
     $this->info('Running post installation tasks.');
     $this->dispatch(new LoadModuleSeeders($installers));
     $this->dispatch(new LoadExtensionSeeders($installers));
     $installers->add(new Installer('streams::installer.running_seeds', function (Kernel $console) {
         $console->call('db:seed', ['--force' => true]);
     }));
     $this->dispatch(new RunInstallers($installers, $this));
 }
 /**
  * Handle the command.
  */
 public function handle()
 {
     $this->installers->add(new Installer('streams::installer.running_core_migrations', function (Kernel $console) {
         $console->call('migrate', ['--force' => true, '--path' => 'vendor/anomaly/streams-platform/migrations/core']);
     }));
 }
 /**
  * Run an installation command.
  *
  * @param Container  $container
  * @param Dispatcher $events
  * @param            $key
  * @return bool
  */
 public function seed(Container $container, Dispatcher $events, $key)
 {
     $installers = new InstallerCollection();
     $events->fire(new StreamsHasInstalled($installers));
     /* @var Installer $installer */
     $installer = $installers->get($key);
     $container->call($installer->getTask());
     return 'true';
 }