You are here

function hook_libraries_info_alter in Libraries API 8.3

Same name and namespace in other branches
  1. 7.3 libraries.api.php \hook_libraries_info_alter()
  2. 7.2 libraries.api.php \hook_libraries_info_alter()

Alter the library information before detection and caching takes place.

The library definitions are passed by reference. A common use-case is adding a module's integration files to the library array, so that the files are loaded whenever the library is. As noted above, it is important to declare integration files inside of an array, whose key is the module name.

Deprecated

Will be removed before a stable Drupal 8 release.

See also

hook_libraries_info()

1 invocation of hook_libraries_info_alter()
libraries_info in ./libraries.module
Returns information about registered libraries.

File

./libraries.api.php, line 579
Documents API functions for Libraries module.

Code

function hook_libraries_info_alter(&$libraries) {
  $files = [
    'php' => [
      'example_module.php_spellchecker.inc',
    ],
  ];
  $libraries['php_spellchecker']['integration files']['example_module'] = $files;
}