Пример #1
0
 /**
  * setup & boot addons.
  */
 protected function bootAddons()
 {
     foreach ($this->addonEnvironment->addons() as $name => $addon) {
         // boot addon
         $addon->boot($this->app);
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle(Filesystem $filesystem, AddonEnvironment $env)
 {
     // make addons/
     $addonsDirectory = $env->path();
     if (!$filesystem->exists($addonsDirectory)) {
         $filesystem->makeDirectory($addonsDirectory);
     }
     // copy app/config/addon.php
     $addonConfigSourceFile = __DIR__ . '/../../config/addon.php';
     $addonConfigFile = $this->laravel['path.config'] . '/addon.php';
     if (!$filesystem->exists($addonConfigFile)) {
         $filesystem->copy($addonConfigSourceFile, $addonConfigFile);
         $this->info('make config: ' . $addonConfigFile);
     }
     // show lists
     $addons = $env->addons();
     foreach ($addons as $addon) {
         $this->dump($addon);
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle(Filesystem $filesystem, AddonEnvironment $env)
 {
     // make addons/
     $addons_directory = $env->path();
     if (!$filesystem->exists($addons_directory)) {
         $filesystem->makeDirectory($addons_directory);
     }
     $addon_name = $this->argument('addon');
     if (!$addon_name) {
         $addons = $env->addons();
         $this->line('--------');
         foreach ($addons as $addon) {
             $this->dump($addon);
             $this->line('--------');
         }
     } else {
         $addon = $env->addon($addon_name);
         // check addon
         if ($addon === null) {
             throw new UnexpectedValueException(sprintf('Addon "%s" is not found.', $addon_name));
         }
         $this->dump($addon);
     }
 }
 public function boot()
 {
     foreach ($this->addonEnvironment->addons() as $addon) {
         $addon->boot($this->app);
     }
 }