Наследование: extends Shnhrrsn\LaravelSupport\Console\Kernel
Пример #1
0
 /**
  * Execute the console command.
  *
  * @param ModuleCollection $modules
  * @param Repository       $config
  * @param Search           $search
  * @param Kernel           $console
  */
 public function fire(ModuleCollection $modules, Repository $config, Search $search, Kernel $console)
 {
     $stream = $this->argument('stream');
     if (!$stream) {
         $this->info('Destroying index');
         $console->call('search:destroy');
     } else {
         $this->info('Deleting ' . $stream);
         $search->search('stream', $stream)->delete();
     }
     /* @var Module $module */
     foreach ($modules->withConfig('search') as $module) {
         foreach ($config->get($module->getNamespace('search')) as $model => $search) {
             /* @var EntryModel $model */
             $model = new $model();
             if (!$stream || $stream == $model->getStreamNamespace() . '.' . $model->getStreamSlug()) {
                 $this->info('Rebuilding ' . $stream);
                 $this->output->progressStart($model->count());
                 foreach ($model->all() as $entry) {
                     $entry->save();
                     $this->output->progressAdvance();
                 }
                 $this->output->progressFinish();
             }
         }
     }
 }
 /**
  * Handle the command.
  *
  * @param Kernel     $console
  * @param Dispatcher $events
  */
 public function handle(Kernel $console, Dispatcher $events, ModuleRepositoryInterface $modules)
 {
     $this->module->fire('uninstalling');
     $options = ['--addon' => $this->module->getNamespace()];
     $console->call('migrate:reset', $options);
     $console->call('streams:destroy', ['namespace' => $this->module->getSlug()]);
     $console->call('streams:cleanup');
     $modules->uninstall($this->module);
     $this->module->fire('uninstalled');
     $events->fire(new ModuleWasUninstalled($this->module));
 }
 /**
  * Handle the command.
  *
  * @param Kernel                       $console
  * @param Dispatcher                   $events
  * @param ExtensionRepositoryInterface $extensions
  * @return bool
  */
 public function handle(Kernel $console, Dispatcher $events, ExtensionRepositoryInterface $extensions)
 {
     $this->extension->fire('uninstalling');
     $options = ['--addon' => $this->extension->getNamespace()];
     $console->call('migrate:reset', $options);
     $console->call('streams:destroy', ['namespace' => $this->extension->getSlug()]);
     $console->call('streams:cleanup');
     $extensions->uninstall($this->extension);
     $this->extension->fire('uninstalled');
     $events->fire(new ExtensionWasUninstalled($this->extension));
     return true;
 }
 /**
  * Handle the command.
  *
  * @param InstallExtension|Kernel      $console
  * @param AddonManager                 $manager
  * @param Dispatcher                   $dispatcher
  * @param ExtensionRepositoryInterface $extensions
  * @return bool
  */
 public function handle(Kernel $console, AddonManager $manager, Dispatcher $dispatcher, ExtensionRepositoryInterface $extensions)
 {
     $this->extension->fire('installing');
     $options = ['--addon' => $this->extension->getNamespace(), '--force' => true];
     $console->call('migrate:refresh', $options);
     $extensions->install($this->extension);
     $manager->register();
     if ($this->seed) {
         $console->call('db:seed', $options);
     }
     $this->extension->fire('installed');
     $dispatcher->fire(new ExtensionWasInstalled($this->extension));
     return true;
 }
Пример #5
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     parent::schedule($schedule);
     $schedule->command('crm-launcher:updateCases')->everyMinute()->when(function () {
         return Message::exists();
     });
     $schedule->command('crm-launcher:activity')->everyMinute()->when(function () {
         return Message::exists();
     });
     $schedule->command('crm-launcher:updateDashboardStats')->everyFiveMinutes();
     $schedule->command('crm-launcher:updatePublishmentStats')->everyFiveMinutes();
     $schedule->command('crm-launcher::resetNotified')->daily();
 }
Пример #6
0
 /**
  * Bootstrap the application for artisan commands.
  *
  * @return void 
  * @static 
  */
 public static function bootstrap()
 {
     //Method inherited from \Illuminate\Foundation\Console\Kernel
     \App\Console\Kernel::bootstrap();
 }
 /**
  * Handle the command.
  */
 public function handle()
 {
     $this->command->call('migrate', ['--force' => true, '--addon' => 'anomaly.distribution.streams']);
     $this->command->call('migrate', ['--force' => true, '--addon' => 'anomaly.module.addons']);
     $this->command->call('migrate', ['--force' => true, '--no-addons' => true]);
 }
Пример #8
0
 /**
  * Set the Artisan application instance.
  *
  * @param \Illuminate\Console\Application $artisan
  * @return void 
  * @static 
  */
 public static function setArtisan($artisan)
 {
     //Method inherited from \Illuminate\Foundation\Console\Kernel
     \App\Console\Kernel::setArtisan($artisan);
 }
Пример #9
0
 /**
  * Handle the command.
  *
  * @param Kernel $console
  */
 public function handle(Kernel $console)
 {
     $console->call('cache:clear');
 }
 /**
  * Handle the command.
  *
  * @param ModuleManager $manager
  */
 public function handle(Kernel $kernel)
 {
     $kernel->call('migrate', ['--force' => true, '--addon' => 'anomaly.module.installer']);
     $kernel->call('migrate', ['--force' => true, '--no-addons' => true]);
 }