5
5
* An open source application development framework for PHP 5.1.6 or newer
6
6
*
7
7
* @package CodeIgniter
8
- * @author ExpressionEngine Dev Team
9
8
* @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
10
9
* @license http://codeigniter.com/user_guide/license.html
10
+ * @author EllisLab Dev Team
11
11
* @link http://codeigniter.com
12
12
* @since Version 2.1.0
13
13
* @filesource
25
25
* @package CodeIgniter
26
26
* @subpackage Drivers
27
27
* @category Database
28
- * @author ExpressionEngine Dev Team
28
+ * @author EllisLab Dev Team
29
29
* @link http://codeigniter.com/user_guide/database/
30
30
*/
31
-
32
31
class CI_DB_pdo_driver extends CI_DB {
33
32
34
33
var $ dbdriver = 'pdo ' ;
@@ -37,7 +36,7 @@ class CI_DB_pdo_driver extends CI_DB {
37
36
var $ _escape_char = '' ;
38
37
var $ _like_escape_str ;
39
38
var $ _like_escape_chr ;
40
-
39
+
41
40
42
41
/**
43
42
* The syntax to count rows is slightly different across different
@@ -52,13 +51,13 @@ class CI_DB_pdo_driver extends CI_DB {
52
51
function __construct ($ params )
53
52
{
54
53
parent ::__construct ($ params );
55
-
54
+
56
55
// clause and character used for LIKE escape sequences
57
56
if (strpos ($ this ->hostname , 'mysql ' ) !== FALSE )
58
57
{
59
58
$ this ->_like_escape_str = '' ;
60
59
$ this ->_like_escape_chr = '' ;
61
-
60
+
62
61
//Prior to this version, the charset can't be set in the dsn
63
62
if (is_php ('5.3.6 ' ))
64
63
{
@@ -80,6 +79,7 @@ function __construct($params)
80
79
}
81
80
82
81
$ this ->hostname .= ";dbname= " .$ this ->database ;
82
+
83
83
$ this ->trans_enabled = FALSE ;
84
84
85
85
$ this ->_random_keyword = ' RND( ' .time ().') ' ; // database specific random keyword
@@ -190,7 +190,7 @@ function _execute($sql)
190
190
{
191
191
$ sql = $ this ->_prep_query ($ sql );
192
192
$ result_id = $ this ->conn_id ->query ($ sql );
193
-
193
+
194
194
if (is_object ($ result_id ))
195
195
{
196
196
$ this ->affect_rows = $ result_id ->rowCount ();
@@ -199,7 +199,7 @@ function _execute($sql)
199
199
{
200
200
$ this ->affect_rows = 0 ;
201
201
}
202
-
202
+
203
203
return $ result_id ;
204
204
}
205
205
@@ -319,16 +319,16 @@ function escape_str($str, $like = FALSE)
319
319
320
320
return $ str ;
321
321
}
322
-
322
+
323
323
//Escape the string
324
324
$ str = $ this ->conn_id ->quote ($ str );
325
-
325
+
326
326
//If there are duplicated quotes, trim them away
327
327
if (strpos ($ str , "' " ) === 0 )
328
328
{
329
329
$ str = substr ($ str , 1 , -1 );
330
330
}
331
-
331
+
332
332
// escape LIKE condition wildcards
333
333
if ($ like === TRUE )
334
334
{
@@ -530,7 +530,7 @@ function _escape_identifiers($item)
530
530
if (strpos ($ item , '. ' ) !== FALSE )
531
531
{
532
532
$ str = $ this ->_escape_char .str_replace ('. ' , $ this ->_escape_char .'. ' .$ this ->_escape_char , $ item ).$ this ->_escape_char ;
533
-
533
+
534
534
}
535
535
else
536
536
{
@@ -580,7 +580,7 @@ function _insert($table, $keys, $values)
580
580
{
581
581
return "INSERT INTO " .$ table ." ( " .implode (', ' , $ keys ).") VALUES ( " .implode (', ' , $ values ).") " ;
582
582
}
583
-
583
+
584
584
// --------------------------------------------------------------------
585
585
586
586
/**
@@ -633,7 +633,7 @@ function _update($table, $values, $where, $orderby = array(), $limit = FALSE)
633
633
634
634
return $ sql ;
635
635
}
636
-
636
+
637
637
// --------------------------------------------------------------------
638
638
639
639
/**
@@ -775,7 +775,7 @@ function _limit($sql, $limit, $offset)
775
775
{
776
776
$ sql .= " OFFSET " .$ offset ;
777
777
}
778
-
778
+
779
779
return $ sql ;
780
780
}
781
781
}
0 commit comments