View source
<?php
function gm3_requirements($phase) {
module_load_include('module', 'gm3');
$geophp = gm3_load_geophp();
if ($geophp) {
try {
$geophp_version = geoPHP::version();
} catch (Exception $e) {
$geophp_version = 0;
}
if ($geophp_version >= 0.4) {
return array(
'gm3_geophp' => array(
'title' => t('GeoPHP Library'),
'severity' => REQUIREMENT_OK,
'value' => $geophp_version,
),
);
}
elseif ($geophp_version >= 0.3) {
return array(
'gm3_geophp' => array(
'title' => t('GeoPHP Library'),
'severity' => REQUIREMENT_INFO,
'value' => $geophp_version,
'description' => t('GeoPHP library was found, but you are running an old version. The version you are running is compatible, but it is not current, possibly leading to problems.'),
),
);
}
else {
return array(
'gm3_geophp' => array(
'title' => t('GeoPHP Library'),
'severity' => REQUIREMENT_ERROR,
'value' => $geophp_version,
'description' => t('GeoPHP library was found, but you are running an old version. This will lead to problems when working with GM3. Please download %link and update.', array(
'%link' => 'https://github.com/downloads/phayes/geoPHP/geoPHP.tar.gz',
)),
),
);
}
}
else {
return array(
'gm3_geophp' => array(
'title' => t('GeoPHP Library'),
'severity' => REQUIREMENT_ERROR,
'description' => t('GeoPHP library was not found. This will lead to problems when working with GM3. Please download from %link and install.', array(
'%link' => 'https://github.com/downloads/phayes/geoPHP/geoPHP.tar.gz',
)),
),
);
}
}