Ejemplo n.º 1
0
 /**
  * Performs the update for all plugins
  */
 public function updateAll()
 {
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $code => $plugin) {
         if (!$this->hasVersionFile($code)) {
             continue;
         }
         $this->updatePlugin($code);
     }
 }
Ejemplo n.º 2
0
 /**
  * Roll back all modules and plugins.
  * @return self
  */
 public function uninstall()
 {
     /*
      * Rollback plugins
      */
     $plugins = $this->pluginManager->getPlugins();
     foreach ($plugins as $name => $plugin) {
         $this->rollbackPlugin($name);
     }
     /*
      * Register module migration files
      */
     $modules = Config::get('cms.loadModules', []);
     foreach ($modules as $module) {
         $path = base_path() . '/modules/' . strtolower($module) . '/database/migrations';
         $this->migrator->requireFiles($path, $this->migrator->getMigrationFiles($path));
     }
     /*
      * Rollback modules
      */
     while (true) {
         $count = $this->migrator->rollback();
         foreach ($this->migrator->getNotes() as $note) {
             $this->note($note);
         }
         if ($count == 0) {
             break;
         }
     }
     Schema::dropIfExists('migrations');
     return $this;
 }