1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Install, update and uninstall functions for the module_test module.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Implements hook_schema().
|
10 |
|
|
*/
|
11 |
|
|
function module_test_schema() {
|
12 |
|
|
$schema['module_test'] = array(
|
13 |
|
|
'description' => 'Dummy table to test the behavior of hook_schema() during module installation.',
|
14 |
|
|
'fields' => array(
|
15 |
|
|
'data' => array(
|
16 |
|
|
'type' => 'varchar',
|
17 |
|
|
'length' => 255,
|
18 |
|
|
'not null' => TRUE,
|
19 |
|
|
'default' => '',
|
20 |
|
|
'description' => 'An example data column for the module.',
|
21 |
|
|
),
|
22 |
|
|
),
|
23 |
|
|
);
|
24 |
|
|
return $schema;
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
/**
|
28 |
|
|
* Implements hook_install().
|
29 |
|
|
*/
|
30 |
|
|
function module_test_install() {
|
31 |
|
|
$record = array('data' => 'Data inserted in hook_install()');
|
32 |
|
|
drupal_write_record('module_test', $record);
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
/**
|
36 |
|
|
* Implements hook_enable().
|
37 |
|
|
*/
|
38 |
|
|
function module_test_enable() {
|
39 |
|
|
$record = array('data' => 'Data inserted in hook_enable()');
|
40 |
|
|
drupal_write_record('module_test', $record);
|
41 |
|
|
}
|