| 1 |
<?php
|
| 2 |
// $Id: httpbl.install,v 1.8 2008/07/29 20:13:04 praseodym Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_schema().
|
| 6 |
*/
|
| 7 |
function httpbl_schema() {
|
| 8 |
$schema['httpbl'] = array(
|
| 9 |
'description' => t('Stores http:BL database cache.'),
|
| 10 |
'fields' => array(
|
| 11 |
'hostname' => array(
|
| 12 |
'type' => 'varchar',
|
| 13 |
'length' => '128',
|
| 14 |
'not null' => TRUE,
|
| 15 |
'description' => t('Primary key: Hostname (IP address)'),
|
| 16 |
),
|
| 17 |
'status' => array(
|
| 18 |
'type' => 'int',
|
| 19 |
'size' => 'tiny',
|
| 20 |
'not null' => TRUE,
|
| 21 |
'default' => 0,
|
| 22 |
'description' => t('Cache status (HTTPBL_LIST_* constants)'),
|
| 23 |
),
|
| 24 |
'expire' => array(
|
| 25 |
'type' => 'int',
|
| 26 |
'not null' => TRUE,
|
| 27 |
'default' => 0,
|
| 28 |
'disp-width' => '11',
|
| 29 |
'description' => t('A Unix timestamp indicating when the cache entry should expire.'),
|
| 30 |
),
|
| 31 |
),
|
| 32 |
'primary key' => array('hostname'),
|
| 33 |
'indexes' => array(
|
| 34 |
'expire' => array('expire')
|
| 35 |
),
|
| 36 |
);
|
| 37 |
return $schema;
|
| 38 |
}
|
| 39 |
|
| 40 |
|
| 41 |
/**
|
| 42 |
* Implementation of hook_install().
|
| 43 |
*/
|
| 44 |
function httpbl_install() {
|
| 45 |
drupal_install_schema('httpbl');
|
| 46 |
}
|
| 47 |
|
| 48 |
/**
|
| 49 |
* Implementation of hook_uninstall().
|
| 50 |
*/
|
| 51 |
function httpbl_uninstall() {
|
| 52 |
drupal_uninstall_schema('httpbl');
|
| 53 |
variable_del('httpbl_accesskey');
|
| 54 |
variable_del('httpbl_check');
|
| 55 |
variable_del('httpbl_footer');
|
| 56 |
variable_del('httpbl_link');
|
| 57 |
variable_del('httpbl_log');
|
| 58 |
variable_del('httpbl_stats');
|
| 59 |
variable_del('httpbl_stat_black');
|
| 60 |
variable_del('httpbl_stat_comment');
|
| 61 |
variable_del('httpbl_stat_grey');
|
| 62 |
variable_del('httpbl_threatlevel');
|
| 63 |
variable_del('httpbl_message_black');
|
| 64 |
variable_del('httpbl_message_grey');
|
| 65 |
variable_del('httpbl_word');
|
| 66 |
}
|