i just started working with ZF2 …
i want to initialize cache and session in config file and be able too use it in the application ( every where ) either using service manager or … i have been searching Google for hours with no lock … couldn’t find anything useful in the documentations and …
i tried this in module.config.php(Application module):
'service_manager' => array(
'factories' => array(
'cache' => '\Zend\Cache\StorageFactory',
),
),
'cache' => array(
'storage' => array(
'adapter' => 'Filesystem',
'options' => array(
'cache_dir' => __DIR__ . '/../../../data/cache'
),
),
'plugins' => array('WriteControl', 'IgnoreUserAbort'),
'options' => array(
'removeOnFailure' => true,
'exitOnAbort' => true,
'ttl' => 100
),
),
i got this error : While attempting to create cache(alias: cache) an invalid factory was registered for this instance type.
so whats the valid factory ?
so any one can help me out here ?
tanks…
Use a closure as factory instead because
Zend\Cache\StorageFactorydoesn’t implementZend\ServiceManager\FactoryInterfaceBtw. clean up your cache configuration and where you get the plugin in
WriteControland the optionremoveOnFailurefrom?