From 4e44b344d79b52c7b79489b7e3d137d5ed66ab21 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Sat, 18 Feb 2012 22:47:36 +0700 Subject: Fixed meta table method(s) for PDO --- system/database/drivers/pdo/pdo_driver.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index de2b0abeb..9e8e1f66a 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -591,6 +591,11 @@ class CI_DB_pdo_driver extends CI_DB { // Analog function to show all tables in postgre $sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"; } + 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_%'"; + } else { $sql = "SHOW TABLES FROM `".$this->database."`"; @@ -633,6 +638,22 @@ class CI_DB_pdo_driver extends CI_DB { */ function _field_data($table) { + if ($this->pdodriver == 'mysql' or $this->pdodriver == 'pgsql') + { + // Analog function for mysql and postgre + return 'SELECT * FROM '.$this->_from_tables($table).' LIMIT 1'; + } + elseif ($this->pdodriver == 'oci') + { + // Analog function for oci + return 'SELECT * FROM '.$this->_from_tables($table).' WHERE ROWNUM <= 1'; + } + elseif ($this->pdodriver == 'sqlite') + { + // Analog function for sqlite + return 'PRAGMA table_info('.$this->_from_tables($table).')'; + } + return 'SELECT TOP 1 FROM '.$this->_from_tables($table); } -- cgit v1.2.3-24-g4f1b From 07c1ac830b4e98aa40f48baef3dd05fb68c0a836 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:03:37 +0000 Subject: Bumped CodeIgniter's PHP requirement to 5.2.4. Yes I know PHP 5.4 just came out, and yes I know PHP 5.3 has lovely features, but there are plenty of corporate systems running on CodeIgniter and PHP 5.3 still is not widely supported enough. CodeIgniter is great for distributed applications, and this is the highest we can reasonably go without breaking support. PHP 5.3 will most likely happen in another year or so. Fingers crossed on that one anyway... --- system/database/drivers/pdo/pdo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 8fdfd58fb..c86d9df60 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * -- cgit v1.2.3-24-g4f1b From 8c332e7f907e6af498f18fa1bf28e0a0c6e11448 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:09:13 -0400 Subject: PDO driver access modifiers --- system/database/drivers/pdo/pdo_driver.php | 124 ++++++++++++----------------- 1 file changed, 50 insertions(+), 74 deletions(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 658a3d5a0..727f097f8 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -42,28 +42,31 @@ */ class CI_DB_pdo_driver extends CI_DB { - var $dbdriver = 'pdo'; + public $dbdriver = 'pdo'; // the character used to excape - not necessary for PDO - var $_escape_char = ''; + protected $_escape_char = ''; // clause and character used for LIKE escape sequences - var $_like_escape_str; - var $_like_escape_chr; + protected $_like_escape_str; + protected $_like_escape_chr; /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is - * used for the count_all() and count_all_results() functions. + * used for the count_all() and count_all_results() public functions. */ - var $_count_string = "SELECT COUNT(*) AS "; - var $_random_keyword; + protected $_count_string = "SELECT COUNT(*) AS "; + protected $_random_keyword; // need to track the pdo driver and options - var $pdodriver; - var $options = array(); + protected $pdodriver; + protected $options = array(); - function __construct($params) + /** + * Pre-connection setup + */ + public function __construct($params) { parent::__construct($params); @@ -104,11 +107,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Connection String * - * @access private * @param array * @return void */ - function _connect_string($params) + protected function _connect_string($params) { if (strpos($this->hostname, ':')) { @@ -190,10 +192,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + protected function db_connect() { $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; @@ -205,10 +206,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; $this->options[PDO::ATTR_PERSISTENT] = TRUE; @@ -221,10 +221,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * PDO connection * - * @access private called by the PDO driver class * @return resource */ - function pdo_connect() + protected function pdo_connect() { // Refer : http://php.net/manual/en/ref.pdo-mysql.connection.php if ($this->pdodriver == 'mysql' && is_php('5.3.6')) @@ -258,10 +257,9 @@ class CI_DB_pdo_driver extends CI_DB { * Keep / reestablish the db connection if no queries have been * sent for a length of time exceeding the server's idle timeout * - * @access public * @return void */ - function reconnect() + public function reconnect() { if ($this->db->db_debug) { @@ -276,10 +274,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Select the database * - * @access private called by the base class * @return resource */ - function db_select() + protected function db_select() { // Not needed for PDO return TRUE; @@ -304,11 +301,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return object */ - function _execute($sql) + protected function _execute($sql) { $sql = $this->_prep_query($sql); @@ -333,11 +329,10 @@ class CI_DB_pdo_driver extends CI_DB { * * 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) + protected function _prep_query($sql) { if ($this->pdodriver === 'pgsql') { @@ -347,7 +342,7 @@ class CI_DB_pdo_driver extends CI_DB { elseif ($this->pdodriver === 'sqlite') { // Change the backtick(s) for SQLite - $sql = str_replace('`', '', $sql); + $sql = str_replace('`', '"', $sql); } return $sql; @@ -358,10 +353,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Begin Transaction * - * @access public * @return bool */ - function trans_begin($test_mode = FALSE) + public function trans_begin($test_mode = FALSE) { if ( ! $this->trans_enabled) { @@ -387,10 +381,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -413,10 +406,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -439,12 +431,11 @@ class CI_DB_pdo_driver extends CI_DB { /** * Escape String * - * @access public * @param string * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str, $like = FALSE) + public function escape_str($str, $like = FALSE) { if (is_array($str)) { @@ -483,10 +474,9 @@ class CI_DB_pdo_driver extends CI_DB { /** * Affected Rows * - * @access public * @return integer */ - function affected_rows() + public function affected_rows() { return $this->affect_rows; } @@ -518,11 +508,10 @@ class CI_DB_pdo_driver extends CI_DB { * Generates a platform-specific query string that counts all records in * the specified database * - * @access public * @param string * @return string */ - function count_all($table = '') + public function count_all($table = '') { if ($table == '') { @@ -550,20 +539,19 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @access private * @param boolean * @return string */ - function _list_tables($prefix_limit = FALSE) + protected function _list_tables($prefix_limit = FALSE) { if ($this->pdodriver == 'pgsql') { - // Analog function to show all tables in postgre + // Analog public function to show all tables in postgre $sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"; } elseif ($this->pdodriver == 'sqlite') { - // Analog function to show all tables in sqlite + // Analog public function to show all tables in sqlite $sql = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'"; } else @@ -586,11 +574,10 @@ class CI_DB_pdo_driver extends CI_DB { * * 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 = '') + public function _list_columns($table = '') { return 'SHOW COLUMNS FROM '.$this->_from_tables($table); } @@ -602,25 +589,24 @@ class CI_DB_pdo_driver extends CI_DB { * * 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) + public function _field_data($table) { if ($this->pdodriver == 'mysql' or $this->pdodriver == 'pgsql') { - // Analog function for mysql and postgre + // Analog public function for mysql and postgre return 'SELECT * FROM '.$this->_from_tables($table).' LIMIT 1'; } elseif ($this->pdodriver == 'oci') { - // Analog function for oci + // Analog public function for oci return 'SELECT * FROM '.$this->_from_tables($table).' WHERE ROWNUM <= 1'; } elseif ($this->pdodriver == 'sqlite') { - // Analog function for sqlite + // Analog public function for sqlite return 'PRAGMA table_info('.$this->_from_tables($table).')'; } @@ -661,13 +647,12 @@ class CI_DB_pdo_driver extends CI_DB { /** * Escape the SQL Identifiers * - * This function escapes column and table names + * This public function escapes column and table names * - * @access private * @param string * @return string */ - function _escape_identifiers($item) + protected function _escape_identifiers($item) { if ($this->_escape_char == '') { @@ -704,14 +689,13 @@ class CI_DB_pdo_driver extends CI_DB { /** * From Tables * - * This function implicitly groups FROM tables so there is no confusion + * This public function implicitly groups FROM tables so there is no confusion * about operator precedence in harmony with SQL standards * - * @access public * @param type * @return type */ - function _from_tables($tables) + public function _from_tables($tables) { if ( ! is_array($tables)) { @@ -728,13 +712,12 @@ class CI_DB_pdo_driver extends CI_DB { * * 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) + public function _insert($table, $keys, $values) { return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; } @@ -746,13 +729,12 @@ class CI_DB_pdo_driver extends CI_DB { * * 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_batch($table, $keys, $values) + public function _insert_batch($table, $keys, $values) { return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES '.implode(', ', $values); } @@ -764,7 +746,6 @@ class CI_DB_pdo_driver extends CI_DB { * * 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 @@ -772,7 +753,7 @@ class CI_DB_pdo_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + public function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { @@ -796,13 +777,12 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific batch 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_batch($table, $values, $index, $where = NULL) + public function _update_batch($table, $values, $index, $where = NULL) { $ids = array(); $where = ($where != '' && count($where) >=1) ? implode(" ", $where).' AND ' : ''; @@ -849,13 +829,12 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific truncate string from the supplied data * If the database does not support the truncate() command - * This function maps to "DELETE FROM table" + * This public function maps to "DELETE FROM table" * - * @access public * @param string the table name * @return string */ - function _truncate($table) + public function _truncate($table) { return $this->_delete($table); } @@ -867,13 +846,12 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific delete string from the supplied data * - * @access public * @param string the table name * @param array the where clause * @param string the limit clause * @return string */ - function _delete($table, $where = array(), $like = array(), $limit = FALSE) + public function _delete($table, $where = array(), $like = array(), $limit = FALSE) { $conditions = ''; @@ -902,13 +880,12 @@ class CI_DB_pdo_driver extends CI_DB { * * 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) + public function _limit($sql, $limit, $offset) { if ($this->pdodriver == 'cubrid' OR $this->pdodriver == 'sqlite') { @@ -930,11 +907,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { $this->conn_id = null; } @@ -942,4 +918,4 @@ class CI_DB_pdo_driver extends CI_DB { } /* End of file pdo_driver.php */ -/* Location: ./system/database/drivers/pdo/pdo_driver.php */ +/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 667c9feadee8ef5ea8c1859e7c79c2d116469051 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:06:34 -0400 Subject: Revert "PDO driver access modifiers" This reverts commit 8c332e7f907e6af498f18fa1bf28e0a0c6e11448. --- system/database/drivers/pdo/pdo_driver.php | 124 +++++++++++++++++------------ 1 file changed, 74 insertions(+), 50 deletions(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 727f097f8..658a3d5a0 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -42,31 +42,28 @@ */ class CI_DB_pdo_driver extends CI_DB { - public $dbdriver = 'pdo'; + var $dbdriver = 'pdo'; // the character used to excape - not necessary for PDO - protected $_escape_char = ''; + var $_escape_char = ''; // clause and character used for LIKE escape sequences - protected $_like_escape_str; - protected $_like_escape_chr; + var $_like_escape_str; + var $_like_escape_chr; /** * The syntax to count rows is slightly different across different * database engines, so this string appears in each driver and is - * used for the count_all() and count_all_results() public functions. + * used for the count_all() and count_all_results() functions. */ - protected $_count_string = "SELECT COUNT(*) AS "; - protected $_random_keyword; + var $_count_string = "SELECT COUNT(*) AS "; + var $_random_keyword; // need to track the pdo driver and options - protected $pdodriver; - protected $options = array(); + var $pdodriver; + var $options = array(); - /** - * Pre-connection setup - */ - public function __construct($params) + function __construct($params) { parent::__construct($params); @@ -107,10 +104,11 @@ class CI_DB_pdo_driver extends CI_DB { /** * Connection String * + * @access private * @param array * @return void */ - protected function _connect_string($params) + function _connect_string($params) { if (strpos($this->hostname, ':')) { @@ -192,9 +190,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect() + function db_connect() { $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; @@ -206,9 +205,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT; $this->options[PDO::ATTR_PERSISTENT] = TRUE; @@ -221,9 +221,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * PDO connection * + * @access private called by the PDO driver class * @return resource */ - protected function pdo_connect() + function pdo_connect() { // Refer : http://php.net/manual/en/ref.pdo-mysql.connection.php if ($this->pdodriver == 'mysql' && is_php('5.3.6')) @@ -257,9 +258,10 @@ class CI_DB_pdo_driver extends CI_DB { * Keep / reestablish the db connection if no queries have been * sent for a length of time exceeding the server's idle timeout * + * @access public * @return void */ - public function reconnect() + function reconnect() { if ($this->db->db_debug) { @@ -274,9 +276,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Select the database * + * @access private called by the base class * @return resource */ - protected function db_select() + function db_select() { // Not needed for PDO return TRUE; @@ -301,10 +304,11 @@ class CI_DB_pdo_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return object */ - protected function _execute($sql) + function _execute($sql) { $sql = $this->_prep_query($sql); @@ -329,10 +333,11 @@ class CI_DB_pdo_driver extends CI_DB { * * If needed, each database adapter can prep the query string * + * @access private called by execute() * @param string an SQL query * @return string */ - protected function _prep_query($sql) + function _prep_query($sql) { if ($this->pdodriver === 'pgsql') { @@ -342,7 +347,7 @@ class CI_DB_pdo_driver extends CI_DB { elseif ($this->pdodriver === 'sqlite') { // Change the backtick(s) for SQLite - $sql = str_replace('`', '"', $sql); + $sql = str_replace('`', '', $sql); } return $sql; @@ -353,9 +358,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Begin Transaction * + * @access public * @return bool */ - public function trans_begin($test_mode = FALSE) + function trans_begin($test_mode = FALSE) { if ( ! $this->trans_enabled) { @@ -381,9 +387,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Commit Transaction * + * @access public * @return bool */ - public function trans_commit() + function trans_commit() { if ( ! $this->trans_enabled) { @@ -406,9 +413,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Rollback Transaction * + * @access public * @return bool */ - public function trans_rollback() + function trans_rollback() { if ( ! $this->trans_enabled) { @@ -431,11 +439,12 @@ class CI_DB_pdo_driver extends CI_DB { /** * Escape String * + * @access public * @param string * @param bool whether or not the string will be used in a LIKE condition * @return string */ - public function escape_str($str, $like = FALSE) + function escape_str($str, $like = FALSE) { if (is_array($str)) { @@ -474,9 +483,10 @@ class CI_DB_pdo_driver extends CI_DB { /** * Affected Rows * + * @access public * @return integer */ - public function affected_rows() + function affected_rows() { return $this->affect_rows; } @@ -508,10 +518,11 @@ class CI_DB_pdo_driver extends CI_DB { * Generates a platform-specific query string that counts all records in * the specified database * + * @access public * @param string * @return string */ - public function count_all($table = '') + function count_all($table = '') { if ($table == '') { @@ -539,19 +550,20 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * + * @access private * @param boolean * @return string */ - protected function _list_tables($prefix_limit = FALSE) + function _list_tables($prefix_limit = FALSE) { if ($this->pdodriver == 'pgsql') { - // Analog public function to show all tables in postgre + // Analog function to show all tables in postgre $sql = "SELECT * FROM information_schema.tables WHERE table_schema = 'public'"; } elseif ($this->pdodriver == 'sqlite') { - // Analog public function to show all tables in sqlite + // Analog function to show all tables in sqlite $sql = "SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'"; } else @@ -574,10 +586,11 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * + * @access public * @param string the table name * @return string */ - public function _list_columns($table = '') + function _list_columns($table = '') { return 'SHOW COLUMNS FROM '.$this->_from_tables($table); } @@ -589,24 +602,25 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific query so that the column data can be retrieved * + * @access public * @param string the table name * @return object */ - public function _field_data($table) + function _field_data($table) { if ($this->pdodriver == 'mysql' or $this->pdodriver == 'pgsql') { - // Analog public function for mysql and postgre + // Analog function for mysql and postgre return 'SELECT * FROM '.$this->_from_tables($table).' LIMIT 1'; } elseif ($this->pdodriver == 'oci') { - // Analog public function for oci + // Analog function for oci return 'SELECT * FROM '.$this->_from_tables($table).' WHERE ROWNUM <= 1'; } elseif ($this->pdodriver == 'sqlite') { - // Analog public function for sqlite + // Analog function for sqlite return 'PRAGMA table_info('.$this->_from_tables($table).')'; } @@ -647,12 +661,13 @@ class CI_DB_pdo_driver extends CI_DB { /** * Escape the SQL Identifiers * - * This public function escapes column and table names + * This function escapes column and table names * + * @access private * @param string * @return string */ - protected function _escape_identifiers($item) + function _escape_identifiers($item) { if ($this->_escape_char == '') { @@ -689,13 +704,14 @@ class CI_DB_pdo_driver extends CI_DB { /** * From Tables * - * This public function implicitly groups FROM tables so there is no confusion + * This function implicitly groups FROM tables so there is no confusion * about operator precedence in harmony with SQL standards * + * @access public * @param type * @return type */ - public function _from_tables($tables) + function _from_tables($tables) { if ( ! is_array($tables)) { @@ -712,12 +728,13 @@ class CI_DB_pdo_driver extends CI_DB { * * 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 */ - public function _insert($table, $keys, $values) + function _insert($table, $keys, $values) { return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES ('.implode(', ', $values).')'; } @@ -729,12 +746,13 @@ class CI_DB_pdo_driver extends CI_DB { * * 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 */ - public function _insert_batch($table, $keys, $values) + function _insert_batch($table, $keys, $values) { return 'INSERT INTO '.$this->_from_tables($table).' ('.implode(', ', $keys).') VALUES '.implode(', ', $values); } @@ -746,6 +764,7 @@ class CI_DB_pdo_driver extends CI_DB { * * 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 @@ -753,7 +772,7 @@ class CI_DB_pdo_driver extends CI_DB { * @param array the limit clause * @return string */ - public function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { @@ -777,12 +796,13 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific batch 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 */ - public function _update_batch($table, $values, $index, $where = NULL) + function _update_batch($table, $values, $index, $where = NULL) { $ids = array(); $where = ($where != '' && count($where) >=1) ? implode(" ", $where).' AND ' : ''; @@ -829,12 +849,13 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific truncate string from the supplied data * If the database does not support the truncate() command - * This public function maps to "DELETE FROM table" + * This function maps to "DELETE FROM table" * + * @access public * @param string the table name * @return string */ - public function _truncate($table) + function _truncate($table) { return $this->_delete($table); } @@ -846,12 +867,13 @@ class CI_DB_pdo_driver extends CI_DB { * * Generates a platform-specific delete string from the supplied data * + * @access public * @param string the table name * @param array the where clause * @param string the limit clause * @return string */ - public function _delete($table, $where = array(), $like = array(), $limit = FALSE) + function _delete($table, $where = array(), $like = array(), $limit = FALSE) { $conditions = ''; @@ -880,12 +902,13 @@ class CI_DB_pdo_driver extends CI_DB { * * 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 */ - public function _limit($sql, $limit, $offset) + function _limit($sql, $limit, $offset) { if ($this->pdodriver == 'cubrid' OR $this->pdodriver == 'sqlite') { @@ -907,10 +930,11 @@ class CI_DB_pdo_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { $this->conn_id = null; } @@ -918,4 +942,4 @@ class CI_DB_pdo_driver extends CI_DB { } /* End of file pdo_driver.php */ -/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/pdo/pdo_driver.php */ -- cgit v1.2.3-24-g4f1b From 215890b015d219f0d31e8ad678b0b655e6923f3b Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 20 Mar 2012 09:38:16 -0400 Subject: Remove extraneous newlines --- system/database/drivers/pdo/pdo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/pdo/pdo_driver.php') diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 658a3d5a0..9b44e7c64 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -942,4 +942,4 @@ class CI_DB_pdo_driver extends CI_DB { } /* End of file pdo_driver.php */ -/* Location: ./system/database/drivers/pdo/pdo_driver.php */ +/* Location: ./system/database/drivers/pdo/pdo_driver.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b