protected LibraryDependencyResolver::doGetDependencies(array $libraries_with_unresolved_dependencies, array $final_libraries = [])
Gets the given libraries with its dependencies.
Helper method for ::getLibrariesWithDependencies().
Parameters
string[] $libraries_with_unresolved_dependencies: A list of libraries, with unresolved dependencies, in the order they should be loaded.
string[] $final_libraries: The final list of libraries (the return value) that is being built recursively.
Return value
string[] A list of libraries, in the order they should be loaded, including their dependencies.
File
- core/lib/Drupal/Core/Asset/LibraryDependencyResolver.php, line 50
Class
- LibraryDependencyResolver
- Resolves the dependencies of asset (CSS/JavaScript) libraries.
Namespace
Drupal\Core\Asset
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 | protected function doGetDependencies( array $libraries_with_unresolved_dependencies , array $final_libraries = []) { foreach ( $libraries_with_unresolved_dependencies as $library ) { if (!in_array( $library , $final_libraries )) { list( $extension , $name ) = explode ( '/' , $library , 2); $definition = $this ->libraryDiscovery->getLibraryByName( $extension , $name ); if (! empty ( $definition [ 'dependencies' ])) { $final_libraries = $this ->doGetDependencies( $definition [ 'dependencies' ], $final_libraries ); } $final_libraries [] = $library ; } } return $final_libraries ; } |
Please login to continue.