-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimagemagick.install
61 lines (52 loc) · 1.61 KB
/
imagemagick.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
<?php
/**
* @file
* Installation functions for ImageMagick module.
*/
/**
* Implements hook_install().
*/
function imagemagick_install() {
// Migrate ImageAPI ImageMagick variables upon installation.
$value = variable_get('imageapi_imagemagick_quality', NULL);
if (!empty($value)) {
variable_set('imagemagick_quality', $value);
}
variable_del('imageapi_imagemagick_quality');
$value = variable_get('imageapi_imagemagick_convert', NULL);
if (!empty($value)) {
variable_set('imagemagick_convert', $value);
// If we have a convert path and previous toolkit was ImageAPI's
// ImageMagick, also switch the toolkit.
$value = variable_get('image_toolkit', 'gd');
if ($value == 'imageapi_imagemagick') {
variable_set('image_toolkit', 'imagemagick');
}
}
variable_del('imageapi_imagemagick_convert');
$value = variable_get('imageapi_imagemagick_debugging', NULL);
if (!empty($value)) {
variable_set('imagemagick_debug', $value);
}
variable_del('imageapi_imagemagick_debugging');
// Disable ImageAPI ImageMagick module if it is enabled to avoid confusion.
if (module_exists('imageapi_imagemagick')) {
module_disable(array('imageapi_imagemagick'));
drupal_set_message(t('ImageAPI ImageMagick module has been disabled.'));
}
}
/**
* Implements hook_uninstall().
*/
function imagemagick_uninstall() {
variable_del('imagemagick_quality');
variable_del('imagemagick_convert');
variable_del('imagemagick_debug');
variable_del('imagemagick_gm');
}
/**
* Implements hook_update_last_removed().
*/
function imagemagick_update_last_removed() {
return 7000;
}