Пример #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $slug = $this->argument('slug');
     if (isset($slug)) {
         if (!$this->module->exists($slug)) {
             return $this->error('Module does not exist.');
         }
         if ($this->module->isEnabled($slug)) {
             $this->seed($slug);
         } elseif ($this->option('force')) {
             $this->seed($slug);
         }
         return;
     }
     if ($this->option('force')) {
         $modules = $this->module->all();
     } else {
         $modules = $this->module->enabled();
     }
     foreach ($modules as $module) {
         $this->seed($module['slug']);
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $this->prepareDatabase();
     $slug = $this->argument('slug');
     if (!empty($slug)) {
         if (!$this->module->exists($slug)) {
             return $this->error('Module does not exist.');
         }
         if ($this->module->isEnabled($slug)) {
             return $this->migrate($slug);
         } else {
             return $this->error('Nothing to migrate.');
         }
     } else {
         if ($this->option('force')) {
             $modules = $this->module->all();
         } else {
             $modules = $this->module->enabled();
         }
         foreach ($modules as $module) {
             $this->migrate($module['slug']);
         }
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $slug = $this->argument('slug');
     if (!empty($slug)) {
         if (!$this->module->exists($slug)) {
             return $this->error('Module does not exist.');
         }
         if ($this->module->isEnabled($slug)) {
             return $this->reset($slug);
         }
     } else {
         $modules = $this->module->enabled()->reverse();
         foreach ($modules as $module) {
             $this->reset($module['slug']);
         }
     }
 }
Пример #4
0
 /**
  * Returns module manifest information.
  *
  * @param string $module
  *
  * @return array
  */
 protected function getModuleInformation($module)
 {
     $enabled = $this->module->isEnabled($module['slug']);
     return array('#' => $module['order'], 'name' => $module['name'], 'slug' => $module['slug'], 'description' => $module['description'], 'status' => $enabled ? 'Enabled' : 'Disabled');
 }