2007-04-10 10:10:27 +00:00
|
|
|
<?php
|
|
|
|
|
2009-05-13 19:42:18 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Install, update and uninstall functions for the dblog module.
|
|
|
|
*/
|
|
|
|
|
2007-10-05 14:43:26 +00:00
|
|
|
/**
|
2009-12-04 16:49:48 +00:00
|
|
|
* Implements hook_schema().
|
2007-10-05 14:43:26 +00:00
|
|
|
*/
|
|
|
|
function dblog_schema() {
|
|
|
|
$schema['watchdog'] = array(
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Table that contains logs of all system events.',
|
2007-10-05 14:43:26 +00:00
|
|
|
'fields' => array(
|
2007-10-10 11:39:35 +00:00
|
|
|
'wid' => array(
|
|
|
|
'type' => 'serial',
|
|
|
|
'not null' => TRUE,
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Primary Key: Unique watchdog event ID.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'uid' => array(
|
|
|
|
'type' => 'int',
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => 0,
|
2009-02-26 07:30:29 +00:00
|
|
|
'description' => 'The {users}.uid of the user who triggered the event.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'type' => array(
|
|
|
|
'type' => 'varchar',
|
2008-12-28 20:41:19 +00:00
|
|
|
'length' => 64,
|
2007-10-10 11:39:35 +00:00
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => '',
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Type of log message, for example "user" or "page not found."',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'message' => array(
|
|
|
|
'type' => 'text',
|
|
|
|
'not null' => TRUE,
|
|
|
|
'size' => 'big',
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Text of log message to be passed into the t() function.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'variables' => array(
|
2010-06-25 17:47:22 +00:00
|
|
|
'type' => 'blob',
|
2007-10-10 11:39:35 +00:00
|
|
|
'not null' => TRUE,
|
|
|
|
'size' => 'big',
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'severity' => array(
|
|
|
|
'type' => 'int',
|
|
|
|
'unsigned' => TRUE,
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => 0,
|
|
|
|
'size' => 'tiny',
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'The severity level of the event; ranges from 0 (Emergency) to 7 (Debug)',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'link' => array(
|
|
|
|
'type' => 'varchar',
|
|
|
|
'length' => 255,
|
2008-08-21 19:36:39 +00:00
|
|
|
'not null' => FALSE,
|
2007-10-10 11:39:35 +00:00
|
|
|
'default' => '',
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Link to view the result of the event.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'location' => array(
|
|
|
|
'type' => 'text',
|
|
|
|
'not null' => TRUE,
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'URL of the origin of the event.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'referer' => array(
|
2008-12-03 19:22:09 +00:00
|
|
|
'type' => 'text',
|
2008-08-21 19:36:39 +00:00
|
|
|
'not null' => FALSE,
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'URL of referring page.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'hostname' => array(
|
|
|
|
'type' => 'varchar',
|
|
|
|
'length' => 128,
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => '',
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Hostname of the user who triggered the event.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
|
|
|
'timestamp' => array(
|
|
|
|
'type' => 'int',
|
|
|
|
'not null' => TRUE,
|
|
|
|
'default' => 0,
|
2008-11-15 13:01:11 +00:00
|
|
|
'description' => 'Unix timestamp of when event occurred.',
|
2007-10-10 11:39:35 +00:00
|
|
|
),
|
2007-10-05 14:43:26 +00:00
|
|
|
),
|
|
|
|
'primary key' => array('wid'),
|
2008-03-15 12:31:29 +00:00
|
|
|
'indexes' => array(
|
|
|
|
'type' => array('type'),
|
2008-10-22 18:32:31 +00:00
|
|
|
'uid' => array('uid'),
|
2008-03-15 12:31:29 +00:00
|
|
|
),
|
2007-10-05 14:43:26 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
2008-08-21 19:36:39 +00:00
|
|
|
|
2011-02-19 16:54:36 +00:00
|
|
|
/**
|
2012-07-28 16:35:17 +00:00
|
|
|
* @defgroup updates-7.x-to-8.x Updates from 7.x to 8.x
|
|
|
|
* @{
|
|
|
|
* Update functions from 7.x to 8.x.
|
2011-02-19 16:54:36 +00:00
|
|
|
*/
|
2012-07-28 16:35:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Update settings to the new configuration system.
|
|
|
|
*/
|
|
|
|
function dblog_update_8000() {
|
|
|
|
update_variables_to_config('dblog.settings', array(
|
|
|
|
'dblog_row_limit' => 'row_limit',
|
|
|
|
));
|
2011-02-19 16:54:36 +00:00
|
|
|
}
|
2012-07-28 16:35:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @} End of "defgroup updates-7.x-to-8.x"
|
|
|
|
* The next series of updates should start at 9000.
|
|
|
|
*/
|