You are here

httpbl.install in http:BL 7

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

Installation functions for httpbl.

File

httpbl.install
View source
<?php

/**
 * @file
 * Installation functions for httpbl.
 */

/**
 * 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_uninstall().
 */
function httpbl_uninstall() {
  drupal_uninstall_schema('httpbl');
  db_delete('variable')
    ->condition('name', 'httpbl_%%', 'LIKE')
    ->execute();
}

Functions

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