libraries.install in Libraries API 8.3
Same filename and directory in other branches
Containsinstall, uninstall and update functions for Libraries API.
File
libraries.installView 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
Name | Description |
---|---|
libraries_install | Implements hook_install(). |
libraries_uninstall | Implements hook_uninstall(). |