From 0b59f270a432f8c7b6128981f0a39b4a2e2fbd34 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 13 May 2008 04:22:33 +0000 Subject: Some sweeping syntax changes for consistency: (! foo) changed to ( ! foo) || changed to OR changed newline standardization code in various places from preg_replace to str_replace --- system/database/drivers/mssql/mssql_driver.php | 20 ++++++++--------- system/database/drivers/mssql/mssql_forge.php | 6 ++--- system/database/drivers/mssql/mssql_result.php | 6 ++--- system/database/drivers/mssql/mssql_utility.php | 6 ++--- system/database/drivers/mysql/mysql_driver.php | 20 ++++++++--------- system/database/drivers/mysql/mysql_forge.php | 6 ++--- system/database/drivers/mysql/mysql_result.php | 6 ++--- system/database/drivers/mysql/mysql_utility.php | 6 ++--- system/database/drivers/mysqli/mysqli_driver.php | 20 ++++++++--------- system/database/drivers/mysqli/mysqli_forge.php | 6 ++--- system/database/drivers/mysqli/mysqli_result.php | 6 ++--- system/database/drivers/mysqli/mysqli_utility.php | 6 ++--- system/database/drivers/oci8/oci8_driver.php | 26 +++++++++++----------- system/database/drivers/oci8/oci8_forge.php | 6 ++--- system/database/drivers/oci8/oci8_result.php | 6 ++--- system/database/drivers/oci8/oci8_utility.php | 6 ++--- system/database/drivers/odbc/odbc_driver.php | 20 ++++++++--------- system/database/drivers/odbc/odbc_forge.php | 6 ++--- system/database/drivers/odbc/odbc_result.php | 6 ++--- system/database/drivers/odbc/odbc_utility.php | 6 ++--- system/database/drivers/postgre/postgre_driver.php | 20 ++++++++--------- system/database/drivers/postgre/postgre_forge.php | 6 ++--- system/database/drivers/postgre/postgre_result.php | 6 ++--- .../database/drivers/postgre/postgre_utility.php | 6 ++--- system/database/drivers/sqlite/sqlite_driver.php | 24 ++++++++++---------- system/database/drivers/sqlite/sqlite_forge.php | 8 +++---- system/database/drivers/sqlite/sqlite_result.php | 6 ++--- system/database/drivers/sqlite/sqlite_utility.php | 8 +++---- 28 files changed, 140 insertions(+), 140 deletions(-) (limited to 'system/database/drivers') diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index f789634f8..34ad9799e 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -1,4 +1,4 @@ -trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -162,7 +162,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -187,7 +187,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -492,7 +492,7 @@ class CI_DB_mssql_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -540,7 +540,7 @@ class CI_DB_mssql_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -587,7 +587,7 @@ class CI_DB_mssql_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -599,7 +599,7 @@ class CI_DB_mssql_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -641,6 +641,6 @@ class CI_DB_mssql_driver extends CI_DB { } - -/* End of file mssql_driver.php */ + +/* End of file mssql_driver.php */ /* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index d42fd5ee6..ddd1bb6ae 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -1,4 +1,4 @@ -trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -192,7 +192,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -218,7 +218,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -495,7 +495,7 @@ class CI_DB_mysql_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -543,7 +543,7 @@ class CI_DB_mysql_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -589,7 +589,7 @@ class CI_DB_mysql_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -601,7 +601,7 @@ class CI_DB_mysql_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -649,6 +649,6 @@ class CI_DB_mysql_driver extends CI_DB { } - -/* End of file mysql_driver.php */ + +/* End of file mysql_driver.php */ /* Location: ./system/database/drivers/mysql/mysql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 6701c42d5..a631e4301 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -1,4 +1,4 @@ -trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -195,7 +195,7 @@ class CI_DB_mysqli_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -221,7 +221,7 @@ class CI_DB_mysqli_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -491,7 +491,7 @@ class CI_DB_mysqli_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -539,7 +539,7 @@ class CI_DB_mysqli_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -586,7 +586,7 @@ class CI_DB_mysqli_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -598,7 +598,7 @@ class CI_DB_mysqli_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -645,6 +645,6 @@ class CI_DB_mysqli_driver extends CI_DB { } - -/* End of file mysqli_driver.php */ + +/* End of file mysqli_driver.php */ /* Location: ./system/database/drivers/mysqli/mysqli_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 087f9b80b..f767acbea 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -1,4 +1,4 @@ -stmt_id)) + if ( ! is_resource($this->stmt_id)) { $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); } @@ -254,7 +254,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function _bind_params($params) { - if (! is_array($params) OR ! is_resource($this->stmt_id)) + if ( ! is_array($params) OR ! is_resource($this->stmt_id)) { return; } @@ -263,7 +263,7 @@ class CI_DB_oci8_driver extends CI_DB { { foreach (array('name', 'value', 'type', 'length') as $val) { - if (! isset($param[$val])) + if ( ! isset($param[$val])) { $param[$val] = ''; } @@ -283,7 +283,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function trans_begin($test_mode = FALSE) { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -313,7 +313,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -339,7 +339,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -603,7 +603,7 @@ class CI_DB_oci8_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -651,7 +651,7 @@ class CI_DB_oci8_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -697,7 +697,7 @@ class CI_DB_oci8_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -709,7 +709,7 @@ class CI_DB_oci8_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -761,6 +761,6 @@ class CI_DB_oci8_driver extends CI_DB { } - -/* End of file oci8_driver.php */ + +/* End of file oci8_driver.php */ /* Location: ./system/database/drivers/oci8/oci8_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 64dd2a202..9f3fac54f 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -1,4 +1,4 @@ -trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -181,7 +181,7 @@ class CI_DB_odbc_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -207,7 +207,7 @@ class CI_DB_odbc_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -464,7 +464,7 @@ class CI_DB_odbc_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -512,7 +512,7 @@ class CI_DB_odbc_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -559,7 +559,7 @@ class CI_DB_odbc_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -571,7 +571,7 @@ class CI_DB_odbc_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -613,6 +613,6 @@ class CI_DB_odbc_driver extends CI_DB { } - -/* End of file odbc_driver.php */ + +/* End of file odbc_driver.php */ /* Location: ./system/database/drivers/odbc/odbc_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index fb011f298..60df616c3 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -1,4 +1,4 @@ -trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -179,7 +179,7 @@ class CI_DB_postgre_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -203,7 +203,7 @@ class CI_DB_postgre_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -488,7 +488,7 @@ class CI_DB_postgre_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -536,7 +536,7 @@ class CI_DB_postgre_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -583,7 +583,7 @@ class CI_DB_postgre_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -595,7 +595,7 @@ class CI_DB_postgre_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -641,6 +641,6 @@ class CI_DB_postgre_driver extends CI_DB { } - -/* End of file postgre_driver.php */ + +/* End of file postgre_driver.php */ /* Location: ./system/database/drivers/postgre/postgre_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index fb4fcf128..f8dfca8a1 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -1,4 +1,4 @@ -database, FILE_WRITE_MODE, $error)) + if ( ! $conn_id = @sqlite_open($this->database, FILE_WRITE_MODE, $error)) { log_message('error', $error); @@ -73,7 +73,7 @@ class CI_DB_sqlite_driver extends CI_DB { */ function db_pconnect() { - if (! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error)) + if ( ! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error)) { log_message('error', $error); @@ -171,7 +171,7 @@ class CI_DB_sqlite_driver extends CI_DB { */ function trans_begin($test_mode = FALSE) { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -201,7 +201,7 @@ class CI_DB_sqlite_driver extends CI_DB { */ function trans_commit() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -226,7 +226,7 @@ class CI_DB_sqlite_driver extends CI_DB { */ function trans_rollback() { - if (! $this->trans_enabled) + if ( ! $this->trans_enabled) { return TRUE; } @@ -482,7 +482,7 @@ class CI_DB_sqlite_driver extends CI_DB { */ function _from_tables($tables) { - if (! is_array($tables)) + if ( ! is_array($tables)) { $tables = array($tables); } @@ -530,7 +530,7 @@ class CI_DB_sqlite_driver extends CI_DB { $valstr[] = $key." = ".$val; } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; $orderby = (count($orderby) >= 1)?' ORDER BY '.implode(", ", $orderby):''; @@ -577,7 +577,7 @@ class CI_DB_sqlite_driver extends CI_DB { { $conditions = ''; - if (count($where) > 0 || count($like) > 0) + if (count($where) > 0 OR count($like) > 0) { $conditions = "\nWHERE "; $conditions .= implode("\n", $this->ar_where); @@ -589,7 +589,7 @@ class CI_DB_sqlite_driver extends CI_DB { $conditions .= implode("\n", $like); } - $limit = (!$limit) ? '' : ' LIMIT '.$limit; + $limit = ( ! $limit) ? '' : ' LIMIT '.$limit; return "DELETE FROM ".$table.$conditions.$limit; } @@ -656,6 +656,6 @@ class CI_DB_sqlite_driver extends CI_DB { } - -/* End of file sqlite_driver.php */ + +/* End of file sqlite_driver.php */ /* Location: ./system/database/drivers/sqlite/sqlite_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 8a1a4da01..25c74a731 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -1,4 +1,4 @@ -db->database) OR ! @unlink($this->db->database)) + if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) { if ($this->db->db_debug) { @@ -231,6 +231,6 @@ class CI_DB_sqlite_forge extends CI_DB_forge { } } - -/* End of file sqlite_forge.php */ + +/* End of file sqlite_forge.php */ /* Location: ./system/database/drivers/sqlite/sqlite_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 72c93fd48..8bb0d9d0b 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -1,4 +1,4 @@ -db->database) OR ! @unlink($this->db->database)) + if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) { if ($this->db->db_debug) { @@ -136,6 +136,6 @@ class CI_DB_sqlite_utility extends CI_DB_utility { } } - -/* End of file sqlite_utility.php */ + +/* End of file sqlite_utility.php */ /* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b