forked from Islandora/islandora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora.install
146 lines (136 loc) · 4.24 KB
/
islandora.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* @file
* This file contains all install related hooks.
*/
/**
* Implements hook_requirements().
*/
function islandora_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time.
$t = get_t();
if (!class_exists('XSLTProcessor', FALSE)) {
$requirements['islandora_xsltprocessor']['title'] = $t('Islandora XSLTProcessor Prerequisite');
$requirements['islandora_xsltprocessor']['value'] = $t('Not installed');
$link = l($t('PHP XSL extension'), 'http://us2.php.net/manual/en/book.xsl.php', array('attributes' => array('target' => '_blank')));
$requirements['islandora_xsltprocessor']['description'] = $t('The !xsllink is required. Check your installed PHP extensions and php.ini file.', array('!xsllink' => $link));
$requirements['islandora_xsltprocessor']['severity'] = REQUIREMENT_ERROR;
}
return $requirements;
}
/**
* Implements hook_install().
*
* @see islandora_islandora_required_objects()
*/
function islandora_install() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora');
}
/**
* Implements hook_uninstall().
*
* @see islandora_islandora_required_objects()
*/
function islandora_uninstall() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora', 'uninstall');
// Add new variables to clean up.
$variables = array(
'islandora_ds_replace_exclude_enforced',
'islandora_defer_derivatives_on_ingest',
'islandora_base_url',
'islandora_repository_pid',
'islandora_use_datastream_cache_headers',
'islandora_show_print_option',
'islandora_render_drupal_breadcrumbs',
'islandora_namespace_restriction_enforced',
'islandora_pids_allowed',
'islandora_risearch_use_itql_when_necessary',
'islandora_use_object_semaphores',
'islandora_semaphore_period',
'islandora_require_obj_upload',
'islandora_breadcrumbs_backends',
'islandora_render_context_ingeststep',
'islandora_deny_inactive_and_deleted',
);
array_walk($variables, 'variable_del');
}
/**
* Implements hook_schema().
*/
function islandora_schema() {
$schema['islandora_authtokens'] = array(
'description' => 'The hub for all islandora authentication tokens',
'fields' => array(
'id' => array(
'description' => 'key',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'token' => array(
'description' => 'a unique identifier for this token',
'type' => 'varchar',
'length' => 64,
),
'remaining_uses' => array(
'description' => 'How many uses until this should be removed',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'uid' => array(
'description' => 'the user id that requested this token',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'time' => array(
'description' => 'when this token was created',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'pid' => array(
'description' => 'the pid of the object this token unlocks',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'dsid' => array(
'description' => 'the datasteram id of the object this token unlocks',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
),
),
'unique keys' => array(
'id' => array('id'),
),
'primary key' => array('id'),
);
return $schema;
}
/**
* Implements hook_update_N().
*
* Add the required table for handling authentication tokens.
* This is the first instance that has this table.
*/
function islandora_update_7001(&$sandbox) {
drupal_install_schema('islandora');
$t = get_t();
return $t("Islandora database updates complete");
}
/**
* Implements hook_update_N().
*
* Removing old variable around changes to ingestDatastream signature.
* These changes are complete and deprecation warnings are removed.
*/
function islandora_update_7002() {
// Removing as the deprecation has been removed.
variable_del('islandora_deprecation_return_false_when_datastream_exists');
}