ua_logger.install in User Agent Logger 6
Same filename and directory in other branches
File
ua_logger.installView source
<?php
/**
* Implementation of hook_install().
* OLD CODE FOR REFERENCE PURPOSES
function ua_logger_install() {
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_query("CREATE TABLE {ua_logger} (
id SERIAL,
xid integer default NULL,
type text not null default null check (type in ('node', 'comment')) ,
ua text default NULL,
PRIMARY KEY (id)
)");
break;
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {ua_logger} (
id int(10) unsigned zerofill NOT NULL auto_increment,
xid int(10) unsigned zerofill default NULL,
type enum('node','comment') default NULL,
ua char(150) default NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1");
break;
}
}
*/
function ua_logger_schema() {
$schema['ua_logger'] = array(
'description' => t('...??'),
'fields' => array(
'id' => array(
'type' => 'serial',
),
'xid' => array(
'type' => 'int',
'unsigned' => TRUE,
),
'type' => array(
'type' => 'varchar',
'length' => 16,
),
'ua' => array(
'type' => 'varchar',
'length' => 150,
),
),
'primary key' => array(
'id',
),
);
return $schema;
}
function ua_logger_install() {
drupal_install_schema('ua_logger', 'ua_logger');
}
function ua_logger_uninstall() {
drupal_uninstall_schema('ua_logger', 'ua_logger');
}
Functions
Name![]() |
Description |
---|---|
ua_logger_install | |
ua_logger_schema | Implementation of hook_install(). OLD CODE FOR REFERENCE PURPOSES function ua_logger_install() { switch ($GLOBALS['db_type']) { case 'pgsql': db_query("CREATE TABLE {ua_logger} ( id SERIAL, xid integer default NULL, type text… |
ua_logger_uninstall |