You are here

session_api.install in Session API 5

Same filename and directory in other branches
  1. 6 session_api.install
  2. 7 session_api.install

File

session_api.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function session_api_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {session_api} (\n        sid int NOT NULL,\n        session_id varchar(64) NOT NULL,\n        PRIMARY KEY (sid),\n        UNIQUE (session_id)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {session_api} (\n        sid int NOT NULL default '0',\n        session_id varchar(64) NOT NULL default '0',\n        PRIMARY KEY (sid),\n        UNIQUE (session_id)\n      )");
      break;
  }
}

/**
 * Implementation of hook_uninstall().
 */
function session_api_uninstall() {
  db_query("DROP TABLE {session_api}");
}

Functions

Namesort descending Description
session_api_install Implementation of hook_install().
session_api_uninstall Implementation of hook_uninstall().