capgemini / drupal_doctrine_cache
使用Drupal缓存API实现doctrine缓存的机制。
0.0.2
2015-05-21 06:44 UTC
Requires
- php: >=5.4.0
- doctrine/common: 2.4.*
Requires (Dev)
- phpunit/phpunit: ~4.6
This package is not auto-updated.
Last update: 2024-09-14 15:01:59 UTC
README
此存储库提供了一种Doctrine缓存,它将使用Drupal 6/7的缓存API进行存储。
使用起来相当简单,只需将新的缓存实例配置到EntityManager中即可。
$cache = new \Capgemini\Cache\DrupalDoctrineCache();
$entityManagerConfiguration->setMetaDataCacheImpl($cache);
$entityManagerConfiguration->setQueryCacheImpl($cache);
$entityManagerConfiguration->setResultCacheImpl($cache);
默认情况下,缓存将使用'cache'表。您可以更改此设置:
$cache->setCacheTable('my_cache_table');
显然,您需要确保该表存在并且可以被Drupal缓存API使用。