protected function FlysystemPluginManager::alterDefinitions in Flysystem 8
Same name and namespace in other branches
- 3.x src/Plugin/FlysystemPluginManager.php \Drupal\flysystem\Plugin\FlysystemPluginManager::alterDefinitions()
- 2.0.x src/Plugin/FlysystemPluginManager.php \Drupal\flysystem\Plugin\FlysystemPluginManager::alterDefinitions()
- 3.0.x src/Plugin/FlysystemPluginManager.php \Drupal\flysystem\Plugin\FlysystemPluginManager::alterDefinitions()
Invokes the hook to alter the definitions if the alter hook is set.
Parameters
$definitions: The discovered plugin definitions.
Overrides DefaultPluginManager::alterDefinitions
File
- src/
Plugin/ FlysystemPluginManager.php, line 41
Class
- FlysystemPluginManager
- Manages Flysystem plugins.
Namespace
Drupal\flysystem\PluginCode
protected function alterDefinitions(&$definitions) {
// Remove definitions that are missing necessary extensions.
foreach ($definitions as $id => $definition) {
foreach ($definition['extensions'] as $extension) {
if (extension_loaded($extension)) {
continue;
}
unset($definitions[$id]);
break;
}
}
parent::alterDefinitions($definitions);
}