| 1 |
|
<?php |
| 2 |
|
// $Id$ |
| 3 |
|
|
| 4 |
|
/** |
| 5 |
|
* @file |
| 6 |
|
* Install file for Continents API. |
| 7 |
|
*/ |
| 8 |
|
|
| 9 |
|
/** |
| 10 |
|
* Implementation of hook_install(). |
| 11 |
|
*/ |
| 12 |
|
function continents_api_install() { |
| 13 |
|
switch ($GLOBALS['db_type']) { |
| 14 |
|
case 'mysqli': |
| 15 |
|
case 'mysql': |
| 16 |
|
//create countries db |
| 17 |
|
db_query("CREATE TABLE {continents_api_continents} ( |
| 18 |
|
continent char(2) NOT NULL, |
| 19 |
|
country char(2) NOT NULL, |
| 20 |
|
PRIMARY KEY (continent, country) |
| 21 |
|
) /*!40100 DEFAULT CHARACTER SET UTF8 */ "); |
| 22 |
|
break; |
| 23 |
|
} |
| 24 |
|
// Include continents_api module include for initial data import. |
| 25 |
|
require_once(dirname(__FILE__) .'/continents_api.module'); |
| 26 |
|
continents_api_csv_import_continents(); |
| 27 |
|
} |
| 28 |
|
|
| 29 |
|
/** |
| 30 |
|
* Implementation of hook_uninstall(). |
| 31 |
|
*/ |
| 32 |
|
function continents_api_uninstall() { |
| 33 |
|
db_query('DROP TABLE {continents_api_continents}'); |
| 34 |
|
} |