forked from Islandora/islandora_solution_pack_large_image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathislandora_large_image.install
57 lines (49 loc) · 1.44 KB
/
islandora_large_image.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
<?php
/**
* @file
* islandora_large_image.install
*/
/**
* Implements hook_requirements().
*/
function islandora_large_image_requirements($phase) {
module_load_include('inc', 'islandora', 'includes/utilities');
$requirements = array();
if ($phase == 'install') {
$t = get_t();
$out = array();
$ret = 1;
$command = 'command -v kdu_compress >/dev/null 2>&1';
if (islandora_deployed_on_windows()) {
$command = 'kdu_compress >NUL 2>&1';
}
exec($command, $out, $ret);
if ($ret != 0) {
$requirements['kakadu'] = array(
'title' => $t("Kakadu Image Compression"),
'value' => $t("Not installed"),
'severity' => REQUIREMENT_ERROR,
'description' => $t('Ensure that adore-djatoka is installed and that kdu_compress is accessible by PHP.'),
);
}
}
return $requirements;
}
/**
* Implements hook_install().
*
* @see islandora_large_image_islandora_required_objects()
*/
function islandora_large_image_install() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora_large_image');
}
/**
* Implements hook_uninstall().
*/
function islandora_large_image_uninstall() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('islandora_large_image', 'uninstall');
$variables = array('islandora_large_image_viewers');
array_walk($variables, 'variable_del');
}