You are here

protected function DrupalMigration::moduleExists in Drupal-to-Drupal data migration 7.2

Check to see if a given module is enabled in the source installation. @todo: move to DrupalVersion?

Parameters

$module: Name of module to check.

Return value

boolean 1 if it is enabled, 0 if not.

9 calls to DrupalMigration::moduleExists()
DrupalNode5Migration::query in d5/node.inc
Query for basic node fields from Drupal 5.
DrupalNode6Migration::query in d6/node.inc
Query for basic node fields from Drupal 6.
DrupalNode7Migration::query in d7/node.inc
Query for basic node fields from Drupal 7.
DrupalNodeMigration::prepareRow in ./node.inc
Called after the query data is fetched - we'll use this to populate the source row with the CCK fields.
DrupalNodeMigration::__construct in ./node.inc

... See full list

File

./migrate_d2d.migrate.inc, line 221
Base classes for all Drupal-to-Drupal migration classes.

Class

DrupalMigration
@file Base classes for all Drupal-to-Drupal migration classes.

Code

protected function moduleExists($module) {
  $exists = Database::getConnection('default', $this->sourceConnection)
    ->select('system', 's')
    ->fields('s', array(
    'status',
  ))
    ->condition('name', $module)
    ->condition('type', 'module')
    ->execute()
    ->fetchField();

  // Convert NULL to 0
  if (!$exists) {
    $exists = 0;
  }
  return $exists;
}