You are here

function htmlpurifier_install in HTML Purifier 5

Same name and namespace in other branches
  1. 6.2 htmlpurifier.install \htmlpurifier_install()
  2. 6 htmlpurifier.install \htmlpurifier_install()

Implementation of hook_install().

File

./htmlpurifier.install, line 6

Code

function htmlpurifier_install() {
  _htmlpurifier_version_check();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {cache_htmlpurifier} (\n        cid varchar(255) NOT NULL default '',\n        data longblob,\n        expire int NOT NULL default '0',\n        created int NOT NULL default '0',\n        headers text,\n        PRIMARY KEY (cid),\n        INDEX expire (expire)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {cache_htmlpurifier} (\n        cid varchar(255) NOT NULL default '',\n        data bytea,\n        expire int NOT NULL default '0',\n        created int NOT NULL default '0',\n        headers text,\n        PRIMARY KEY (cid)\n      )");
      db_query("CREATE INDEX {cache_htmlpurifier}_expire_idx ON {cache_htmlpurifier} (expire)");
      break;
  }
}