You are here

function ip2country_install in IP-based Determination of a Visitor's Country 6

Same name and namespace in other branches
  1. 8 ip2country.install \ip2country_install()
  2. 7 ip2country.install \ip2country_install()

Implements hook_install().

Creates database tables needed by this module.

By default, this module WILL populate the database. But because it is so time-consuming, an option is available to not populate the database automatically on install, intended for use by SimpleTest.

File

./ip2country.install, line 94
Install, update, and uninstall functions for the ip2country module.

Code

function ip2country_install() {

  // Create tables
  drupal_install_schema('ip2country');

  //
  // Set the variable to FALSE before installing this module to
  // leave the database table empty on install.
  //
  if (variable_get('ip2country_populate_database_on_install', TRUE)) {
    module_load_include('inc', 'ip2country');
    ip2country_update_database();
  }
}