livechat.install in LiveChat 8
Same filename and directory in other branches
Installation file for the LiveChat module.
File
livechat.installView source
<?php
/**
* @file
* Installation file for the LiveChat module.
*/
use Drupal\Core\Url;
function livechat_requirements($phase) {
$requirements = [];
if ($phase == 'runtime') {
// Raise warning if a LiveChat license has not been installed yet.
if (!livechat_is_installed()) {
$requirements['livechat'] = [
'title' => t('LiveChat'),
'description' => t('A LiveChat license has not been installed. Please go to <a href="@url">LiveChat settings</a>.', [
'@url' => Url::fromRoute('livechat.license')
->toString(),
]),
'severity' => REQUIREMENT_ERROR,
'value' => t('Not configured'),
];
}
}
return $requirements;
}
/**
* Implements hook_uninstall().
*/
function livechat_uninstall() {
$config_factory = \Drupal::configFactory();
$config_factory
->getEditable('livechat.configuration')
->delete();
}
Functions
Name | Description |
---|---|
livechat_requirements | |
livechat_uninstall | Implements hook_uninstall(). |