Aleksander Machniak
2012-07-09 329eae0abd8fd3297e90577d7922864ce8078571
Fix debugging in sqlite driver
2 files modified
20 ■■■■ changed files
program/include/rcube_db.php 16 ●●●● patch | view | raw | blame | history
program/include/rcube_db_sqlite.php 4 ●●● patch | view | raw | blame | history
program/include/rcube_db.php
@@ -252,6 +252,18 @@
    }
    /**
     * Writes debug information/query to 'sql' log file
     *
     * @param string $query SQL query
     */
    protected function debug($query)
    {
        if ($this->options['debug_mode']) {
            rcube::write_log('sql', '[' . (++$this->db_index) . '] ' . $query . ';');
        }
    }
    /**
     * Getter for error state
     *
     * @return boolean True on error
@@ -378,9 +390,7 @@
        $query = rtrim($query, ';');
        if ($this->options['debug_mode']) {
            rcube::write_log('sql', '[' . (++$this->db_index) . '] ' . $query . ';');
        }
        $this->debug($query);
        $query = $this->dbh->query($query);
program/include/rcube_db_sqlite.php
@@ -63,9 +63,7 @@
            $data = file_get_contents(INSTALL_PATH . 'SQL/sqlite.initial.sql');
            if (strlen($data)) {
                if ($this->options['debug_mode']) {
                    $this::debug('INITIALIZE DATABASE');
                }
                $this->debug('INITIALIZE DATABASE');
                $q = $dbh->exec($data);