2
// $Id: imageapi.install,v 1.7 2008/12/21 23:08:39 drewish Exp $
6
* Implementation of hook_requirements().
8
function imageapi_requirements($phase) {
9
$requirements = array();
10
// Ensure translations don't break at install time.
13
// Check this at runtime rather than install time because the order of
14
// installation doesn't take dependencies into account. ImageAPI may have
15
// been installed by not loaded and if we report a requirement error
16
// because we can't find its function or no toolkit is enabled modules that
17
// depend on us will still be enabled but will have a missing dependency.
18
// Seems like a better idea to let everything get enabled and then inform
19
// them of the problem.
20
if ($phase == 'runtime') {
21
if (count(imageapi_get_available_toolkits()) == 0) {
22
$requirements['imageapi_toolkits'] = array(
23
'title' => $t('ImageAPI Toolkit'),
24
'value' => $t('No ImageAPI toolkits available'),
25
'severity' => REQUIREMENT_ERROR,
26
'description' => $t('ImageAPI requires a Toolkit such as ImageAPI GD or ImageAPI ImageMagick to function. Go to !modules and enable one of them.', array('!modules' => l('admin/build/modules', 'admin/build/modules'))),
33
function imageapi_install() {
37
* Implementation of hook_uninstall().
40
function imageapi_uninstall() {
41
variable_del('imageapi_image_toolkit');