You are here

statistics_filter.install in Statistics Filter 5

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

File

statistics_filter.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function statistics_filter_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $queries = db_query("CREATE TABLE {statistics_filter_browsers} (\n                  browser varchar(255) NOT NULL default '',\n                  counter INT DEFAULT '0' NOT NULL,\n                  is_crawler TINYINT(1) DEFAULT '0' NOT NULL,\n                  PRIMARY KEY (browser)\n                ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      if ($queries) {
        drupal_set_message(t('Statistics Filter tables installed into the database'));
      }
      else {
        drupal_set_message(t('There was a problem installing the Statistics Filter tables.'), 'error');
      }
      break;
    case 'pgsql':

      // @TODO:
      break;
  }
}
function statistics_filter_uninstall() {
  db_query('DROP TABLE {statistics_filter_browsers}');
  variable_del('statistics_filter_noadmin');
  variable_del('statistics_filter_roles');
  variable_del('statistics_filter_crawlers');
}

Functions