autologout.install in Automated Logout 6.2
Same filename and directory in other branches
Install file for Automated Logout Module
This file provides an install function (create database tables) with a schema for the tables and an uninstall function to remove the database tables
File
autologout.installView source
<?php
/**
* @file
* Install file for Automated Logout Module
*
* This file provides an install function (create database tables)
* with a schema for the tables
* and an uninstall function to remove the database tables
*/
/**
* Implementation of hook_install().
*/
function autologout_install() {
// Create tables.
drupal_install_schema('autologout');
// sink module's weight to the deepest depths of the module_list()
db_query("UPDATE {system} SET weight = %d WHERE name = '%s'", 1000, 'autologout');
}
/**
* Implementation of hook_uninstall().
*/
function autologout_uninstall() {
// Remove table.
drupal_uninstall_schema('autologout');
variable_del('autologout');
variable_del('autologout_one_session');
}
/**
* Implementation of hook_schema().
*/
function autologout_schema() {
$schema['autologout'] = array(
'fields' => array(
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'setting' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'small',
),
),
'primary key' => array(
'uid',
),
);
return $schema;
}
Functions
Name | Description |
---|---|
autologout_install | Implementation of hook_install(). |
autologout_schema | Implementation of hook_schema(). |
autologout_uninstall | Implementation of hook_uninstall(). |