我刚开始使用 ZF2 ...我想初始化cache
并session
在配置文件中使用它,并且能够使用服务管理器在应用程序(每个地方)中使用它,或者......我已经在谷歌搜索了几个小时而没有锁定.. . 在文档中找不到任何有用的东西并且...
我在module.config.php(应用程序模块)中试过这个:
'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
),
),
我收到了这个错误:While attempting to create cache(alias: cache) an invalid factory was registered for this instance type.
那么有效的工厂是什么?所以任何人都可以在这里帮助我吗?坦克...