public function WebformLibrariesManager::isExcluded in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformLibrariesManager.php \Drupal\webform\WebformLibrariesManager::isExcluded()
Determine if library is excluded.
Parameters
string $name: The name of the library.
Return value
bool TRUE if library is excluded.
Overrides WebformLibrariesManagerInterface::isExcluded
2 calls to WebformLibrariesManager::isExcluded()
- WebformLibrariesManager::isIncluded in src/
WebformLibrariesManager.php - Determine if library is included.
- WebformLibrariesManager::requirements in src/
WebformLibrariesManager.php - Get third party libraries status for hook_requirements and drush.
File
- src/
WebformLibrariesManager.php, line 253
Class
- WebformLibrariesManager
- Webform libraries manager.
Namespace
Drupal\webformCode
public function isExcluded($name) {
$excluded_libraries = $this
->getExcludedLibraries();
if (empty($excluded_libraries)) {
return FALSE;
}
if (isset($excluded_libraries[$name])) {
return TRUE;
}
if (strpos($name, 'libraries.') !== 0 && strpos($name, 'webform/libraries.') !== 0) {
return FALSE;
}
$parts = explode('.', preg_replace('#^(webform/)?libraries.#', '', $name));
while ($parts) {
if (isset($excluded_libraries[implode('.', $parts)])) {
return TRUE;
}
array_pop($parts);
}
return FALSE;
}