You are here

continents_api.install in Country codes API 5

Same filename and directory in other branches
  1. 6 contrib/continents_api/continents_api.install

Install file for Continents API.

File

contrib/continents_api/continents_api.install
View source
<?php

/**
 * @file
 * Install file for Continents API.
 */

/**
 * Implementation of hook_install().
 */
function continents_api_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':

      //create countries db
      db_query("CREATE TABLE {continents_api_continents} (\n        continent char(2) NOT NULL,\n        country char(2) NOT NULL,\n        PRIMARY KEY (continent, country)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
  }

  // Include continents_api module include for initial data import.
  require_once dirname(__FILE__) . '/continents_api.module';
  continents_api_csv_import_continents();
}

/**
 * Implementation of hook_uninstall().
 */
function continents_api_uninstall() {
  db_query('DROP TABLE {continents_api_continents}');
}

Functions

Namesort descending Description
continents_api_install Implementation of hook_install().
continents_api_uninstall Implementation of hook_uninstall().