diff --git a/docs/bookdown.json b/docs/bookdown.json deleted file mode 100644 index 12e8548a..00000000 --- a/docs/bookdown.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "title": "Laminas\\Cache", - "target": "html/", - "content": [ - "book/laminas.cache.storage.adapter.md", - "book/laminas.cache.storage.capabilities.md", - "book/laminas.cache.storage.plugin.md", - "book/laminas.cache.pattern.md", - "book/laminas.cache.pattern.callback-cache.md", - "book/laminas.cache.pattern.object-cache.md", - "book/laminas.cache.pattern.output-cache.md", - "book/laminas.cache.pattern.capture-cache.md", - "book/laminas.cache.psr.cacheitempooladapter.md" - ] -} diff --git a/src/ConfigProvider.php b/src/ConfigProvider.php index 1ca4acac..19fddb36 100644 --- a/src/ConfigProvider.php +++ b/src/ConfigProvider.php @@ -16,6 +16,8 @@ class ConfigProvider { + public const ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY = 'storage_adapters'; + /** * Return default configuration for laminas-cache. * diff --git a/src/Service/StorageAdapterPluginManagerFactory.php b/src/Service/StorageAdapterPluginManagerFactory.php index c257ca42..1e9535a3 100644 --- a/src/Service/StorageAdapterPluginManagerFactory.php +++ b/src/Service/StorageAdapterPluginManagerFactory.php @@ -1,14 +1,45 @@ has('config')) { + return $pluginManager; + } + + $config = $container->get('config'); + + // If we do not have a configuration, nothing more to do + if ( + ! isset($config[ConfigProvider::ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY]) + || ! is_array($config[ConfigProvider::ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY]) + ) { + return $pluginManager; + } + + // Wire service configuration + /** @var ServiceManagerConfiguration $config */ + $config = $config[ConfigProvider::ADAPTER_PLUGIN_MANAGER_CONFIGURATION_KEY]; + $pluginManager->configure($config); + + return $pluginManager; } }