You are here

cleantalk.install in Anti Spam by CleanTalk 8

Install and uninstall functions, schema definition for the CleanTalk module.

File

cleantalk.install
View source
<?php

/**
 * @file
 * Install and uninstall functions, schema definition for the CleanTalk module.
 */

/**
 * Implements hook_schema().
 */
function cleantalk_schema() {
  $schema['cleantalk_timelabels'] = array(
    'description' => 'Timelabels for admin notification sending.',
    'fields' => array(
      'ct_key' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Notification ID.',
      ),
      'ct_value' => array(
        'type' => 'int',
        'length' => 12,
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Time of last notification.',
      ),
    ),
    'primary key' => array(
      'ct_key',
    ),
  );
  $schema['cleantalk_cids'] = array(
    'description' => 'Comment checking results - CIDs and server responces.',
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'length' => 12,
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'ID of checked comment.',
      ),
      'ct_request_id' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'CleanTalk request ID for comment.',
      ),
      'ct_result_comment' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'CleanTalk result for comment.',
      ),
    ),
    'primary key' => array(
      'cid',
    ),
  );
  $schema['cleantalk_uids'] = array(
    'description' => 'New user checking results - UIDs and server responces.',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'length' => 12,
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'ID of checked user registration.',
      ),
      'ct_request_id' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'CleanTalk request ID for user registration.',
      ),
      'ct_result_comment' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
        'description' => 'CleanTalk result for user registration.',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function cleantalk_uninstall() {

  /*\Drupal::config('cleantalk.settings')->clear('cleantalk_automod')->save();
    \Drupal::config('cleantalk.settings')->clear('cleantalk_comments')->save();
    \Drupal::config('cleantalk.settings')->clear('cleantalk_authkey')->save();
    \Drupal::config('cleantalk.settings')->clear('cleantalk_ccf')->save();
    // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/cleantalk.settings.yml and config/schema/cleantalk.schema.yml.
  \Drupal::config('cleantalk.settings')->get('cleantalk_work_url');
    // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/cleantalk.settings.yml and config/schema/cleantalk.schema.yml.
  \Drupal::config('cleantalk.settings')->get('cleantalk_server_url');
    // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/cleantalk.settings.yml and config/schema/cleantalk.schema.yml.
  \Drupal::config('cleantalk.settings')->get('cleantalk_server_ttl');
    // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/cleantalk.settings.yml and config/schema/cleantalk.schema.yml.
  \Drupal::config('cleantalk.settings')->get('cleantalk_server_changed');*/
}

Functions

Namesort descending Description
cleantalk_schema Implements hook_schema().
cleantalk_uninstall Implements hook_uninstall().