-
-
Notifications
You must be signed in to change notification settings - Fork 58
Standalone example in README.md does not work #285
Copy link
Copy link
Open
Labels
Description
Bug Report
| Q | A |
|---|---|
| Version(s) | * since it was added |
Summary
The README.md example does not work due to the lack of the ConfigProvider of the memory adapter being passed to the ConfigAggregator.
Current behavior
Execution will fail, Memory adapter is not retrievable.
How to reproduce
use Laminas\Cache\ConfigProvider;
use Laminas\Cache\Service\StorageAdapterFactoryInterface;
use Laminas\Cache\Storage\Adapter\Memory;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ServiceManager\ServiceManager;
$config = (new ConfigAggregator([
ConfigProvider::class,
]))->getMergedConfig();
$dependencies = $config['dependencies'];
$container = new ServiceManager($dependencies);
/** @var StorageAdapterFactoryInterface $storageFactory */
$storageFactory = $container->get(StorageAdapterFactoryInterface::class);
$storage = $storageFactory->create(Memory::class); // ServiceNotFoundExceptionExpected behavior
$storage variable contains an instance of the Memory adapter.
Reactions are currently unavailable