You are here

search_api_attachments.install in Search API attachments 8

Same filename and directory in other branches
  1. 7 search_api_attachments.install
  2. 9.0.x search_api_attachments.install

Install and update functions for the search_api_attachments module.

File

search_api_attachments.install
View source
<?php

/**
 * @file
 * Install and update functions for the search_api_attachments module.
 */

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

  // Remove collection search_api_attachments.
  \Drupal::keyValue('search_api_attachments')
    ->deleteAll();
}

/**
 * Add path configuration for pdftotext_extractor.
 */
function search_api_attachments_update_8001() {
  \Drupal::configFactory()
    ->getEditable('search_api_attachments.admin_config')
    ->set('pdftotext_extractor_configuration.pdftotext_path', 'pdftotext')
    ->save();
}

/**
 * Add configuration for tika_server_extractor.
 */
function search_api_attachments_update_8002() {
  \Drupal::configFactory()
    ->getEditable('search_api_attachments.admin_config')
    ->set('tika_server_extractor_configuration.scheme', 'http')
    ->set('tika_server_extractor_configuration.host', 'localhost')
    ->set('tika_server_extractor_configuration.port', '9998')
    ->set('tika_server_extractor_configuration.timeout', '5')
    ->save();
}

Functions

Namesort descending Description
search_api_attachments_uninstall Implements hook_uninstall().
search_api_attachments_update_8001 Add path configuration for pdftotext_extractor.
search_api_attachments_update_8002 Add configuration for tika_server_extractor.