Aleksander Machniak
2013-05-20 bec9690ff519d33d7ef3f0c8f8f8cf72b4ef059d
program/lib/Roundcube/rcube_db.php
@@ -47,6 +47,7 @@
        'identifier_end'   => '"',
    );
    const DEBUG_LINE_LENGTH = 4096;
    /**
     * Factory, returns driver-specific instance of the class
@@ -128,7 +129,7 @@
        $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;
        }
@@ -255,6 +256,11 @@
    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 . ';');
        }
    }