summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2012-06-03 17:36:45 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2012-06-03 17:36:45 +0200
commit142b618fb7419972288a8f7b58e7e2509b3bf225 (patch)
tree53566bfe94a12e7fb2e28ec4122dfa6732f25a64 /system/database/drivers/pdo
parentdda21f6abc76451997b12c07e6066aa49c2d423d (diff)
parent0c5180bcfc996f32176f28895e9bd75be582c4fa (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/database/drivers/pdo')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php20
-rw-r--r--system/database/drivers/pdo/pdo_forge.php8
2 files changed, 14 insertions, 14 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index ec7f3e19b..b4ad52a45 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -65,7 +65,7 @@ class CI_DB_pdo_driver extends CI_DB {
{
parent::__construct($params);
- if (preg_match('/([^;]+):/', $this->dsn, $match) && count($match) == 2)
+ if (preg_match('/([^;]+):/', $this->dsn, $match) && count($match) === 2)
{
// If there is a minimum valid dsn string pattern found, we're done
// This is for general PDO users, who tend to have a full DSN string.
@@ -418,12 +418,12 @@ class CI_DB_pdo_driver extends CI_DB {
*/
protected function _list_tables($prefix_limit = FALSE)
{
- if ($this->pdodriver == 'pgsql')
+ if ($this->pdodriver === 'pgsql')
{
// Analog function to show all tables in postgre
$sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'";
}
- elseif ($this->pdodriver == 'sqlite')
+ elseif ($this->pdodriver === 'sqlite')
{
// Analog function to show all tables in sqlite
$sql = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'";
@@ -433,7 +433,7 @@ class CI_DB_pdo_driver extends CI_DB {
$sql = 'SHOW TABLES FROM '.$this->escape_identifiers($this->database);
}
- if ($prefix_limit !== FALSE AND $this->dbprefix != '')
+ if ($prefix_limit !== FALSE AND $this->dbprefix !== '')
{
return FALSE;
}
@@ -468,17 +468,17 @@ class CI_DB_pdo_driver extends CI_DB {
*/
protected function _field_data($table)
{
- if ($this->pdodriver == 'mysql' or $this->pdodriver == 'pgsql')
+ if ($this->pdodriver === 'mysql' or $this->pdodriver === 'pgsql')
{
// Analog function for mysql and postgre
return 'SELECT * FROM '.$this->escape_identifiers($table).' LIMIT 1';
}
- elseif ($this->pdodriver == 'oci')
+ elseif ($this->pdodriver === 'oci')
{
// Analog function for oci
return 'SELECT * FROM '.$this->escape_identifiers($table).' WHERE ROWNUM <= 1';
}
- elseif ($this->pdodriver == 'sqlite')
+ elseif ($this->pdodriver === 'sqlite')
{
// Analog function for sqlite
return 'PRAGMA table_info('.$this->escape_identifiers($table).')';
@@ -552,7 +552,7 @@ class CI_DB_pdo_driver extends CI_DB {
protected function _update_batch($table, $values, $index, $where = NULL)
{
$ids = array();
- $where = ($where != '' && count($where) >=1) ? implode(" ", $where).' AND ' : '';
+ $where = ($where !== '' && count($where) >=1) ? implode(" ", $where).' AND ' : '';
foreach ($values as $key => $val)
{
@@ -560,7 +560,7 @@ class CI_DB_pdo_driver extends CI_DB {
foreach (array_keys($val) as $field)
{
- if ($field != $index)
+ if ($field !== $index)
{
$final[$field][] = 'WHEN '.$index.' = '.$val[$index].' THEN '.$val[$field];
}
@@ -620,7 +620,7 @@ class CI_DB_pdo_driver extends CI_DB {
*/
protected function _limit($sql, $limit, $offset)
{
- if ($this->pdodriver == 'cubrid' OR $this->pdodriver == 'sqlite')
+ if ($this->pdodriver === 'cubrid' OR $this->pdodriver === 'sqlite')
{
$offset = ($offset == 0) ? '' : $offset.', ';
diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php
index ca8657a0f..aee8f718a 100644
--- a/system/database/drivers/pdo/pdo_forge.php
+++ b/system/database/drivers/pdo/pdo_forge.php
@@ -80,7 +80,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
if (array_key_exists('CONSTRAINT', $attributes))
{
// Exception for Postgre numeric which not too happy with constraint within those type
- if ( ! ($this->db->pdodriver == 'pgsql' && in_array($attributes['TYPE'], $numeric)))
+ if ( ! ($this->db->pdodriver === 'pgsql' && in_array($attributes['TYPE'], $numeric)))
{
$sql .= '('.$attributes['CONSTRAINT'].')';
}
@@ -168,14 +168,14 @@ class CI_DB_pdo_forge extends CI_DB_forge {
$sql = 'ALTER TABLE `'.$this->db->protect_identifiers($table).'` '.$alter_type.' '.$this->db->protect_identifiers($column_name);
// DROP has everything it needs now.
- if ($alter_type == 'DROP')
+ if ($alter_type === 'DROP')
{
return $sql;
}
$sql .= " $column_definition";
- if ($default_value != '')
+ if ($default_value !== '')
{
$sql .= " DEFAULT \"$default_value\"";
}
@@ -189,7 +189,7 @@ class CI_DB_pdo_forge extends CI_DB_forge {
$sql .= ' NOT NULL';
}
- if ($after_field != '')
+ if ($after_field !== '')
{
return $sql.' AFTER '.$this->db->protect_identifiers($after_field);
}