示例#1
0
文件: Cache.php 项目: acp3/core
 /**
  * @return \Doctrine\Common\Cache\CacheProvider
  */
 public function getDriver()
 {
     if ($this->driver === null) {
         $this->driver = $this->cacheDriverFactory->create($this->namespace);
     }
     return $this->driver;
 }
示例#2
0
文件: Connection.php 项目: acp3/core
 /**
  * @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);
 }