You are here

httpbl.install in http:BL 6.2

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

File

httpbl.install
View source
<?php

/**
 * Implementation of hook_schema().
 */
function httpbl_schema() {
  $schema['httpbl'] = array(
    'description' => t('Stores http:BL database cache.'),
    'fields' => array(
      'hostname' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'description' => t('Primary key: Hostname (IP address)'),
      ),
      'status' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Cache status (HTTPBL_LIST_* constants)'),
      ),
      'expire' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '11',
        'description' => t('A Unix timestamp indicating when the cache entry should expire.'),
      ),
    ),
    'primary key' => array(
      'hostname',
    ),
    'indexes' => array(
      'expire' => array(
        'expire',
      ),
    ),
  );
  return $schema;
}

/**
* Implementation of hook_install().
*/
function httpbl_install() {
  drupal_install_schema('httpbl');
}

/**
 * Implementation of hook_uninstall().
 */
function httpbl_uninstall() {
  drupal_uninstall_schema('httpbl');
  db_query("DELETE FROM {variable} WHERE name LIKE 'httpbl_%%'");
}

Functions

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