| | |
| | | |
| | | /** |
| | | +-----------------------------------------------------------------------+ |
| | | | program/include/rcube_db_mysql.php | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2012, The Roundcube Dev Team | |
| | | | | |
| | |
| | | | PURPOSE: | |
| | | | Database wrapper class that implements PHP PDO functions | |
| | | | for MySQL database | |
| | | | | |
| | | +-----------------------------------------------------------------------+ |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | +-----------------------------------------------------------------------+ |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * Database independent query interface |
| | |
| | | */ |
| | | protected function init() |
| | | { |
| | | if (version_compare(PHP_VERSION, '5.3.0', '<')) { |
| | | rcube::raise_error(array('code' => 600, 'type' => 'db', |
| | | 'line' => __LINE__, 'file' => __FILE__, |
| | | 'message' => "MySQL driver requires PHP >= 5.3, current version is " . PHP_VERSION), |
| | | true, true); |
| | | } |
| | | |
| | | // SQL identifiers quoting |
| | | $this->options['identifier_start'] = '`'; |
| | | $this->options['identifier_end'] = '`'; |
| | |
| | | // Always return matching (not affected only) rows count |
| | | $result[PDO::MYSQL_ATTR_FOUND_ROWS] = true; |
| | | |
| | | // Enable AUTOCOMMIT mode (#1488902) |
| | | $dsn_options[PDO::ATTR_AUTOCOMMIT] = true; |
| | | |
| | | return $result; |
| | | } |
| | | |
| | |
| | | |
| | | $result = $this->query('SHOW VARIABLES'); |
| | | |
| | | while ($sql_arr = $this->fetch_array($result)) { |
| | | while ($row = $this->fetch_array($result)) { |
| | | $this->variables[$row[0]] = $row[1]; |
| | | } |
| | | } |