You are here

livechat.install in LiveChat 8

Same filename and directory in other branches
  1. 8.3 livechat.install
  2. 8.2 livechat.install
  3. 7 livechat.install

Installation file for the LiveChat module.

File

livechat.install
View 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