Beispiel #1
0
 /**
  * Fetch migration information plugins. This method
  * returns for each plugin:
  * current schema version and top migration version, if available.
  *
  * @return array
  */
 public function getMigrationInfo()
 {
     $info = array();
     $plugin_manager = PluginManager::getInstance();
     $plugins = $plugin_manager->getPluginInfos();
     $basepath = get_config('PLUGINS_PATH');
     foreach ($plugins as $id => $plugin) {
         $plugindir = $basepath . '/' . $plugin['path'] . '/';
         if (is_dir($plugindir . '/migrations')) {
             $schema_version = new DBSchemaVersion($plugin['name']);
             $migrator = new Migrator($plugindir . '/migrations', $schema_version);
             $info[$id]['migration_top_version'] = $migrator->top_version();
             $info[$id]['schema_version'] = $schema_version->get();
         }
     }
     return $info;
 }