<?php

/**
 * @file
 * Installation file for Migration Tools module.
 */


/**
 * Implements hook_enable().
 */
function migration_tools_enable() {
  // Provide friendly message to get started with permissions and configuration.
  drupal_set_message(t('The migration_tools module has been successfully enabled.  Be sure to set <a href="@configure">configuration</a> options.',
    array(
      '@configure' => url('admin/config/migration_tools'),
    )
  ));
}


/**
 * Implements hook_disable().
 */
function migration_tools_disable() {
  drupal_set_message(t('migration_tools has been disabled.  If your local migrations are using any of the methods or functions from migration_tools, they may result in fatal errors.'));
}


/**
 * Implements hook_uninstall().
 */
function migration_tools_uninstall() {
  variable_del('migration_tools_base_domain');
  variable_del('migration_tools_custom_menu_csv_source_path');
  variable_del('migration_tools_custom_menu_dest_path');
  variable_del('migration_tools_custom_menu_module');
  variable_del('migration_tools_custom_migration_module');
  variable_del('migration_tools_drush_debug');
  variable_del('migration_tools_drush_stop_on_error');
  variable_del('migration_tools_migrate_ui_hidden');

  drupal_set_message(t('migration_tools has been uninstalled.'));
}

/**
 * Rebuild registry to accommodate anyone switching from 7.x-1.x to 7.x-2.x.
 */
function migration_tools_update_7001() {
  registry_rebuild();
  return "Rebuilt the registry to accommodate autoaded file changes from the 7.x-1.x to 7.x-2.x.";
}
