我正在尝试使用以下代码在 Symfony 1.4 中设置学说 sqlite 缓存:
$cacheConn = Doctrine_Manager::connection( new PDO( 'sqlite::memory:' ) );
$cacheDriver = new Doctrine_Cache_Db( array( 'connection' => $cacheConn, 'tableName' => 'cache' ) );
$cacheDriver->createTable();
$manager->setAttribute( Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver );
$manager->setAttribute( Doctrine_Core::ATTR_RESULT_CACHE, $cacheDriver );
$manager->setAttribute( Doctrine_Core::ATTR_CACHE_LIFESPAN, 60 * 5 );
$manager->setAttribute( Doctrine_Core::ATTR_RESULT_CACHE_LIFESPAN, 60 * 5 );
我没有看到任何错误,但脚本执行时间与没有缓存时完全相同。如何检查缓存是否实际工作?