Esempio n. 1
0
File: Cache.php Progetto: acp3/core
 /**
  * @return \Doctrine\Common\Cache\CacheProvider
  */
 public function getDriver()
 {
     if ($this->driver === null) {
         $this->driver = $this->cacheDriverFactory->create($this->namespace);
     }
     return $this->driver;
 }
Esempio n. 2
0
 /**
  * @throws \Doctrine\DBAL\DBALException
  */
 protected function connect()
 {
     $config = new DBAL\Configuration();
     if ($this->appMode === ApplicationMode::DEVELOPMENT) {
         $config->setSQLLogger(new SQLLogger($this->logger));
     }
     $config->setResultCacheImpl($this->cacheDriverFactory->create('db-queries'));
     return DBAL\DriverManager::getConnection($this->connectionParams, $config);
 }