You are here

livechat.install in LiveChat 8.3

Same filename and directory in other branches
  1. 8 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.
 */

/**
 * Implements hook_requirements().
 */
function livechat_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime' && !\Drupal::config('livechat.settings')
    ->get('licence_number', FALSE)) {
    $requirements['livechat'] = [
      'title' => t('LiveChat module'),
      'description' => t('LiveChat module has not been configured yet. Please configure its settings from the <a href=":url">LiveChat settings page</a>.', [
        ':url' => \Drupal::url('livechat.settings'),
      ]),
      'severity' => REQUIREMENT_ERROR,
      'value' => t('Not configured'),
    ];
  }
  return $requirements;
}

/**
 * Implements hook_uninstall().
 */
function livechat_uninstall() {
  $config_factory = \Drupal::configFactory();
  $config_factory
    ->getEditable('livechat.settings')
    ->delete();
}

Functions