| | |
| | | 'identifier_end' => '"', |
| | | ); |
| | | |
| | | const DEBUG_LINE_LENGTH = 4096; |
| | | |
| | | /** |
| | | * Factory, returns driver-specific instance of the class |
| | |
| | | $dsn_string = $this->dsn_string($dsn); |
| | | $dsn_options = $this->dsn_options($dsn); |
| | | |
| | | if ($db_pconn) { |
| | | if ($this->db_pconn) { |
| | | $dsn_options[PDO::ATTR_PERSISTENT] = true; |
| | | } |
| | | |
| | |
| | | protected function debug($query) |
| | | { |
| | | if ($this->options['debug_mode']) { |
| | | if (($len = strlen($query)) > self::DEBUG_LINE_LENGTH) { |
| | | $diff = $len - self::DEBUG_LINE_LENGTH; |
| | | $query = substr($query, 0, self::DEBUG_LINE_LENGTH) |
| | | . "... [truncated $diff bytes]"; |
| | | } |
| | | rcube::write_log('sql', '[' . (++$this->db_index) . '] ' . $query . ';'); |
| | | } |
| | | } |