You are here

libraries.install in Libraries API 8.3

Same filename and directory in other branches
  1. 7.3 libraries.install
  2. 7.2 libraries.install

Containsinstall, uninstall and update functions for Libraries API.

File

libraries.install
View source
<?php

/**
 * @file
 * Containsinstall, uninstall and update functions for Libraries API.
 */
use Drupal\libraries\ExternalLibrary\Definition\FileDefinitionDiscovery;

/**
 * Implements hook_install().
 */
function libraries_install() {
  if (!is_dir('public://library-definitions')) {

    /** @var \Drupal\Core\File\FileSystemInterface $file_system */
    $file_system = \Drupal::service('file_system');
    $file_system
      ->mkdir('public://library-definitions');
  }
}

/**
 * Implements hook_uninstall().
 */
function libraries_uninstall() {
  if (is_dir('public://library-definitions')) {
    \Drupal::service('file_system')
      ->deleteRecursive('public://library-definitions');
  }
}

Functions

Namesort descending Description
libraries_install Implements hook_install().
libraries_uninstall Implements hook_uninstall().