コード例 #1
0
ファイル: Connection.php プロジェクト: rborgesds/FluxCP
 /**
  * Get the PDO instance for the logs database server connection.
  *
  * @return PDO
  * @access private
  */
 private function getLogsConnection()
 {
     if (!$this->pdoLogs) {
         // Establish separate connection just for the log database.
         $pdoLogs = $this->connect($this->logsDbConfig);
         $this->pdoLogs = $pdoLogs;
         if ($encoding = $this->logsDbConfig->getEncoding()) {
             $sth = $this->getStatementForLogs("SET NAMES ?");
             $sth->execute(array($encoding));
         }
         if ($timezone = $this->logsDbConfig->getTimezone()) {
             $sth = $this->getStatementForLogs("SET time_zone = ?");
             $sth->execute(array($timezone));
         }
     }
     return $this->pdoLogs;
 }