function imageinfo_cache_requirements in Imageinfo Cache 6.2
Implementation of hook_requirements().
File
- ./
imageinfo_cache.install, line 49 - Handles Imageinfo Cache installation and upgrade tasks.
Code
function imageinfo_cache_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time
$t = get_t();
if ($phase == 'runtime' || $phase == 'install') {
// Check that the function exists.
if (!function_exists('imagecache_generate_image')) {
$requirements['imageinfo_cache_version'] = array(
'title' => $t('Imageinfo Cache'),
'value' => $phase == 'install' ? FALSE : 'imagecache_generate_image',
'severity' => REQUIREMENT_ERROR,
'description' => $t('The verson of <a href="http://drupal.org/project/imagecache">ImageCache</a> installed is old. Please update to at least 6.x-2.0-beta12'),
);
}
}
if (empty($requirements)) {
$requirements['imageinfo_cache'] = array(
'title' => $t('Imageinfo Cache'),
'severity' => REQUIREMENT_OK,
'value' => $phase == 'install' ? TRUE : $t('The version of ImageCache is 6.x-2.0-beta12 or greater.'),
);
}
return $requirements;
}