@@ -51,7 +51,7 @@ |
||
51 | 51 | * |
52 | 52 | * @var string |
53 | 53 | */ |
54 | - protected $_list_databases = 'SELECT username FROM dba_users'; // Schemas are actual usernames |
|
54 | + protected $_list_databases = 'SELECT username FROM dba_users'; // Schemas are actual usernames |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * Export |
@@ -53,21 +53,21 @@ |
||
53 | 53 | * |
54 | 54 | * @var string |
55 | 55 | */ |
56 | - protected $_create_table_if = FALSE; |
|
56 | + protected $_create_table_if = FALSE; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * DROP TABLE IF statement |
60 | 60 | * |
61 | 61 | * @var string |
62 | 62 | */ |
63 | - protected $_drop_table_if = FALSE; |
|
63 | + protected $_drop_table_if = FALSE; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * UNSIGNED support |
67 | 67 | * |
68 | 68 | * @var bool|array |
69 | 69 | */ |
70 | - protected $_unsigned = FALSE; |
|
70 | + protected $_unsigned = FALSE; |
|
71 | 71 | |
72 | 72 | // -------------------------------------------------------------------- |
73 | 73 |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | $retval = array(); |
131 | 131 | for ($i = 0, $odbc_index = 1, $c = $this->num_fields(); $i < $c; $i++, $odbc_index++) |
132 | 132 | { |
133 | - $retval[$i] = new stdClass(); |
|
133 | + $retval[$i] = new stdClass(); |
|
134 | 134 | $retval[$i]->name = odbc_field_name($this->result_id, $odbc_index); |
135 | 135 | $retval[$i]->type = odbc_field_type($this->result_id, $odbc_index); |
136 | 136 | $retval[$i]->max_length = odbc_field_len($this->result_id, $odbc_index); |
137 | 137 | $retval[$i]->primary_key = 0; |
138 | - $retval[$i]->default = ''; |
|
138 | + $retval[$i]->default = ''; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | return $retval; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $rs_assoc = array(); |
227 | 227 | foreach ($rs as $k => $v) |
228 | 228 | { |
229 | - $field_name = odbc_field_name($result, $k+1); |
|
229 | + $field_name = odbc_field_name($result, $k + 1); |
|
230 | 230 | $rs_assoc[$field_name] = $v; |
231 | 231 | } |
232 | 232 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $rs_object = new stdClass(); |
260 | 260 | foreach ($rs as $k => $v) |
261 | 261 | { |
262 | - $field_name = odbc_field_name($result, $k+1); |
|
262 | + $field_name = odbc_field_name($result, $k + 1); |
|
263 | 263 | $rs_object->$field_name = $v; |
264 | 264 | } |
265 | 265 |
@@ -60,8 +60,7 @@ discard block |
||
60 | 60 | if (is_int($this->num_rows)) |
61 | 61 | { |
62 | 62 | return $this->num_rows; |
63 | - } |
|
64 | - elseif (($this->num_rows = odbc_num_rows($this->result_id)) !== -1) |
|
63 | + } elseif (($this->num_rows = odbc_num_rows($this->result_id)) !== -1) |
|
65 | 64 | { |
66 | 65 | return $this->num_rows; |
67 | 66 | } |
@@ -70,8 +69,7 @@ discard block |
||
70 | 69 | if (count($this->result_array) > 0) |
71 | 70 | { |
72 | 71 | return $this->num_rows = count($this->result_array); |
73 | - } |
|
74 | - elseif (count($this->result_object) > 0) |
|
72 | + } elseif (count($this->result_object) > 0) |
|
75 | 73 | { |
76 | 74 | return $this->num_rows = count($this->result_object); |
77 | 75 | } |
@@ -94,16 +94,13 @@ discard block |
||
94 | 94 | $this->hostname = NULL; |
95 | 95 | $this->subdriver = $match[1]; |
96 | 96 | return; |
97 | - } |
|
98 | - elseif (in_array($this->subdriver, array('mssql', 'sybase'), TRUE)) |
|
97 | + } elseif (in_array($this->subdriver, array('mssql', 'sybase'), TRUE)) |
|
99 | 98 | { |
100 | 99 | $this->subdriver = 'dblib'; |
101 | - } |
|
102 | - elseif ($this->subdriver === '4D') |
|
100 | + } elseif ($this->subdriver === '4D') |
|
103 | 101 | { |
104 | 102 | $this->subdriver = '4d'; |
105 | - } |
|
106 | - elseif ( ! in_array($this->subdriver, array('4d', 'cubrid', 'dblib', 'firebird', 'ibm', 'informix', 'mysql', 'oci', 'odbc', 'pgsql', 'sqlite', 'sqlsrv'), TRUE)) |
|
103 | + } elseif ( ! in_array($this->subdriver, array('4d', 'cubrid', 'dblib', 'firebird', 'ibm', 'informix', 'mysql', 'oci', 'odbc', 'pgsql', 'sqlite', 'sqlsrv'), TRUE)) |
|
107 | 104 | { |
108 | 105 | log_message('error', 'PDO: Invalid or non-existent subdriver'); |
109 | 106 | |
@@ -131,8 +128,7 @@ discard block |
||
131 | 128 | try |
132 | 129 | { |
133 | 130 | return new PDO($this->dsn, $this->username, $this->password, $this->options); |
134 | - } |
|
135 | - catch (PDOException $e) |
|
131 | + } catch (PDOException $e) |
|
136 | 132 | { |
137 | 133 | if ($this->db_debug && empty($this->failover)) |
138 | 134 | { |
@@ -161,8 +157,7 @@ discard block |
||
161 | 157 | try |
162 | 158 | { |
163 | 159 | return $this->data_cache['version'] = $this->conn_id->getAttribute(PDO::ATTR_SERVER_VERSION); |
164 | - } |
|
165 | - catch (PDOException $e) |
|
160 | + } catch (PDOException $e) |
|
166 | 161 | { |
167 | 162 | return parent::version(); |
168 | 163 | } |
@@ -53,13 +53,13 @@ |
||
53 | 53 | * |
54 | 54 | * @var string |
55 | 55 | */ |
56 | - protected $_create_table_if = FALSE; |
|
56 | + protected $_create_table_if = FALSE; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * DROP TABLE IF statement |
60 | 60 | * |
61 | 61 | * @var string |
62 | 62 | */ |
63 | - protected $_drop_table_if = FALSE; |
|
63 | + protected $_drop_table_if = FALSE; |
|
64 | 64 | |
65 | 65 | } |
@@ -131,7 +131,7 @@ |
||
131 | 131 | { |
132 | 132 | $field = $this->result_id->getColumnMeta($i); |
133 | 133 | |
134 | - $retval[$i] = new stdClass(); |
|
134 | + $retval[$i] = new stdClass(); |
|
135 | 135 | $retval[$i]->name = $field['name']; |
136 | 136 | $retval[$i]->type = $field['native_type']; |
137 | 137 | $retval[$i]->max_length = ($field['len'] > 0) ? $field['len'] : NULL; |
@@ -60,16 +60,13 @@ discard block |
||
60 | 60 | if (is_int($this->num_rows)) |
61 | 61 | { |
62 | 62 | return $this->num_rows; |
63 | - } |
|
64 | - elseif (count($this->result_array) > 0) |
|
63 | + } elseif (count($this->result_array) > 0) |
|
65 | 64 | { |
66 | 65 | return $this->num_rows = count($this->result_array); |
67 | - } |
|
68 | - elseif (count($this->result_object) > 0) |
|
66 | + } elseif (count($this->result_object) > 0) |
|
69 | 67 | { |
70 | 68 | return $this->num_rows = count($this->result_object); |
71 | - } |
|
72 | - elseif (($num_rows = $this->result_id->rowCount()) > 0) |
|
69 | + } elseif (($num_rows = $this->result_id->rowCount()) > 0) |
|
73 | 70 | { |
74 | 71 | return $this->num_rows = $num_rows; |
75 | 72 | } |
@@ -139,8 +136,7 @@ discard block |
||
139 | 136 | } |
140 | 137 | |
141 | 138 | return $retval; |
142 | - } |
|
143 | - catch (Exception $e) |
|
139 | + } catch (Exception $e) |
|
144 | 140 | { |
145 | 141 | if ($this->db->db_debug) |
146 | 142 | { |
@@ -87,8 +87,7 @@ |
||
87 | 87 | empty($this->port) OR $this->dsn .= ';port='.$this->port; |
88 | 88 | empty($this->database) OR $this->dsn .= ';dbname='.$this->database; |
89 | 89 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
90 | - } |
|
91 | - elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 3) === FALSE) |
|
90 | + } elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 3) === FALSE) |
|
92 | 91 | { |
93 | 92 | $this->dsn .= ';charset='.$this->char_set; |
94 | 93 | } |
@@ -51,42 +51,42 @@ discard block |
||
51 | 51 | * |
52 | 52 | * @var string |
53 | 53 | */ |
54 | - protected $_create_database = 'CREATE SCHEMA %s'; |
|
54 | + protected $_create_database = 'CREATE SCHEMA %s'; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * DROP DATABASE statement |
58 | 58 | * |
59 | 59 | * @var string |
60 | 60 | */ |
61 | - protected $_drop_database = 'DROP SCHEMA %s'; |
|
61 | + protected $_drop_database = 'DROP SCHEMA %s'; |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * CREATE TABLE IF statement |
65 | 65 | * |
66 | 66 | * @var string |
67 | 67 | */ |
68 | - protected $_create_table_if = 'CREATE TABLE IF NOT EXISTS'; |
|
68 | + protected $_create_table_if = 'CREATE TABLE IF NOT EXISTS'; |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * RENAME TABLE statement |
72 | 72 | * |
73 | 73 | * @var string |
74 | 74 | */ |
75 | - protected $_rename_table = FALSE; |
|
75 | + protected $_rename_table = FALSE; |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * DROP TABLE IF statement |
79 | 79 | * |
80 | 80 | * @var string |
81 | 81 | */ |
82 | - protected $_drop_table_if = 'DROP TABLE IF EXISTS'; |
|
82 | + protected $_drop_table_if = 'DROP TABLE IF EXISTS'; |
|
83 | 83 | |
84 | 84 | /** |
85 | 85 | * UNSIGNED support |
86 | 86 | * |
87 | 87 | * @var array |
88 | 88 | */ |
89 | - protected $_unsigned = array( |
|
89 | + protected $_unsigned = array( |
|
90 | 90 | 'INT16' => 'INT', |
91 | 91 | 'SMALLINT' => 'INT', |
92 | 92 | 'INT' => 'INT64', |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * @var string |
100 | 100 | */ |
101 | - protected $_default = FALSE; |
|
101 | + protected $_default = FALSE; |
|
102 | 102 | |
103 | 103 | // -------------------------------------------------------------------- |
104 | 104 |
@@ -206,8 +206,7 @@ |
||
206 | 206 | if (stripos($field['type'], 'int') !== FALSE) |
207 | 207 | { |
208 | 208 | $field['auto_increment'] = ' AUTO_INCREMENT'; |
209 | - } |
|
210 | - elseif (strcasecmp($field['type'], 'UUID') === 0) |
|
209 | + } elseif (strcasecmp($field['type'], 'UUID') === 0) |
|
211 | 210 | { |
212 | 211 | $field['auto_increment'] = ' AUTO_GENERATE'; |
213 | 212 | } |
@@ -153,16 +153,16 @@ |
||
153 | 153 | $retval = array(); |
154 | 154 | for ($i = 0, $c = count($query); $i < $c; $i++) |
155 | 155 | { |
156 | - $retval[$i] = new stdClass(); |
|
157 | - $retval[$i]->name = $query[$i]->Field; |
|
156 | + $retval[$i] = new stdClass(); |
|
157 | + $retval[$i]->name = $query[$i]->Field; |
|
158 | 158 | |
159 | 159 | sscanf($query[$i]->Type, '%[a-z](%d)', |
160 | 160 | $retval[$i]->type, |
161 | 161 | $retval[$i]->max_length |
162 | 162 | ); |
163 | 163 | |
164 | - $retval[$i]->default = $query[$i]->Default; |
|
165 | - $retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
|
164 | + $retval[$i]->default = $query[$i]->Default; |
|
165 | + $retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $retval; |