/**
  * Enable the query cache
  * 
  * This does not take precedence over the Elgg_Database_Config setting.
  * 
  * @return void
  */
 public function enableQueryCache()
 {
     if ($this->config->isQueryCacheEnabled() && $this->queryCache === null) {
         // @todo if we keep this cache, expose the size as a config parameter
         $this->queryCache = new Elgg_Cache_LRUCache($this->queryCacheSize);
     }
 }
Beispiel #2
0
 /**
  * Constructor
  *
  * @param Elgg_Database_Config $config Database configuration
  * @param Elgg_Logger          $logger The logger
  */
 public function __construct(Elgg_Database_Config $config, Elgg_Logger $logger)
 {
     $this->logger = $logger;
     $this->config = $config;
     $this->tablePrefix = $config->getTablePrefix();
     if ($config->isQueryCacheEnabled()) {
         // @todo if we keep this cache in 1.9, expose the size as a config parameter
         $this->queryCache = new Elgg_Cache_LRUCache(200);
     }
 }