You are here

function flag_install in Flag 6.2

Same name and namespace in other branches
  1. 5 flag.install \flag_install()
  2. 6 flag.install \flag_install()
  3. 7.2 flag.install \flag_install()

Implementation of hook_install().

File

./flag.install, line 11
Flag module install/schema/update hooks.

Code

function flag_install() {

  // Load the flag API in case we want to use it when installing.
  include_once drupal_get_path('module', 'flag') . '/flag.module';

  // If Views Bookmark is available, skip the install and do an upgrade instead.
  if (strpos($GLOBALS['db_type'], 'mysql') === 0) {
    include_once drupal_get_path('module', 'flag') . '/includes/flag.views_bookmark.inc';
    if (flag_views_bookmark_update_needed()) {
      flag_views_bookmark_update();
      return;
    }
  }
  drupal_install_schema('flag');
}