You are here

function migrate_get_module_apis in Migrate 6.2

Same name and namespace in other branches
  1. 6 migrate.module \migrate_get_module_apis()
  2. 7.2 migrate.module \migrate_get_module_apis()

Get a list of modules that support the current migrate API.

10 calls to migrate_get_module_apis()
MigrateCommentUnitTest::setUp in tests/plugins/destinations/comment.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MigrateImportOptionsTest::setUp in tests/import/options.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MigrateNodeUnitTest::setUp in tests/plugins/destinations/node.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MigrateTableUnitTest::setUp in tests/plugins/destinations/table.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
MigrateTaxonomyUnitTest::setUp in tests/plugins/destinations/term.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…

... See full list

File

./migrate.module, line 410

Code

function migrate_get_module_apis($reset = FALSE) {
  static $cache = NULL;
  if ($reset) {
    $cache = NULL;
  }
  if (!isset($cache)) {
    $cache = array();
    foreach (module_implements('migrate_api') as $module) {
      $function = $module . '_migrate_api';
      $info = $function();
      if (isset($info['api']) && $info['api'] == MIGRATE_API_VERSION) {
        $cache[$module] = $info;

        // Register any migrations defined via the hook.
        if (isset($info['migrations']) && is_array($info['migrations'])) {
          foreach ($info['migrations'] as $machine_name => $arguments) {
            MigrationBase::registerMigration($arguments['class_name'], $machine_name, $arguments);
          }
        }
      }
      else {
        drupal_set_message(t('%function supports Migrate API version %modversion,
           Migrate module API version is %version - migration support not loaded.', array(
          '%function' => $function,
          '%modversion' => $info['api'],
          '%version' => MIGRATE_API_VERSION,
        )));
      }
    }
  }
  return $cache;
}