实际上,我已经在projet zf2版本2.2.0上启用了memcache,并试图在版本为2.5.1的新项目zf2上执行此操作;我不能。在启用memcache时会使用ZF2的版本吗?
这里是我试过(module.config.php):
'service_manager' => array(
'abstract_factories' => array(
'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
'Zend\Log\LoggerAbstractServiceFactory',
),
'factories' => array(
'doctrine.cache.mycache' => function ($sm) {
$cache = new \Doctrine\Common\Cache\MemcacheCache();
$memcache = new \Memcache();
$memcache->connect('localhost', 11211);
$cache->setMemcache($memcache);
return $cache;
},
),
),
// Doctrine config
'doctrine' => array(
'driver' => array(
__NAMESPACE__ . '_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
),
),
),
/***** enabling the memcache ****/
'configuration' => array(
'orm_default' => array(
'metadata_cache' => 'memcache',
'query_cache' => 'memcache',
'result_cache' => 'memcache',
)
),
/**** end ****/
'cache' => array(
'memcache' => array(
'instance' => 'doctrine.cache.mycache',
),
),
),
什么我错过了?
谢谢。
错误信息是怎样的? – tookie009
Memcachee有一个'e'太多 –
@ tookie009没有消息,只是我看不到我试图存储在缓存中的数据。 – user3911183