View source
<?php
define('MYLIVECHAT_PHP_VERSION', '5.0');
function mylivechat_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'install') {
$requirements['php'] = array(
'title' => $t('PHP'),
'value' => $phase == 'runtime' ? l(phpversion(), 'admin/logs/status/php') : phpversion(),
);
if (version_compare(PHP_VERSION, MYLIVECHAT_PHP_VERSION) < 0) {
$requirements['php']['description'] = $t('Your PHP installation is too old. LiveChat requires at least PHP %version.', array(
'%version' => MYLIVECHAT_PHP_VERSION,
));
$requirements['php']['severity'] = REQUIREMENT_ERROR;
}
}
elseif ($phase == 'runtime') {
$mylivechat = mylivechat::get_instance();
if ($mylivechat
->is_installed() == FALSE) {
$requirements['mylivechat'] = array(
'title' => t('MyLiveChat'),
'description' => t('MyLiveChat is not properly configured. Please go to <a href="@url">MyLiveChat settings</a>.', array(
'@url' => url('admin/settings/mylivechat'),
)),
'severity' => REQUIREMENT_ERROR,
'value' => t('Not configured'),
);
}
}
return $requirements;
}
function mylivechat_install() {
}
function mylivechat_uninstall() {
db_delete('variable')
->condition('name', 'mylivechat_%', 'LIKE')
->execute();
}