You are here

httpbl.install in http:BL 5

Same filename and directory in other branches
  1. 8 httpbl.install
  2. 6.2 httpbl.install
  3. 6 httpbl.install
  4. 7 httpbl.install

File

httpbl.install
View source
<?php

/**
* Implementation of hook_install().
*/
function httpbl_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {httpbl} (\n        hostname varchar(128) NOT NULL,\n        status tinyint(2) NOT NULL default '0',\n        expire int(11) NOT NULL default '0',\n        PRIMARY KEY (hostname),\n        INDEX (expire)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {httpbl} (\n        hostname varchar(128) NOT NULL PRIMARY KEY,\n        status smallint NOT NULL default 0,\n        expire int NOT NULL default 0\n        );");
      db_query("CREATE INDEX {httpbl}_expire_idx on {httpbl} (expire);");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function httpbl_uninstall() {
  db_query('DROP TABLE {httpbl}');
  variable_del('httpbl_accesskey');
  variable_del('httpbl_check');
  variable_del('httpbl_footer');
  variable_del('httpbl_link');
  variable_del('httpbl_log');
  variable_del('httpbl_stats');
  variable_del('httpbl_stat_black');
  variable_del('httpbl_stat_comment');
  variable_del('httpbl_stat_grey');
  variable_del('httpbl_threatlevel');
  variable_del('httpbl_message_black');
  variable_del('httpbl_message_grey');
  variable_del('httpbl_word');
}

Functions

Namesort descending Description
httpbl_install Implementation of hook_install().
httpbl_uninstall Implementation of hook_uninstall().