You are here

function og_migrate_register_plugins in Organic groups 7

Register plugins that are not in the database yet.

1 call to og_migrate_register_plugins()
og_migrate_init in og_migrate/og_migrate.module
Implements hook_init().

File

og_migrate/og_migrate.module, line 165
Migrate and upgrade Organic groups data.

Code

function og_migrate_register_plugins() {
  $names = array();
  foreach (og_migrate_get_plugins() as $name => $plugin) {
    $names[$name] = $name;
  }
  $query = db_select('og_migrate', 'ogm');
  $result = $query
    ->fields('ogm', array(
    'plugin',
  ))
    ->execute()
    ->fetchAll();
  foreach ($result as $row) {
    unset($names[$row->plugin]);
  }
  if ($names) {
    foreach ($names as $name) {
      og_migrate_write_record($name, OG_MIGRATE_NOT_EXECUTED);
    }
  }
}