class LibrariesUiService in Libraries UI 8
Class LibrariesUiService.
@package Drupal\libraries_ui
Hierarchy
- class \Drupal\libraries_ui\LibrariesUiService
Expanded class hierarchy of LibrariesUiService
1 string reference to 'LibrariesUiService'
1 service uses LibrariesUiService
File
- src/
LibrariesUiService.php, line 11
Namespace
Drupal\libraries_uiView source
class LibrariesUiService {
public function getAllLibraries() {
$modules = \Drupal::service('module_handler')
->getModuleList();
$themes = \Drupal::service('theme_handler')
->rebuildThemeData();
$libraryDiscovery = \Drupal::service('library.discovery');
$extensions = array_merge($modules, $themes);
$root = \Drupal::root();
foreach ($extensions as $extension_name => $extension) {
$library_file = $extension
->getPath() . '/' . $extension_name . '.libraries.yml';
if (is_file($root . '/' . $library_file)) {
$libraries[$extension_name] = $libraryDiscovery
->getLibrariesByExtension($extension_name);
}
}
return $libraries;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LibrariesUiService:: |
public | function |