/**
  * 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();
     $this->enableQueryCache();
 }
 public function testGetTablePrefix()
 {
     $CONFIG = new stdClass();
     $CONFIG->dbprefix = "foo";
     $conf = new Elgg_Database_Config($CONFIG);
     $this->assertEquals($CONFIG->dbprefix, $conf->getTablePrefix());
 }
Esempio n. 3
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);
     }
 }