Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
| 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 5.1.6 or newer |
| 6 | * |
Timothy Warren | d1a5ba2 | 2011-10-21 04:45:28 -0400 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
| 8 | * |
| 9 | * Licensed under the Open Software License version 3.0 |
| 10 | * |
| 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 19 | * @package CodeIgniter |
Timothy Warren | d1a5ba2 | 2011-10-21 04:45:28 -0400 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
Greg Aker | 0defe5d | 2012-01-01 18:46:41 -0600 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) |
Timothy Warren | d1a5ba2 | 2011-10-21 04:45:28 -0400 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 23 | * @link http://codeigniter.com |
Timothy Warren | 018af7a | 2011-09-07 12:07:35 -0400 | [diff] [blame] | 24 | * @since Version 2.1.0 |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 25 | * @filesource |
| 26 | */ |
| 27 | |
| 28 | // ------------------------------------------------------------------------ |
| 29 | |
| 30 | /** |
Timothy Warren | 0261596 | 2011-08-24 08:21:36 -0400 | [diff] [blame] | 31 | * PDO Database Adapter Class |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 32 | * |
| 33 | * Note: _DB is an extender class that the app controller |
| 34 | * creates dynamically based on whether the active record |
| 35 | * class is being used or not. |
| 36 | * |
| 37 | * @package CodeIgniter |
| 38 | * @subpackage Drivers |
| 39 | * @category Database |
Timothy Warren | d1a5ba2 | 2011-10-21 04:45:28 -0400 | [diff] [blame] | 40 | * @author EllisLab Dev Team |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 41 | * @link http://codeigniter.com/user_guide/database/ |
| 42 | */ |
| 43 | class CI_DB_pdo_driver extends CI_DB { |
| 44 | |
| 45 | var $dbdriver = 'pdo'; |
| 46 | |
| 47 | // the character used to excape - not necessary for PDO |
| 48 | var $_escape_char = ''; |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 49 | |
| 50 | // clause and character used for LIKE escape sequences |
Timothy Warren | c7ba664 | 2011-09-14 12:25:14 -0400 | [diff] [blame] | 51 | var $_like_escape_str; |
| 52 | var $_like_escape_chr; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 53 | |
| 54 | /** |
| 55 | * The syntax to count rows is slightly different across different |
| 56 | * database engines, so this string appears in each driver and is |
| 57 | * used for the count_all() and count_all_results() functions. |
| 58 | */ |
| 59 | var $_count_string = "SELECT COUNT(*) AS "; |
| 60 | var $_random_keyword; |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 61 | |
| 62 | // need to track the pdo DSN, driver and options |
| 63 | var $dsn; |
| 64 | var $pdodriver; |
Timothy Warren | 7aae368 | 2011-10-25 10:37:31 -0400 | [diff] [blame] | 65 | var $options = array(); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 66 | |
Timothy Warren | 51b0e64 | 2011-09-13 13:30:27 -0400 | [diff] [blame] | 67 | function __construct($params) |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 68 | { |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 69 | parent::__construct($params); |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 70 | |
| 71 | if (preg_match('/([^;]+):/', $this->dsn, $match) && count($match) == 2) |
| 72 | { |
| 73 | // If there is a minimum valid dsn string pattern found, we're done |
Taufan Aditya | fdd6ad0 | 2012-02-10 13:10:27 +0700 | [diff] [blame] | 74 | // This is for general PDO users, who tend to have a full DSN string. |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 75 | $this->pdodriver = end($match); |
| 76 | } |
| 77 | else |
| 78 | { |
| 79 | // Try to build a complete DSN string from params |
| 80 | $this->_connect_string($params); |
| 81 | } |
| 82 | |
Timothy Warren | c7ba664 | 2011-09-14 12:25:14 -0400 | [diff] [blame] | 83 | // clause and character used for LIKE escape sequences |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 84 | // this one depends on the driver being used |
| 85 | if ($this->pdodriver == 'mysql') |
Timothy Warren | c7ba664 | 2011-09-14 12:25:14 -0400 | [diff] [blame] | 86 | { |
| 87 | $this->_like_escape_str = ''; |
| 88 | $this->_like_escape_chr = ''; |
| 89 | } |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 90 | elseif ($this->pdodriver == 'odbc') |
Timothy Warren | c7ba664 | 2011-09-14 12:25:14 -0400 | [diff] [blame] | 91 | { |
| 92 | $this->_like_escape_str = " {escape '%s'} "; |
| 93 | $this->_like_escape_chr = '!'; |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | $this->_like_escape_str = " ESCAPE '%s' "; |
| 98 | $this->_like_escape_chr = '!'; |
| 99 | } |
| 100 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 101 | $this->trans_enabled = FALSE; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 102 | $this->_random_keyword = ' RND('.time().')'; // database specific random keyword |
| 103 | } |
| 104 | |
| 105 | /** |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 106 | * Connection String |
| 107 | * |
| 108 | * @access private |
| 109 | * @param array |
| 110 | * @return void |
| 111 | */ |
| 112 | function _connect_string($params) |
| 113 | { |
| 114 | if (strpos($this->hostname, ':')) |
| 115 | { |
| 116 | // hostname generally would have this prototype |
| 117 | // $db['hostname'] = 'pdodriver:host(/Server(/DSN))=hostname(/DSN);'; |
| 118 | // We need to get the prefix (pdodriver used by PDO). |
Timothy Warren | 928d83c | 2012-02-13 14:07:57 -0500 | [diff] [blame] | 119 | $dsnarray = explode(':', $this->hostname); |
| 120 | $this->pdodriver = $dsnarray[0]; |
Taufan Aditya | 5dcdbc3 | 2012-02-13 21:15:56 +0700 | [diff] [blame] | 121 | |
| 122 | // End dsn with a semicolon for extra backward compability |
| 123 | // if database property was not empty. |
Timothy Warren | f452469 | 2012-02-13 14:13:28 -0500 | [diff] [blame] | 124 | if ( ! empty($this->database)) |
Timothy Warren | 25dc755 | 2012-02-13 14:12:35 -0500 | [diff] [blame] | 125 | { |
| 126 | $this->dsn .= rtrim($this->hostname, ';').';'; |
| 127 | } |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 128 | } |
| 129 | else |
| 130 | { |
| 131 | // Invalid DSN, display an error |
| 132 | if ( ! array_key_exists('pdodriver', $params)) |
| 133 | { |
| 134 | show_error('Invalid DB Connection String for PDO'); |
| 135 | } |
| 136 | |
| 137 | // Assuming that the following DSN string format is used: |
| 138 | // $dsn = 'pdo://username:password@hostname:port/database?pdodriver=pgsql'; |
| 139 | $this->dsn = $this->pdodriver.':'; |
| 140 | |
| 141 | // Add hostname to the DSN for databases that need it |
Timothy Warren | 928d83c | 2012-02-13 14:07:57 -0500 | [diff] [blame] | 142 | if ( ! empty($this->hostname) |
| 143 | && strpos($this->hostname, ':') === FALSE |
| 144 | && in_array($this->pdodriver, array('informix', 'mysql', 'pgsql', 'sybase', 'mssql', 'dblib', 'cubrid'))) |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 145 | { |
| 146 | $this->dsn .= 'host='.$this->hostname.';'; |
| 147 | } |
| 148 | |
| 149 | // Add a port to the DSN for databases that can use it |
| 150 | if ( ! empty($this->port) && in_array($this->pdodriver, array('informix', 'mysql', 'pgsql', 'ibm', 'cubrid'))) |
| 151 | { |
| 152 | $this->dsn .= 'port='.$this->port.';'; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | // Add the database name to the DSN, if needed |
| 157 | if (stripos($this->dsn, 'dbname') === FALSE |
| 158 | && in_array($this->pdodriver, array('4D', 'pgsql', 'mysql', 'firebird', 'sybase', 'mssql', 'dblib', 'cubrid'))) |
| 159 | { |
| 160 | $this->dsn .= 'dbname='.$this->database.';'; |
| 161 | } |
| 162 | elseif (stripos($this->dsn, 'database') === FALSE && in_array($this->pdodriver, array('ibm', 'sqlsrv'))) |
| 163 | { |
| 164 | if (stripos($this->dsn, 'dsn') === FALSE) |
| 165 | { |
| 166 | $this->dsn .= 'database='.$this->database.';'; |
| 167 | } |
| 168 | } |
| 169 | elseif ($this->pdodriver === 'sqlite' && $this->dsn === 'sqlite:') |
| 170 | { |
| 171 | if ($this->database !== ':memory') |
| 172 | { |
| 173 | if ( ! file_exists($this->database)) |
| 174 | { |
| 175 | show_error('Invalid DB Connection string for PDO SQLite'); |
| 176 | } |
| 177 | |
| 178 | $this->dsn .= (strpos($this->database, DIRECTORY_SEPARATOR) !== 0) ? DIRECTORY_SEPARATOR : ''; |
| 179 | } |
| 180 | |
| 181 | $this->dsn .= $this->database; |
| 182 | } |
| 183 | |
| 184 | // Add charset to the DSN, if needed |
| 185 | if ( ! empty($this->char_set) && in_array($this->pdodriver, array('4D', 'mysql', 'sybase', 'mssql', 'dblib', 'oci'))) |
| 186 | { |
| 187 | $this->dsn .= 'charset='.$this->char_set.';'; |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | /** |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 192 | * Non-persistent database connection |
| 193 | * |
| 194 | * @access private called by the base class |
| 195 | * @return resource |
| 196 | */ |
| 197 | function db_connect() |
| 198 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 199 | $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; |
| 200 | |
| 201 | return $this->pdo_connect(); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 202 | } |
| 203 | |
| 204 | // -------------------------------------------------------------------- |
| 205 | |
| 206 | /** |
| 207 | * Persistent database connection |
| 208 | * |
| 209 | * @access private called by the base class |
| 210 | * @return resource |
| 211 | */ |
| 212 | function db_pconnect() |
| 213 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 214 | $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; |
| 215 | $this->options[PDO::ATTR_PERSISTENT] = TRUE; |
Timothy Warren | d93393f | 2011-10-26 11:31:49 -0400 | [diff] [blame] | 216 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 217 | return $this->pdo_connect(); |
| 218 | } |
| 219 | |
| 220 | // -------------------------------------------------------------------- |
| 221 | |
| 222 | /** |
| 223 | * PDO connection |
| 224 | * |
| 225 | * @access private called by the PDO driver class |
| 226 | * @return resource |
| 227 | */ |
| 228 | function pdo_connect() |
| 229 | { |
Taufan Aditya | 62b8cae | 2012-02-09 16:40:39 +0700 | [diff] [blame] | 230 | // Refer : http://php.net/manual/en/ref.pdo-mysql.connection.php |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 231 | if ($this->pdodriver == 'mysql' && is_php('5.3.6')) |
| 232 | { |
Taufan Aditya | 55bb97e | 2012-02-09 16:43:26 +0700 | [diff] [blame] | 233 | $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES $this->char_set COLLATE '$this->dbcollat'"; |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 234 | } |
| 235 | |
| 236 | // Connecting... |
| 237 | try |
| 238 | { |
| 239 | $db = new PDO($this->dsn, $this->username, $this->password, $this->options); |
| 240 | } |
| 241 | catch (PDOException $e) |
| 242 | { |
| 243 | if ($this->db_debug && empty($this->failover)) |
| 244 | { |
| 245 | $this->display_error($e->getMessage(), '', TRUE); |
| 246 | } |
| 247 | |
| 248 | return FALSE; |
| 249 | } |
| 250 | |
| 251 | return $db; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | // -------------------------------------------------------------------- |
| 255 | |
| 256 | /** |
| 257 | * Reconnect |
| 258 | * |
| 259 | * Keep / reestablish the db connection if no queries have been |
| 260 | * sent for a length of time exceeding the server's idle timeout |
| 261 | * |
| 262 | * @access public |
| 263 | * @return void |
| 264 | */ |
| 265 | function reconnect() |
| 266 | { |
Timothy Warren | 0261596 | 2011-08-24 08:21:36 -0400 | [diff] [blame] | 267 | if ($this->db->db_debug) |
| 268 | { |
| 269 | return $this->db->display_error('db_unsuported_feature'); |
| 270 | } |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 271 | |
Timothy Warren | 0261596 | 2011-08-24 08:21:36 -0400 | [diff] [blame] | 272 | return FALSE; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | // -------------------------------------------------------------------- |
| 276 | |
| 277 | /** |
| 278 | * Select the database |
| 279 | * |
| 280 | * @access private called by the base class |
| 281 | * @return resource |
| 282 | */ |
| 283 | function db_select() |
| 284 | { |
| 285 | // Not needed for PDO |
| 286 | return TRUE; |
| 287 | } |
| 288 | |
| 289 | // -------------------------------------------------------------------- |
| 290 | |
| 291 | /** |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 292 | * Version number query string |
| 293 | * |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 294 | * @return string |
| 295 | */ |
Andrey Andreev | ed74082 | 2012-03-01 16:37:08 +0200 | [diff] [blame] | 296 | protected function _version() |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 297 | { |
Andrey Andreev | ed74082 | 2012-03-01 16:37:08 +0200 | [diff] [blame] | 298 | return $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | // -------------------------------------------------------------------- |
| 302 | |
| 303 | /** |
| 304 | * Execute the query |
| 305 | * |
| 306 | * @access private called by the base class |
| 307 | * @param string an SQL query |
Timothy Warren | 51a4888 | 2011-09-14 13:47:06 -0400 | [diff] [blame] | 308 | * @return object |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 309 | */ |
| 310 | function _execute($sql) |
| 311 | { |
| 312 | $sql = $this->_prep_query($sql); |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 313 | |
Timothy Warren | 51a4888 | 2011-09-14 13:47:06 -0400 | [diff] [blame] | 314 | $result_id = $this->conn_id->query($sql); |
| 315 | |
Timothy Warren | d669153 | 2011-10-07 10:03:01 -0400 | [diff] [blame] | 316 | if (is_object($result_id)) |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 317 | { |
| 318 | $this->affect_rows = $result_id->rowCount(); |
| 319 | } |
| 320 | else |
| 321 | { |
| 322 | $this->affect_rows = 0; |
| 323 | } |
Timothy Warren | 51a4888 | 2011-09-14 13:47:06 -0400 | [diff] [blame] | 324 | |
| 325 | return $result_id; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 326 | } |
| 327 | |
| 328 | // -------------------------------------------------------------------- |
| 329 | |
| 330 | /** |
| 331 | * Prep the query |
| 332 | * |
| 333 | * If needed, each database adapter can prep the query string |
| 334 | * |
| 335 | * @access private called by execute() |
| 336 | * @param string an SQL query |
| 337 | * @return string |
| 338 | */ |
| 339 | function _prep_query($sql) |
| 340 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 341 | if ($this->pdodriver === 'pgsql') |
| 342 | { |
| 343 | // Change the backtick(s) for Postgre |
| 344 | $sql = str_replace('`', '"', $sql); |
| 345 | } |
| 346 | elseif ($this->pdodriver === 'sqlite') |
| 347 | { |
| 348 | // Change the backtick(s) for SQLite |
| 349 | $sql = str_replace('`', '', $sql); |
| 350 | } |
| 351 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 352 | return $sql; |
| 353 | } |
| 354 | |
| 355 | // -------------------------------------------------------------------- |
| 356 | |
| 357 | /** |
| 358 | * Begin Transaction |
| 359 | * |
| 360 | * @access public |
| 361 | * @return bool |
| 362 | */ |
| 363 | function trans_begin($test_mode = FALSE) |
| 364 | { |
| 365 | if ( ! $this->trans_enabled) |
| 366 | { |
| 367 | return TRUE; |
| 368 | } |
| 369 | |
| 370 | // When transactions are nested we only begin/commit/rollback the outermost ones |
| 371 | if ($this->_trans_depth > 0) |
| 372 | { |
| 373 | return TRUE; |
| 374 | } |
| 375 | |
| 376 | // Reset the transaction failure flag. |
| 377 | // If the $test_mode flag is set to TRUE transactions will be rolled back |
| 378 | // even if the queries produce a successful result. |
Timothy Warren | d019fd6 | 2011-10-26 11:26:17 -0400 | [diff] [blame] | 379 | $this->_trans_failure = (bool) ($test_mode === TRUE); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 380 | |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 381 | return $this->conn_id->beginTransaction(); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | // -------------------------------------------------------------------- |
| 385 | |
| 386 | /** |
| 387 | * Commit Transaction |
| 388 | * |
| 389 | * @access public |
| 390 | * @return bool |
| 391 | */ |
| 392 | function trans_commit() |
| 393 | { |
| 394 | if ( ! $this->trans_enabled) |
| 395 | { |
| 396 | return TRUE; |
| 397 | } |
| 398 | |
| 399 | // When transactions are nested we only begin/commit/rollback the outermost ones |
| 400 | if ($this->_trans_depth > 0) |
| 401 | { |
| 402 | return TRUE; |
| 403 | } |
| 404 | |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 405 | $ret = $this->conn->commit(); |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 406 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 407 | return $ret; |
| 408 | } |
| 409 | |
| 410 | // -------------------------------------------------------------------- |
| 411 | |
| 412 | /** |
| 413 | * Rollback Transaction |
| 414 | * |
| 415 | * @access public |
| 416 | * @return bool |
| 417 | */ |
| 418 | function trans_rollback() |
| 419 | { |
| 420 | if ( ! $this->trans_enabled) |
| 421 | { |
| 422 | return TRUE; |
| 423 | } |
| 424 | |
| 425 | // When transactions are nested we only begin/commit/rollback the outermost ones |
| 426 | if ($this->_trans_depth > 0) |
| 427 | { |
| 428 | return TRUE; |
| 429 | } |
| 430 | |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 431 | $ret = $this->conn_id->rollBack(); |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 432 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 433 | return $ret; |
| 434 | } |
| 435 | |
| 436 | // -------------------------------------------------------------------- |
| 437 | |
| 438 | /** |
| 439 | * Escape String |
| 440 | * |
| 441 | * @access public |
| 442 | * @param string |
| 443 | * @param bool whether or not the string will be used in a LIKE condition |
| 444 | * @return string |
| 445 | */ |
| 446 | function escape_str($str, $like = FALSE) |
| 447 | { |
| 448 | if (is_array($str)) |
| 449 | { |
| 450 | foreach ($str as $key => $val) |
| 451 | { |
| 452 | $str[$key] = $this->escape_str($val, $like); |
| 453 | } |
| 454 | |
| 455 | return $str; |
| 456 | } |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 457 | |
Timothy Warren | 4766397 | 2011-10-05 16:44:50 -0400 | [diff] [blame] | 458 | //Escape the string |
| 459 | $str = $this->conn_id->quote($str); |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 460 | |
Timothy Warren | 4766397 | 2011-10-05 16:44:50 -0400 | [diff] [blame] | 461 | //If there are duplicated quotes, trim them away |
Timothy Warren | d669153 | 2011-10-07 10:03:01 -0400 | [diff] [blame] | 462 | if (strpos($str, "'") === 0) |
Timothy Warren | ec19332 | 2011-10-07 09:53:35 -0400 | [diff] [blame] | 463 | { |
| 464 | $str = substr($str, 1, -1); |
| 465 | } |
| 466 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 467 | // escape LIKE condition wildcards |
| 468 | if ($like === TRUE) |
| 469 | { |
| 470 | $str = str_replace( array('%', '_', $this->_like_escape_chr), |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 471 | array($this->_like_escape_chr.'%', |
| 472 | $this->_like_escape_chr.'_', |
| 473 | $this->_like_escape_chr.$this->_like_escape_chr), |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 474 | $str); |
| 475 | } |
| 476 | |
| 477 | return $str; |
| 478 | } |
| 479 | |
| 480 | // -------------------------------------------------------------------- |
| 481 | |
| 482 | /** |
| 483 | * Affected Rows |
| 484 | * |
| 485 | * @access public |
| 486 | * @return integer |
| 487 | */ |
| 488 | function affected_rows() |
| 489 | { |
Timothy Warren | 51a4888 | 2011-09-14 13:47:06 -0400 | [diff] [blame] | 490 | return $this->affect_rows; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | // -------------------------------------------------------------------- |
| 494 | |
| 495 | /** |
| 496 | * Insert ID |
Andrey Andreev | a39d699 | 2012-03-01 19:11:39 +0200 | [diff] [blame] | 497 | * |
| 498 | * @return int |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 499 | */ |
Andrey Andreev | a39d699 | 2012-03-01 19:11:39 +0200 | [diff] [blame] | 500 | public function insert_id($name = NULL) |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 501 | { |
Andrey Andreev | a39d699 | 2012-03-01 19:11:39 +0200 | [diff] [blame] | 502 | if ($this->pdodriver === 'pgsql' && $name === NULL && $this->_version() >= '8.1') |
Timothy Warren | 3351275 | 2011-10-07 09:51:49 -0400 | [diff] [blame] | 503 | { |
Andrey Andreev | a39d699 | 2012-03-01 19:11:39 +0200 | [diff] [blame] | 504 | $query = $this->query('SELECT LASTVAL() AS ins_id'); |
| 505 | $query = $query->row(); |
| 506 | return $query->ins_id; |
Timothy Warren | 3351275 | 2011-10-07 09:51:49 -0400 | [diff] [blame] | 507 | } |
Andrey Andreev | a39d699 | 2012-03-01 19:11:39 +0200 | [diff] [blame] | 508 | |
| 509 | return $this->conn_id->lastInsertId($name); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 510 | } |
| 511 | |
| 512 | // -------------------------------------------------------------------- |
| 513 | |
| 514 | /** |
| 515 | * "Count All" query |
| 516 | * |
| 517 | * Generates a platform-specific query string that counts all records in |
| 518 | * the specified database |
| 519 | * |
| 520 | * @access public |
| 521 | * @param string |
| 522 | * @return string |
| 523 | */ |
| 524 | function count_all($table = '') |
| 525 | { |
| 526 | if ($table == '') |
| 527 | { |
| 528 | return 0; |
| 529 | } |
| 530 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 531 | $sql = $this->_count_string.$this->_protect_identifiers('numrows').' FROM '; |
| 532 | $sql .= $this->_protect_identifiers($table, TRUE, NULL, FALSE); |
| 533 | $query = $this->query($sql); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 534 | |
| 535 | if ($query->num_rows() == 0) |
| 536 | { |
| 537 | return 0; |
| 538 | } |
| 539 | |
| 540 | $row = $query->row(); |
| 541 | $this->_reset_select(); |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 542 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 543 | return (int) $row->numrows; |
| 544 | } |
| 545 | |
| 546 | // -------------------------------------------------------------------- |
| 547 | |
| 548 | /** |
| 549 | * Show table query |
| 550 | * |
| 551 | * Generates a platform-specific query string so that the table names can be fetched |
| 552 | * |
| 553 | * @access private |
| 554 | * @param boolean |
| 555 | * @return string |
| 556 | */ |
| 557 | function _list_tables($prefix_limit = FALSE) |
| 558 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 559 | if ($this->pdodriver == 'pgsql') |
| 560 | { |
| 561 | // Analog function to show all tables in postgre |
| 562 | $sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"; |
| 563 | } |
| 564 | else |
| 565 | { |
| 566 | $sql = "SHOW TABLES FROM `".$this->database."`"; |
| 567 | } |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 568 | |
| 569 | if ($prefix_limit !== FALSE AND $this->dbprefix != '') |
| 570 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 571 | return FALSE; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 572 | } |
| 573 | |
| 574 | return $sql; |
| 575 | } |
| 576 | |
| 577 | // -------------------------------------------------------------------- |
| 578 | |
| 579 | /** |
| 580 | * Show column query |
| 581 | * |
| 582 | * Generates a platform-specific query string so that the column names can be fetched |
| 583 | * |
| 584 | * @access public |
| 585 | * @param string the table name |
| 586 | * @return string |
| 587 | */ |
| 588 | function _list_columns($table = '') |
| 589 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 590 | return 'SHOW COLUMNS FROM '.$this->_from_tables($table); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 591 | } |
| 592 | |
| 593 | // -------------------------------------------------------------------- |
| 594 | |
| 595 | /** |
| 596 | * Field data query |
| 597 | * |
| 598 | * Generates a platform-specific query so that the column data can be retrieved |
| 599 | * |
| 600 | * @access public |
| 601 | * @param string the table name |
| 602 | * @return object |
| 603 | */ |
| 604 | function _field_data($table) |
| 605 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 606 | return 'SELECT TOP 1 FROM '.$this->_from_tables($table); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 607 | } |
| 608 | |
| 609 | // -------------------------------------------------------------------- |
| 610 | |
| 611 | /** |
| 612 | * The error message string |
| 613 | * |
| 614 | * @access private |
| 615 | * @return string |
| 616 | */ |
| 617 | function _error_message() |
| 618 | { |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 619 | $error_array = $this->conn_id->errorInfo(); |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 620 | |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 621 | return $error_array[2]; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | // -------------------------------------------------------------------- |
| 625 | |
| 626 | /** |
| 627 | * The error message number |
| 628 | * |
| 629 | * @access private |
| 630 | * @return integer |
| 631 | */ |
| 632 | function _error_number() |
| 633 | { |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 634 | return $this->conn_id->errorCode(); |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 635 | } |
| 636 | |
| 637 | // -------------------------------------------------------------------- |
| 638 | |
| 639 | /** |
| 640 | * Escape the SQL Identifiers |
| 641 | * |
| 642 | * This function escapes column and table names |
| 643 | * |
| 644 | * @access private |
| 645 | * @param string |
| 646 | * @return string |
| 647 | */ |
| 648 | function _escape_identifiers($item) |
| 649 | { |
| 650 | if ($this->_escape_char == '') |
| 651 | { |
| 652 | return $item; |
| 653 | } |
| 654 | |
| 655 | foreach ($this->_reserved_identifiers as $id) |
| 656 | { |
| 657 | if (strpos($item, '.'.$id) !== FALSE) |
| 658 | { |
| 659 | $str = $this->_escape_char. str_replace('.', $this->_escape_char.'.', $item); |
| 660 | |
| 661 | // remove duplicates if the user already included the escape |
| 662 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | if (strpos($item, '.') !== FALSE) |
| 667 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 668 | $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item); |
| 669 | $str .= $this->_escape_char; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 670 | } |
| 671 | else |
| 672 | { |
| 673 | $str = $this->_escape_char.$item.$this->_escape_char; |
| 674 | } |
| 675 | |
| 676 | // remove duplicates if the user already included the escape |
| 677 | return preg_replace('/['.$this->_escape_char.']+/', $this->_escape_char, $str); |
| 678 | } |
| 679 | |
| 680 | // -------------------------------------------------------------------- |
| 681 | |
| 682 | /** |
| 683 | * From Tables |
| 684 | * |
| 685 | * This function implicitly groups FROM tables so there is no confusion |
| 686 | * about operator precedence in harmony with SQL standards |
| 687 | * |
| 688 | * @access public |
| 689 | * @param type |
| 690 | * @return type |
| 691 | */ |
| 692 | function _from_tables($tables) |
| 693 | { |
| 694 | if ( ! is_array($tables)) |
| 695 | { |
| 696 | $tables = array($tables); |
| 697 | } |
| 698 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 699 | return (count($tables) == 1) ? '`'.$tables[0].'`' : '('.implode(', ', $tables).')'; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 700 | } |
| 701 | |
| 702 | // -------------------------------------------------------------------- |
| 703 | |
| 704 | /** |
| 705 | * Insert statement |
| 706 | * |
| 707 | * Generates a platform-specific insert string from the supplied data |
| 708 | * |
| 709 | * @access public |
| 710 | * @param string the table name |
| 711 | * @param array the insert keys |
| 712 | * @param array the insert values |
| 713 | * @return string |
| 714 | */ |
| 715 | function _insert($table, $keys, $values) |
| 716 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 717 | return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 718 | } |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 719 | |
| 720 | // -------------------------------------------------------------------- |
| 721 | |
| 722 | /** |
| 723 | * Insert_batch statement |
| 724 | * |
| 725 | * Generates a platform-specific insert string from the supplied data |
| 726 | * |
| 727 | * @access public |
| 728 | * @param string the table name |
| 729 | * @param array the insert keys |
| 730 | * @param array the insert values |
| 731 | * @return string |
| 732 | */ |
| 733 | function _insert_batch($table, $keys, $values) |
| 734 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 735 | return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES '.implode(', ', $values); |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 736 | } |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 737 | |
| 738 | // -------------------------------------------------------------------- |
| 739 | |
| 740 | /** |
| 741 | * Update statement |
| 742 | * |
| 743 | * Generates a platform-specific update string from the supplied data |
| 744 | * |
| 745 | * @access public |
| 746 | * @param string the table name |
| 747 | * @param array the update data |
| 748 | * @param array the where clause |
| 749 | * @param array the orderby clause |
| 750 | * @param array the limit clause |
| 751 | * @return string |
| 752 | */ |
| 753 | function _update($table, $values, $where, $orderby = array(), $limit = FALSE) |
| 754 | { |
| 755 | foreach ($values as $key => $val) |
| 756 | { |
| 757 | $valstr[] = $key." = ".$val; |
| 758 | } |
| 759 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 760 | $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |
| 761 | $orderby = (count($orderby) >= 1) ? ' ORDER BY '.implode(', ', $orderby) : ''; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 762 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 763 | $sql = 'UPDATE '.$this->_from_tables($table).' SET '.implode(', ', $valstr); |
| 764 | $sql .= ($where != '' && count($where) >= 1) ? ' WHERE '.implode(' ', $where) : ''; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 765 | $sql .= $orderby.$limit; |
| 766 | |
| 767 | return $sql; |
| 768 | } |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 769 | |
| 770 | // -------------------------------------------------------------------- |
| 771 | |
| 772 | /** |
| 773 | * Update_Batch statement |
| 774 | * |
| 775 | * Generates a platform-specific batch update string from the supplied data |
| 776 | * |
| 777 | * @access public |
| 778 | * @param string the table name |
| 779 | * @param array the update data |
| 780 | * @param array the where clause |
| 781 | * @return string |
| 782 | */ |
| 783 | function _update_batch($table, $values, $index, $where = NULL) |
| 784 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 785 | $ids = array(); |
| 786 | $where = ($where != '' && count($where) >=1) ? implode(" ", $where).' AND ' : ''; |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 787 | |
| 788 | foreach ($values as $key => $val) |
| 789 | { |
| 790 | $ids[] = $val[$index]; |
| 791 | |
| 792 | foreach (array_keys($val) as $field) |
| 793 | { |
| 794 | if ($field != $index) |
| 795 | { |
| 796 | $final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field]; |
| 797 | } |
| 798 | } |
| 799 | } |
| 800 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 801 | $sql = 'UPDATE '.$this->_from_tables($table).' SET '; |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 802 | $cases = ''; |
| 803 | |
| 804 | foreach ($final as $k => $v) |
| 805 | { |
| 806 | $cases .= $k.' = CASE '."\n"; |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 807 | |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 808 | foreach ($v as $row) |
| 809 | { |
| 810 | $cases .= $row."\n"; |
| 811 | } |
| 812 | |
| 813 | $cases .= 'ELSE '.$k.' END, '; |
| 814 | } |
| 815 | |
| 816 | $sql .= substr($cases, 0, -2); |
Timothy Warren | b5a43b0 | 2011-10-04 17:26:04 -0400 | [diff] [blame] | 817 | $sql .= ' WHERE '.$where.$index.' IN ('.implode(',', $ids).')'; |
| 818 | |
| 819 | return $sql; |
| 820 | } |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 821 | |
| 822 | |
| 823 | // -------------------------------------------------------------------- |
| 824 | |
| 825 | /** |
| 826 | * Truncate statement |
| 827 | * |
| 828 | * Generates a platform-specific truncate string from the supplied data |
| 829 | * If the database does not support the truncate() command |
| 830 | * This function maps to "DELETE FROM table" |
| 831 | * |
| 832 | * @access public |
| 833 | * @param string the table name |
| 834 | * @return string |
| 835 | */ |
| 836 | function _truncate($table) |
| 837 | { |
| 838 | return $this->_delete($table); |
| 839 | } |
| 840 | |
| 841 | // -------------------------------------------------------------------- |
| 842 | |
| 843 | /** |
| 844 | * Delete statement |
| 845 | * |
| 846 | * Generates a platform-specific delete string from the supplied data |
| 847 | * |
| 848 | * @access public |
| 849 | * @param string the table name |
| 850 | * @param array the where clause |
| 851 | * @param string the limit clause |
| 852 | * @return string |
| 853 | */ |
| 854 | function _delete($table, $where = array(), $like = array(), $limit = FALSE) |
| 855 | { |
| 856 | $conditions = ''; |
| 857 | |
| 858 | if (count($where) > 0 OR count($like) > 0) |
| 859 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 860 | $conditions = "\nWHERE "; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 861 | $conditions .= implode("\n", $this->ar_where); |
| 862 | |
| 863 | if (count($where) > 0 && count($like) > 0) |
| 864 | { |
| 865 | $conditions .= " AND "; |
| 866 | } |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 867 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 868 | $conditions .= implode("\n", $like); |
| 869 | } |
| 870 | |
| 871 | $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; |
| 872 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 873 | return 'DELETE FROM '.$this->_from_tables($table).$conditions.$limit; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 874 | } |
| 875 | |
| 876 | // -------------------------------------------------------------------- |
| 877 | |
| 878 | /** |
| 879 | * Limit string |
| 880 | * |
| 881 | * Generates a platform-specific LIMIT clause |
| 882 | * |
| 883 | * @access public |
| 884 | * @param string the sql query string |
| 885 | * @param integer the number of rows to limit the query to |
| 886 | * @param integer the offset value |
| 887 | * @return string |
| 888 | */ |
| 889 | function _limit($sql, $limit, $offset) |
| 890 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 891 | if ($this->pdodriver == 'cubrid' OR $this->pdodriver == 'sqlite') |
Timothy Warren | 0a43ad8 | 2011-09-15 20:15:19 -0400 | [diff] [blame] | 892 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 893 | $offset = ($offset == 0) ? '' : $offset.', '; |
Timothy Warren | 0a43ad8 | 2011-09-15 20:15:19 -0400 | [diff] [blame] | 894 | |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 895 | return $sql.'LIMIT '.$offset.$limit; |
Timothy Warren | 0a43ad8 | 2011-09-15 20:15:19 -0400 | [diff] [blame] | 896 | } |
| 897 | else |
| 898 | { |
Taufan Aditya | 1820933 | 2012-02-09 16:07:27 +0700 | [diff] [blame] | 899 | $sql .= 'LIMIT '.$limit; |
| 900 | $sql .= ($offset > 0) ? ' OFFSET '.$offset : ''; |
Timothy Warren | 0a43ad8 | 2011-09-15 20:15:19 -0400 | [diff] [blame] | 901 | |
| 902 | return $sql; |
| 903 | } |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 904 | } |
| 905 | |
| 906 | // -------------------------------------------------------------------- |
| 907 | |
| 908 | /** |
| 909 | * Close DB Connection |
| 910 | * |
| 911 | * @access public |
| 912 | * @param resource |
| 913 | * @return void |
| 914 | */ |
| 915 | function _close($conn_id) |
| 916 | { |
Timothy Warren | 6a450cf | 2011-08-23 12:46:11 -0400 | [diff] [blame] | 917 | $this->conn_id = null; |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 918 | } |
| 919 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 920 | } |
| 921 | |
Timothy Warren | 80ab816 | 2011-08-22 18:26:12 -0400 | [diff] [blame] | 922 | /* End of file pdo_driver.php */ |
Andrey Andreev | 063f596 | 2012-02-27 12:20:52 +0200 | [diff] [blame] | 923 | /* Location: ./system/database/drivers/pdo/pdo_driver.php */ |