diff options
author | admin <devnull@localhost> | 2006-10-21 21:44:22 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-21 21:44:22 +0200 |
commit | e334c472fb4be44feec3a73402fc4a2b062cbfc0 (patch) | |
tree | 553f17d67e7ef652016ec85b2a576bb2210f0ff8 /system/database/drivers | |
parent | bd6bee75dd26ade1c8d9cfd104bb913065797c59 (diff) |
Diffstat (limited to 'system/database/drivers')
21 files changed, 797 insertions, 797 deletions
diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 4dc8792ca..a1d7d29ed 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -106,18 +106,18 @@ class CI_DB_mssql_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) - { + function _prep_query($sql) + { return $sql; - } + } // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -133,8 +133,8 @@ class CI_DB_mssql_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; $this->simple_query('BEGIN TRAN'); @@ -145,9 +145,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -170,9 +170,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index 0ba0b8c57..230c1b55b 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -65,7 +65,7 @@ class CI_DB_mssql_result extends CI_DB_result { $field_names = array(); while ($field = mssql_fetch_field($this->result_id)) { - $field_names[] = $field->name; + $field_names[] = $field->name; } return $field_names; @@ -116,8 +116,8 @@ class CI_DB_mssql_result extends CI_DB_result { { if (is_resource($this->result_id)) { - mssql_free_result($this->result_id); - $this->result_id = FALSE; + mssql_free_result($this->result_id); + $this->result_id = FALSE; } } diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index 24ff1e13c..4a49f533e 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -74,7 +74,7 @@ class CI_DB_mssql_utility extends CI_DB_utility { */ function _list_databases() { - return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases + return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 20311ffa0..be7c672f7 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -32,10 +32,10 @@ class CI_DB_mysql_driver extends CI_DB { /** * Whether to use the MySQL "delete hack" which allows the number - * of affected rows to be shown. Uses a preg_replace when enabled, + * of affected rows to be shown. Uses a preg_replace when enabled, * adding a bit more processing to all queries. */ - var $delete_hack = TRUE; + var $delete_hack = TRUE; /** * Non-persistent database connection @@ -113,28 +113,28 @@ class CI_DB_mysql_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) - { - // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + function _prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies // the query so that it returns the number of affected rows if ($this->delete_hack === TRUE) { - if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) { $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); } } return $sql; - } - + } + // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -150,8 +150,8 @@ class CI_DB_mysql_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; $this->simple_query('SET AUTOCOMMIT=0'); @@ -163,9 +163,9 @@ class CI_DB_mysql_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -189,9 +189,9 @@ class CI_DB_mysql_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { @@ -227,8 +227,8 @@ class CI_DB_mysql_driver extends CI_DB { return $str; } - if (function_exists('mysql_real_escape_string')) - { + if (function_exists('mysql_real_escape_string')) + { return mysql_real_escape_string($str, $this->conn_id); } elseif (function_exists('mysql_escape_string')) @@ -237,8 +237,8 @@ class CI_DB_mysql_driver extends CI_DB { } else { - return addslashes($str); - } + return addslashes($str); + } } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 1cf6ff188..4bfaf54a4 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -7,7 +7,7 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource @@ -65,7 +65,7 @@ class CI_DB_mysql_result extends CI_DB_result { $field_names = array(); while ($field = mysql_fetch_field($this->result_id)) { - $field_names[] = $field->name; + $field_names[] = $field->name; } return $field_names; @@ -116,8 +116,8 @@ class CI_DB_mysql_result extends CI_DB_result { { if (is_resource($this->result_id)) { - mysql_free_result($this->result_id); - $this->result_id = FALSE; + mysql_free_result($this->result_id); + $this->result_id = FALSE; } } diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index b387ace9e..b0a7dfea7 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -7,7 +7,7 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource @@ -129,39 +129,39 @@ class CI_DB_mysql_utility extends CI_DB_utility { // Build the output $output = ''; - foreach ((array)$tables as $table) - { - // Is the table in the "ignore" list? + foreach ((array)$tables as $table) + { + // Is the table in the "ignore" list? if (in_array($table, (array)$ignore, TRUE)) { - continue; - } + continue; + } - // Get the table schema + // Get the table schema $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); // No result means the table name was invalid - if ($query === FALSE) - { - continue; - } - - // Write out the table schema - $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; - + if ($query === FALSE) + { + continue; + } + + // Write out the table schema + $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; + if ($add_drop == TRUE) { - $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; + $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; } $i = 0; $result = $query->result_array(); foreach ($result[0] as $val) { - if ($i++ % 2) - { - $output .= $val.';'.$newline.$newline; - } + if ($i++ % 2) + { + $output .= $val.';'.$newline.$newline; + } } // If inserts are not needed we're done... @@ -179,7 +179,7 @@ class CI_DB_mysql_utility extends CI_DB_utility { } // Fetch the field names and determine if the field is an - // integer type. We use this info to decide whether to + // integer type. We use this info to decide whether to // surround the data with quotes or not $i = 0; @@ -188,13 +188,13 @@ class CI_DB_mysql_utility extends CI_DB_utility { while ($field = mysql_fetch_field($query->result_id)) { $is_int[$i] = (in_array( - strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), + strtolower(mysql_field_type($query->result_id, $i)), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), TRUE) ) ? TRUE : FALSE; // Create a string of field names - $field_str .= $field->name.', '; + $field_str .= $field->name.', '; $i++; } @@ -211,8 +211,8 @@ class CI_DB_mysql_utility extends CI_DB_utility { foreach ($row as $v) { // Do a little formatting... - $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); - $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); + $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); + $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); $v = str_replace('\\', '\\\\', $v); $v = str_replace('\'', '\\\'', $v); $v = str_replace('\\\n', '\n', $v); diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index ea2adbea9..59420912f 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -32,10 +32,10 @@ class CI_DB_mysqli_driver extends CI_DB { /** * Whether to use the MySQL "delete hack" which allows the number - * of affected rows to be shown. Uses a preg_replace when enabled, + * of affected rows to be shown. Uses a preg_replace when enabled, * adding a bit more processing to all queries. */ - var $delete_hack = TRUE; + var $delete_hack = TRUE; // -------------------------------------------------------------------- @@ -116,28 +116,28 @@ class CI_DB_mysqli_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) - { - // "DELETE FROM TABLE" returns 0 affected rows This hack modifies + function _prep_query($sql) + { + // "DELETE FROM TABLE" returns 0 affected rows This hack modifies // the query so that it returns the number of affected rows if ($this->delete_hack === TRUE) { - if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) + if (preg_match('/^\s*DELETE\s+FROM\s+(\S+)\s*$/i', $sql)) { $sql = preg_replace("/^\s*DELETE\s+FROM\s+(\S+)\s*$/", "DELETE FROM \\1 WHERE 1=1", $sql); } } return $sql; - } + } // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -153,8 +153,8 @@ class CI_DB_mysqli_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; $this->simple_query('SET AUTOCOMMIT=0'); @@ -166,9 +166,9 @@ class CI_DB_mysqli_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -192,9 +192,9 @@ class CI_DB_mysqli_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 215403e9d..5e4e65ff7 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -65,7 +65,7 @@ class CI_DB_mysqli_result extends CI_DB_result { $field_names = array(); while ($field = mysql_fetch_field($this->result_id)) { - $field_names[] = $field->name; + $field_names[] = $field->name; } return $field_names; @@ -116,8 +116,8 @@ class CI_DB_mysqli_result extends CI_DB_result { { if (is_resource($this->result_id)) { - mysqli_free_result($this->result_id); - $this->result_id = FALSE; + mysqli_free_result($this->result_id); + $this->result_id = FALSE; } } diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index 17af40b76..a7bdb708e 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -129,39 +129,39 @@ class CI_DB_mysqli_utility extends CI_DB_utility { // Build the output $output = ''; - foreach ((array)$tables as $table) - { - // Is the table in the "ignore" list? + foreach ((array)$tables as $table) + { + // Is the table in the "ignore" list? if (in_array($table, (array)$ignore, TRUE)) { - continue; - } + continue; + } - // Get the table schema + // Get the table schema $query = $this->db->query("SHOW CREATE TABLE `".$this->db->database.'`.'.$table); // No result means the table name was invalid - if ($query === FALSE) - { - continue; - } - - // Write out the table schema - $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; - + if ($query === FALSE) + { + continue; + } + + // Write out the table schema + $output .= '#'.$newline.'# TABLE STRUCTURE FOR: '.$table.$newline.'#'.$newline.$newline; + if ($add_drop == TRUE) { - $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; + $output .= 'DROP TABLE IF EXISTS '.$table.';'.$newline.$newline; } $i = 0; $result = $query->result_array(); foreach ($result[0] as $val) { - if ($i++ % 2) - { - $output .= $val.';'.$newline.$newline; - } + if ($i++ % 2) + { + $output .= $val.';'.$newline.$newline; + } } // If inserts are not needed we're done... @@ -179,7 +179,7 @@ class CI_DB_mysqli_utility extends CI_DB_utility { } // Fetch the field names and determine if the field is an - // integer type. We use this info to decide whether to + // integer type. We use this info to decide whether to // surround the data with quotes or not $i = 0; @@ -188,13 +188,13 @@ class CI_DB_mysqli_utility extends CI_DB_utility { while ($field = mysqli_fetch_field($query->result_id)) { $is_int[$i] = (in_array( - strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), + strtolower(mysql_field_type($query->result_id, $i)), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), TRUE) ) ? TRUE : FALSE; // Create a string of field names - $field_str .= $field->name.', '; + $field_str .= $field->name.', '; $i++; } @@ -211,8 +211,8 @@ class CI_DB_mysqli_utility extends CI_DB_utility { foreach ($row as $v) { // Do a little formatting... - $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); - $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); + $v = str_replace(array("\x00", "\x0a", "\x0d", "\x1a"), array('\0', '\n', '\r', '\Z'), $v); + $v = str_replace(array("\n", "\r", "\t"), array('\n', '\r', '\t'), $v); $v = str_replace('\\', '\\\\', $v); $v = str_replace('\'', '\\\'', $v); $v = str_replace('\\\n', '\n', $v); diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 4f5470c1a..c091edf64 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -4,12 +4,12 @@ * * An open source application development framework for PHP 4.3.2 or newer * - * @package CodeIgniter - * @author Rick Ellis + * @package CodeIgniter + * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html - * @link http://www.codeigniter.com - * @since Version 1.0 + * @license http://www.codeignitor.com/user_guide/license.html + * @link http://www.codeigniter.com + * @since Version 1.0 * @filesource */ @@ -22,182 +22,182 @@ * creates dynamically based on whether the active record * class is being used or not. * - * @package CodeIgniter + * @package CodeIgniter * @subpackage Drivers - * @category Database - * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/database/ + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/database/ */ /** * oci8 Database Adapter Class * - * This is a modification of the DB_driver class to + * This is a modification of the DB_driver class to * permit access to oracle databases * * NOTE: this uses the PHP 4 oci methods * - * @author Kelly McArdle + * @author Kelly McArdle * */ class CI_DB_oci8_driver extends CI_DB { // Set "auto commit" by default - var $_commit = OCI_COMMIT_ON_SUCCESS; - - // need to track statement id and cursor id - var $stmt_id; - var $curs_id; - - // if we use a limit, we will add a field that will - // throw off num_fields later - var $limit_used; - - /** - * Non-persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_connect() - { - return ocilogon($this->username, $this->password, $this->hostname); - } - - // -------------------------------------------------------------------- - - /** - * Persistent database connection - * - * @access private called by the base class - * @return resource - */ - function db_pconnect() - { - return ociplogon($this->username, $this->password, $this->hostname); - } - - // -------------------------------------------------------------------- - - /** - * Select the database - * - * @access private called by the base class - * @return resource - */ - function db_select() - { - return TRUE; - } + var $_commit = OCI_COMMIT_ON_SUCCESS; + + // need to track statement id and cursor id + var $stmt_id; + var $curs_id; + + // if we use a limit, we will add a field that will + // throw off num_fields later + var $limit_used; + + /** + * Non-persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_connect() + { + return ocilogon($this->username, $this->password, $this->hostname); + } + + // -------------------------------------------------------------------- + + /** + * Persistent database connection + * + * @access private called by the base class + * @return resource + */ + function db_pconnect() + { + return ociplogon($this->username, $this->password, $this->hostname); + } + + // -------------------------------------------------------------------- + + /** + * Select the database + * + * @access private called by the base class + * @return resource + */ + function db_select() + { + return TRUE; + } + + // -------------------------------------------------------------------- + + /** + * Version number query string + * + * @access public + * @return string + */ + function _version() + { + return ociserverversion($this->conn_id); + } // -------------------------------------------------------------------- - /** - * Version number query string - * - * @access public - * @return string - */ - function _version() - { - return ociserverversion($this->conn_id); - } - - // -------------------------------------------------------------------- - - /** - * Execute the query - * - * @access private called by the base class - * @param string an SQL query - * @return resource - */ - function _execute($sql) - { - // oracle must parse the query before it is run. All of the actions with - // the query are based on the statement id returned by ociparse - $this->_set_stmt_id($sql); - ocisetprefetch($this->stmt_id, 1000); - return @ociexecute($this->stmt_id, $this->_commit); - } - - /** - * Generate a statement ID - * - * @access private - * @param string an SQL query - * @return none - */ - function _set_stmt_id($sql) - { - if ( ! is_resource($this->stmt_id)) - { + /** + * Execute the query + * + * @access private called by the base class + * @param string an SQL query + * @return resource + */ + function _execute($sql) + { + // oracle must parse the query before it is run. All of the actions with + // the query are based on the statement id returned by ociparse + $this->_set_stmt_id($sql); + ocisetprefetch($this->stmt_id, 1000); + return @ociexecute($this->stmt_id, $this->_commit); + } + + /** + * Generate a statement ID + * + * @access private + * @param string an SQL query + * @return none + */ + function _set_stmt_id($sql) + { + if ( ! is_resource($this->stmt_id)) + { $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); - } - } - - // -------------------------------------------------------------------- - - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @access private called by execute() - * @param string an SQL query - * @return string - */ - function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - - /** - * getCursor. Returns a cursor from the datbase - * - * @access public - * @return cursor id - */ - function get_cursor() - { + } + } + + // -------------------------------------------------------------------- + + /** + * Prep the query + * + * If needed, each database adapter can prep the query string + * + * @access private called by execute() + * @param string an SQL query + * @return string + */ + function _prep_query($sql) + { + return $sql; + } + + // -------------------------------------------------------------------- + + /** + * getCursor. Returns a cursor from the datbase + * + * @access public + * @return cursor id + */ + function get_cursor() + { $this->curs_id = ocinewcursor($this->conn_id); return $this->curs_id; - } - - // -------------------------------------------------------------------- - - /** - * Stored Procedure. Executes a stored procedure - * - * @access public - * @param package package stored procedure is in - * @param procedure stored procedure to execute - * @param params array of parameters - * @return array - * - * params array keys - * - * KEY OPTIONAL NOTES - * name no the name of the parameter should be in :<param_name> format - * value no the value of the parameter. If this is an OUT or IN OUT parameter, - * this should be a reference to a variable - * type yes the type of the parameter - * length yes the max size of the parameter - */ - function stored_procedure($package, $procedure, $params) - { - if ($package == '' OR $procedure == '' OR ! is_array($params)) - { - if ($this->db_debug) - { - log_message('error', 'Invalid query: '.$package.'.'.$procedure); - return $this->display_error('db_invalid_query'); - } - return FALSE; - } + } + + // -------------------------------------------------------------------- + + /** + * Stored Procedure. Executes a stored procedure + * + * @access public + * @param package package stored procedure is in + * @param procedure stored procedure to execute + * @param params array of parameters + * @return array + * + * params array keys + * + * KEY OPTIONAL NOTES + * name no the name of the parameter should be in :<param_name> format + * value no the value of the parameter. If this is an OUT or IN OUT parameter, + * this should be a reference to a variable + * type yes the type of the parameter + * length yes the max size of the parameter + */ + function stored_procedure($package, $procedure, $params) + { + if ($package == '' OR $procedure == '' OR ! is_array($params)) + { + if ($this->db_debug) + { + log_message('error', 'Invalid query: '.$package.'.'.$procedure); + return $this->display_error('db_invalid_query'); + } + return FALSE; + } // build the query string $sql = "begin $package.$procedure("; @@ -216,18 +216,18 @@ class CI_DB_oci8_driver extends CI_DB { $this->stmt_id = FALSE; $this->_set_stmt_id($sql); - $this->_bind_params($params); + $this->_bind_params($params); $this->query($sql, FALSE, $have_cursor); } - // -------------------------------------------------------------------- - - /** - * Bind parameters - * - * @access private - * @return none - */ + // -------------------------------------------------------------------- + + /** + * Bind parameters + * + * @access private + * @return none + */ function _bind_params($params) { if ( ! is_array($params) OR ! is_resource($this->stmt_id)) @@ -235,27 +235,27 @@ class CI_DB_oci8_driver extends CI_DB { return; } - foreach ($params as $param) - { + foreach ($params as $param) + { foreach (array('name', 'value', 'type', 'length') as $val) - { - if ( ! isset($param[$val])) - { - $param[$val] = ''; - } - } - + { + if ( ! isset($param[$val])) + { + $param[$val] = ''; + } + } + ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); - } + } } // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -271,8 +271,8 @@ class CI_DB_oci8_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; $this->_commit = OCI_DEFAULT; @@ -283,9 +283,9 @@ class CI_DB_oci8_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -309,9 +309,9 @@ class CI_DB_oci8_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { @@ -331,272 +331,272 @@ class CI_DB_oci8_driver extends CI_DB { return $ret; } - // -------------------------------------------------------------------- - - /** - * Escape String - * - * @access public - * @param string - * @return string - */ - function escape_str($str) - { - return $str; - } - - // -------------------------------------------------------------------- - - /** - * Affected Rows - * - * @access public - * @return integer - */ - function affected_rows() - { - return @ocirowcount($this->stmt_id); - } - - // -------------------------------------------------------------------- - - /** - * Insert ID - * - * @access public - * @return integer - */ - function insert_id() - { - // not supported in oracle - return 0; - } - - // -------------------------------------------------------------------- - - /** - * "Count All" query - * - * Generates a platform-specific query string that counts all records in - * the specified database - * - * @access public - * @param string - * @return string - */ - function count_all($table = '') - { - if ($table == '') - return '0'; - - $query = $this->query("SELECT COUNT(1) AS numrows FROM ".$table); - - if ($query == FALSE) - { - return 0; - } - - $row = $query->row(); - return $row->NUMROWS; - } - - // -------------------------------------------------------------------- - - /** - * Show table query - * - * Generates a platform-specific query string so that the table names can be fetched - * - * @access private - * @return string - */ - function _list_tables() - { - return "SELECT TABLE_NAME FROM ALL_TABLES"; - } - - // -------------------------------------------------------------------- - - /** - * Show column query - * - * Generates a platform-specific query string so that the column names can be fetched - * - * @access public - * @param string the table name - * @return string - */ - function _list_columns($table = '') - { - return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; - } - - // -------------------------------------------------------------------- - - /** - * Field data query - * - * Generates a platform-specific query so that the column data can be retrieved - * - * @access public - * @param string the table name - * @return object - */ - function _field_data($table) - { + // -------------------------------------------------------------------- + + /** + * Escape String + * + * @access public + * @param string + * @return string + */ + function escape_str($str) + { + return $str; + } + + // -------------------------------------------------------------------- + + /** + * Affected Rows + * + * @access public + * @return integer + */ + function affected_rows() + { + return @ocirowcount($this->stmt_id); + } + + // -------------------------------------------------------------------- + + /** + * Insert ID + * + * @access public + * @return integer + */ + function insert_id() + { + // not supported in oracle + return 0; + } + + // -------------------------------------------------------------------- + + /** + * "Count All" query + * + * Generates a platform-specific query string that counts all records in + * the specified database + * + * @access public + * @param string + * @return string + */ + function count_all($table = '') + { + if ($table == '') + return '0'; + + $query = $this->query("SELECT COUNT(1) AS numrows FROM ".$table); + + if ($query == FALSE) + { + return 0; + } + + $row = $query->row(); + return $row->NUMROWS; + } + + // -------------------------------------------------------------------- + + /** + * Show table query + * + * Generates a platform-specific query string so that the table names can be fetched + * + * @access private + * @return string + */ + function _list_tables() + { + return "SELECT TABLE_NAME FROM ALL_TABLES"; + } + + // -------------------------------------------------------------------- + + /** + * Show column query + * + * Generates a platform-specific query string so that the column names can be fetched + * + * @access public + * @param string the table name + * @return string + */ + function _list_columns($table = '') + { + return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; + } + + // -------------------------------------------------------------------- + + /** + * Field data query + * + * Generates a platform-specific query so that the column data can be retrieved + * + * @access public + * @param string the table name + * @return object + */ + function _field_data($table) + { return "SELECT * FROM ".$this->_escape_table($table)." where rownum = 1"; - } - - // -------------------------------------------------------------------- - - /** - * The error message string - * - * @access private - * @return string - */ - function _error_message() - { - $error = ocierror($this->conn_id); - return $error['message']; - } - - // -------------------------------------------------------------------- - - /** - * The error message number - * - * @access private - * @return integer - */ - function _error_number() - { - $error = ocierror($this->conn_id); - return $error['code']; - } - - // -------------------------------------------------------------------- - - /** - * Escape Table Name - * - * This function adds backticks if the table name has a period - * in it. Some DBs will get cranky unless periods are escaped - * - * @access private - * @param string the table name - * @return string - */ - function _escape_table($table) - { - if (stristr($table, '.')) - { - $table = preg_replace("/\./", "`.`", $table); - } - - return $table; - } - - // -------------------------------------------------------------------- - - /** - * Insert statement - * - * Generates a platform-specific insert string from the supplied data - * - * @access public - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string - */ - function _insert($table, $keys, $values) - { - return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; - } - - // -------------------------------------------------------------------- - - /** - * Update statement - * - * Generates a platform-specific update string from the supplied data - * - * @access public - * @param string the table name - * @param array the update data - * @param array the where clause - * @return string - */ - function _update($table, $values, $where) - { - foreach($values as $key => $val) - { - $valstr[] = $key." = ".$val; - } - - return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Delete statement - * - * Generates a platform-specific delete string from the supplied data - * - * @access public - * @param string the table name - * @param array the where clause - * @return string - */ - function _delete($table, $where) - { - return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); - } - - // -------------------------------------------------------------------- - - /** - * Limit string - * - * Generates a platform-specific LIMIT clause - * - * @access public - * @param string the sql query string - * @param integer the number of rows to limit the query to - * @param integer the offset value - * @return string - */ - function _limit($sql, $limit, $offset) - { - $limit = $offset + $limit; - $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; - - if ($offset != 0) - { - $newsql .= " WHERE rnum >= $offset"; - } - - // remember that we used limits - $this->limit_used = TRUE; - - return $newsql; - } - - // -------------------------------------------------------------------- - - /** - * Close DB Connection - * - * @access public - * @param resource - * @return void - */ - function _close($conn_id) - { - ocilogoff($conn_id); - } + } + + // -------------------------------------------------------------------- + + /** + * The error message string + * + * @access private + * @return string + */ + function _error_message() + { + $error = ocierror($this->conn_id); + return $error['message']; + } + + // -------------------------------------------------------------------- + + /** + * The error message number + * + * @access private + * @return integer + */ + function _error_number() + { + $error = ocierror($this->conn_id); + return $error['code']; + } + + // -------------------------------------------------------------------- + + /** + * Escape Table Name + * + * This function adds backticks if the table name has a period + * in it. Some DBs will get cranky unless periods are escaped + * + * @access private + * @param string the table name + * @return string + */ + function _escape_table($table) + { + if (stristr($table, '.')) + { + $table = preg_replace("/\./", "`.`", $table); + } + + return $table; + } + + // -------------------------------------------------------------------- + + /** + * Insert statement + * + * Generates a platform-specific insert string from the supplied data + * + * @access public + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string + */ + function _insert($table, $keys, $values) + { + return "INSERT INTO ".$this->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + + /** + * Update statement + * + * Generates a platform-specific update string from the supplied data + * + * @access public + * @param string the table name + * @param array the update data + * @param array the where clause + * @return string + */ + function _update($table, $values, $where) + { + foreach($values as $key => $val) + { + $valstr[] = $key." = ".$val; + } + + return "UPDATE ".$this->_escape_table($table)." SET ".implode(', ', $valstr)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Delete statement + * + * Generates a platform-specific delete string from the supplied data + * + * @access public + * @param string the table name + * @param array the where clause + * @return string + */ + function _delete($table, $where) + { + return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); + } + + // -------------------------------------------------------------------- + + /** + * Limit string + * + * Generates a platform-specific LIMIT clause + * + * @access public + * @param string the sql query string + * @param integer the number of rows to limit the query to + * @param integer the offset value + * @return string + */ + function _limit($sql, $limit, $offset) + { + $limit = $offset + $limit; + $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; + + if ($offset != 0) + { + $newsql .= " WHERE rnum >= $offset"; + } + + // remember that we used limits + $this->limit_used = TRUE; + + return $newsql; + } + + // -------------------------------------------------------------------- + + /** + * Close DB Connection + * + * @access public + * @param resource + * @return void + */ + function _close($conn_id) + { + ocilogoff($conn_id); + } } diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index ab13a3935..947a76109 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -4,12 +4,12 @@ * * An open source application development framework for PHP 4.3.2 or newer * - * @package CodeIgniter - * @author Rick Ellis + * @package CodeIgniter + * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html - * @link http://www.codeigniter.com - * @since Version 1.0 + * @license http://www.codeignitor.com/user_guide/license.html + * @link http://www.codeigniter.com + * @since Version 1.0 * @filesource */ @@ -20,59 +20,59 @@ * * This class extends the parent result class: CI_DB_result * - * @category Database - * @author Rick Ellis - * @link http://www.codeigniter.com/user_guide/database/ + * @category Database + * @author Rick Ellis + * @link http://www.codeigniter.com/user_guide/database/ */ class CI_DB_oci8_result extends CI_DB_result { - var $stmt_id; - var $curs_id; - var $limit_used; - - /** - * Number of rows in the result set - * - * @access public - * @return integer - */ - function num_rows() - { - // get the results, count them, - // rerun query - otherwise we - // won't have data after calling - // num_rows() - $this->result_array(); - $rowcount = count($this->result_array); - @ociexecute($this->stmt_id); - if ($this->curs_id) + var $stmt_id; + var $curs_id; + var $limit_used; + + /** + * Number of rows in the result set + * + * @access public + * @return integer + */ + function num_rows() + { + // get the results, count them, + // rerun query - otherwise we + // won't have data after calling + // num_rows() + $this->result_array(); + $rowcount = count($this->result_array); + @ociexecute($this->stmt_id); + if ($this->curs_id) { @ociexecute($this->curs_id); } - return $rowcount; - } - - // -------------------------------------------------------------------- - - /** - * Number of fields in the result set - * - * @access public - * @return integer - */ - function num_fields() - { - $count = @ocinumcols($this->stmt_id); - - // if we used a limit, we added a field, - // subtract it out - if ($this->limit_used) - { - $count = $count - 1; - } - - return $count; - } + return $rowcount; + } + + // -------------------------------------------------------------------- + + /** + * Number of fields in the result set + * + * @access public + * @return integer + */ + function num_fields() + { + $count = @ocinumcols($this->stmt_id); + + // if we used a limit, we added a field, + // subtract it out + if ($this->limit_used) + { + $count = $count - 1; + } + + return $count; + } // -------------------------------------------------------------------- @@ -87,11 +87,11 @@ class CI_DB_oci8_result extends CI_DB_result { function list_fields() { $field_names = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $c <= $fieldCount; $c++) - { - $field_names[] = ocicolumnname($this->stmt_id, $c); - } + $fieldCount = $this->num_fields(); + for ($c = 1; $c <= $fieldCount; $c++) + { + $field_names[] = ocicolumnname($this->stmt_id, $c); + } return $field_names; } @@ -101,32 +101,32 @@ class CI_DB_oci8_result extends CI_DB_result { return $this->list_fields(); } - // -------------------------------------------------------------------- - - /** - * Field data - * - * Generates an array of objects containing field meta-data - * - * @access public - * @return array - */ - function field_data() - { - $retval = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $c <= $fieldCount; $c++) - { - $F = new stdClass(); - $F->name = ocicolumnname($this->stmt_id, $c); - $F->type = ocicolumntype($this->stmt_id, $c); - $F->max_length = ocicolumnsize($this->stmt_id, $c); - - $retval[] = $F; - } - - return $retval; - } + // -------------------------------------------------------------------- + + /** + * Field data + * + * Generates an array of objects containing field meta-data + * + * @access public + * @return array + */ + function field_data() + { + $retval = array(); + $fieldCount = $this->num_fields(); + for ($c = 1; $c <= $fieldCount; $c++) + { + $F = new stdClass(); + $F->name = ocicolumnname($this->stmt_id, $c); + $F->type = ocicolumntype($this->stmt_id, $c); + $F->max_length = ocicolumnsize($this->stmt_id, $c); + + $retval[] = $F; + } + + return $retval; + } // -------------------------------------------------------------------- @@ -139,25 +139,25 @@ class CI_DB_oci8_result extends CI_DB_result { { if (is_resource($this->result_id)) { - OCIFreeStatement($this->result_id); - $this->result_id = FALSE; + OCIFreeStatement($this->result_id); + $this->result_id = FALSE; } } - // -------------------------------------------------------------------- - - /** - * Result - associative array - * - * Returns the result set as an array - * - * @access private - * @return array - */ - function _fetch_assoc(&$row) - { - // if pulling from a cursor, use curs_id - if ($this->curs_id) + // -------------------------------------------------------------------- + + /** + * Result - associative array + * + * Returns the result set as an array + * + * @access private + * @return array + */ + function _fetch_assoc(&$row) + { + // if pulling from a cursor, use curs_id + if ($this->curs_id) { return ocifetchinto($this->curs_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); } @@ -165,7 +165,7 @@ class CI_DB_oci8_result extends CI_DB_result { { return ocifetchinto($this->stmt_id, $row, OCI_ASSOC + OCI_RETURN_NULLS); } - } + } // -------------------------------------------------------------------- @@ -184,25 +184,25 @@ class CI_DB_oci8_result extends CI_DB_result { return FALSE; } - // -------------------------------------------------------------------- - - /** - * Result - object - * - * Returns the result set as an object - * - * @access private - * @return object - */ - function _fetch_object() - { - // the PHP 4 version of the oracle functions do not - // have a fetch method so we call the array version - // and build an object from that - - $row = array(); - $res = $this->_fetch_assoc($row); - if ($res != FALSE) + // -------------------------------------------------------------------- + + /** + * Result - object + * + * Returns the result set as an object + * + * @access private + * @return object + */ + function _fetch_object() + { + // the PHP 4 version of the oracle functions do not + // have a fetch method so we call the array version + // and build an object from that + + $row = array(); + $res = $this->_fetch_assoc($row); + if ($res != FALSE) { $obj = new stdClass(); foreach ($row as $key => $value) @@ -212,41 +212,41 @@ class CI_DB_oci8_result extends CI_DB_result { $res = $obj; } - return $res; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "array" version. - * - * @access public - * @return array - */ - function result_array() - { - if (count($this->result_array) > 0) - { - return $this->result_array; - } - - // oracle's fetch functions do not - // return arrays, the information - // is returned in reference parameters - // - $row = NULL; - while ($this->_fetch_assoc($row)) - { - $this->result_array[] = $row; - } - - if (count($this->result_array) == 0) - { - return FALSE; - } - - return $this->result_array; - } + return $res; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @access public + * @return array + */ + function result_array() + { + if (count($this->result_array) > 0) + { + return $this->result_array; + } + + // oracle's fetch functions do not + // return arrays, the information + // is returned in reference parameters + // + $row = NULL; + while ($this->_fetch_assoc($row)) + { + $this->result_array[] = $row; + } + + if (count($this->result_array) == 0) + { + return FALSE; + } + + return $this->result_array; + } } diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index f4e912183..1d83af1fe 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 17a6dfbd0..09ca07ee4 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -21,7 +21,7 @@ * Note: _DB is an extender class that the app controller * creates dynamically based on whether the active record * class is being used or not. - * + * * @package CodeIgniter * @subpackage Drivers * @category Database @@ -107,18 +107,18 @@ class CI_DB_odbc_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) - { + function _prep_query($sql) + { return $sql; - } + } // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -134,8 +134,8 @@ class CI_DB_odbc_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; return odbc_autocommit($this->conn_id, FALSE); @@ -145,9 +145,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -171,9 +171,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index ea834f9b4..47fb103b3 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -116,8 +116,8 @@ class CI_DB_odbc_result extends CI_DB_result { { if (is_resource($this->result_id)) { - odbc_free_result($this->result_id); - $this->result_id = FALSE; + odbc_free_result($this->result_id); + $this->result_id = FALSE; } } diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index dc62df9f0..8af463b13 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -34,7 +34,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { */ function _create_database() { - // ODBC has no "create database" command since it's + // ODBC has no "create database" command since it's // designed to connect to an existing database if ($this->db->db_debug) { @@ -54,7 +54,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { */ function _drop_database($name) { - // ODBC has no "drop database" command since it's + // ODBC has no "drop database" command since it's // designed to connect to an existing database if ($this->db->db_debug) { diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index f74e652d5..81aaafe14 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -111,18 +111,18 @@ class CI_DB_postgre_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) - { + function _prep_query($sql) + { return $sql; - } + } // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -138,8 +138,8 @@ class CI_DB_postgre_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; return @pg_exec($this->conn_id, "begin"); @@ -149,9 +149,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -173,9 +173,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { @@ -298,7 +298,7 @@ class CI_DB_postgre_driver extends CI_DB { * @return string */ function _list_tables() - { + { return "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; } diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index e792544ae..76bd60187 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -116,8 +116,8 @@ class CI_DB_postgre_result extends CI_DB_result { { if (is_resource($this->result_id)) { - pg_free_result($this->result_id); - $this->result_id = FALSE; + pg_free_result($this->result_id); + $this->result_id = FALSE; } } diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index b08b879d7..478e74276 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -90,7 +90,7 @@ class CI_DB_postgre_utility extends CI_DB_utility { */ function _optimize_table($table) { - return FALSE; + return FALSE; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index fd9fd2c50..ce3c57935 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ @@ -44,10 +44,10 @@ class CI_DB_sqlite_driver extends CI_DB { { log_message('error', $error); - if ($this->db_debug) - { + if ($this->db_debug) + { $this->display_error($error, '', TRUE); - } + } } return $conn_id; @@ -67,10 +67,10 @@ class CI_DB_sqlite_driver extends CI_DB { { log_message('error', $error); - if ($this->db_debug) - { + if ($this->db_debug) + { $this->display_error($error, '', TRUE); - } + } } return $conn_id; @@ -128,18 +128,18 @@ class CI_DB_sqlite_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) - { + function _prep_query($sql) + { return $sql; - } + } // -------------------------------------------------------------------- /** * Begin Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_begin($test_mode = FALSE) { @@ -155,8 +155,8 @@ class CI_DB_sqlite_driver extends CI_DB { } // Reset the transaction failure flag. - // If the $test_mode flag is set to TRUE transactions will be rolled back - // even if the queries produce a successful result. + // If the $test_mode flag is set to TRUE transactions will be rolled back + // even if the queries produce a successful result. $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; $this->simple_query('BEGIN TRANSACTION'); @@ -167,9 +167,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Commit Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_commit() { @@ -192,9 +192,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Rollback Transaction - * + * * @access public - * @return bool + * @return bool */ function trans_rollback() { diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 55364bb24..00045d06c 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -7,19 +7,19 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** * SQLite Result Class * * This class extends the parent result class: CI_DB_result - * + * * @category Database * @author Rick Ellis * @link http://www.codeigniter.com/user_guide/database/ diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index ecce5be40..91649c78d 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -7,12 +7,12 @@ * @package CodeIgniter * @author Rick Ellis * @copyright Copyright (c) 2006, pMachine, Inc. - * @license http://www.codeignitor.com/user_guide/license.html + * @license http://www.codeignitor.com/user_guide/license.html * @link http://www.codeigniter.com * @since Version 1.0 * @filesource */ - + // ------------------------------------------------------------------------ /** @@ -68,7 +68,7 @@ class CI_DB_sqlite_utility extends CI_DB_utility { * * I don't believe you can do a database listing with SQLite * since each database is its own file. I suppose we could - * try reading a directory looking for SQLite files, but + * try reading a directory looking for SQLite files, but * that doesn't seem like a terribly good idea * * @access private |