From e70e92bab1de57a0749a31f2889b55cafb46d58e Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 25 Apr 2011 10:50:53 -0500 Subject: Fixing up a tabs vs spaces inconsistency in DB_Result --- system/database/DB_result.php | 83 +++++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 39 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 06eec5124..e83228386 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -32,7 +32,7 @@ class CI_DB_result { var $result_id = NULL; var $result_array = array(); var $result_object = array(); - var $custom_result_object = array(); + var $custom_result_object = array(); var $current_row = 0; var $num_rows = 0; var $row_data = NULL; @@ -47,47 +47,52 @@ class CI_DB_result { */ function result($type = 'object') { - if ($type == 'array') return $this->result_array(); - else if ($type == 'object') return $this->result_object(); - else return $this->custom_result_object($type); + if ($type == 'array') return $this->result_array(); + else if ($type == 'object') return $this->result_object(); + else return $this->custom_result_object($type); } // -------------------------------------------------------------------- - /** - * Custom query result. - * - * @param class_name A string that represents the type of object you want back - * @return array of objects - */ - function custom_result_object($class_name) - { - if (array_key_exists($class_name, $this->custom_result_object)) - { - return $this->custom_result_object[$class_name]; - } - - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - // add the data to the object - $this->_data_seek(0); - $result_object = array(); + /** + * Custom query result. + * + * @param class_name A string that represents the type of object you want back + * @return array of objects + */ + function custom_result_object($class_name) + { + if (array_key_exists($class_name, $this->custom_result_object)) + { + return $this->custom_result_object[$class_name]; + } + + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + // add the data to the object + $this->_data_seek(0); + $result_object = array(); + while ($row = $this->_fetch_object()) - { - $object = new $class_name(); - foreach ($row as $key => $value) - { - $object->$key = $value; - } + { + $object = new $class_name(); + + foreach ($row as $key => $value) + { + $object->$key = $value; + } + $result_object[] = $object; } - // return the array - return $this->custom_result_object[$class_name] = $result_object; - } + // return the array + return $this->custom_result_object[$class_name] = $result_object; + } + + // -------------------------------------------------------------------- /** * Query result. "object" version. @@ -180,9 +185,9 @@ class CI_DB_result { $n = 0; } - if ($type == 'object') return $this->row_object($n); - else if ($type == 'array') return $this->row_array($n); - else return $this->custom_row_object($n, $type); + if ($type == 'object') return $this->row_object($n); + else if ($type == 'array') return $this->row_array($n); + else return $this->custom_row_object($n, $type); } // -------------------------------------------------------------------- @@ -219,7 +224,7 @@ class CI_DB_result { // -------------------------------------------------------------------- - /** + /** * Returns a single result row - custom object version * * @access public @@ -242,7 +247,7 @@ class CI_DB_result { return $result[$this->current_row]; } - /** + /** * Returns a single result row - object version * * @access public -- cgit v1.2.3-24-g4f1b From 827f3de2733e85ede6311feb2e4bf73ecf209eb3 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Fri, 6 May 2011 11:29:57 -0500 Subject: Fixed a regression where a PHP error could occur when using some methods. --- system/database/DB_active_rec.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/database') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 508f6bedf..83d481699 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -204,6 +204,7 @@ class CI_DB_active_record extends CI_DB_driver { $sql = $type.'('.$this->_protect_identifiers(trim($select)).') AS '.$alias; $this->ar_select[] = $sql; + $this->ar_no_escape[] = NULL; if ($this->ar_caching === TRUE) { -- cgit v1.2.3-24-g4f1b 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 +++++++++++++++ system/database/drivers/pdo/pdo_result.php | 43 ++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-) (limited to 'system/database') 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); } diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index c333abc40..213b5d670 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -160,9 +160,48 @@ class CI_DB_pdo_result extends CI_DB_result { try { - for($i = 0; $i < $this->num_fields(); $i++) + if (strpos($this->result_id->queryString, 'PRAGMA') !== FALSE) { - $data[] = $this->result_id->getColumnMeta($i); + foreach($this->result_array() as $field) + { + preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field['type'], $matches); + + $F = new stdClass(); + $F->name = $field['name']; + $F->type = ( ! empty($matches[1])) ? $matches[1] : NULL; + $F->default = NULL; + $F->max_length = ( ! empty($matches[2])) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL; + $F->primary_key = (int) $field['pk']; + $F->pdo_type = NULL; + + $data[] = $F; + } + } + else + { + for($i = 0, $max = $this->num_fields(); $i < $max; $i++) + { + $field = $this->result_id->getColumnMeta($i); + + $F = new stdClass(); + $F->name = $field['name']; + $F->type = $field['native_type']; + $F->default = NULL; + $F->pdo_type = $field['pdo_type']; + + if ($field['precision'] < 0) + { + $F->max_length = NULL; + $F->primary_key = 0; + } + else + { + $F->max_length = ($field['len'] > 255) ? NULL : (string) $field['len']; + $F->primary_key = (int) (array_key_exists('flags', $field) && in_array('primary_key', $field['flags'])); + } + + $data[] = $F; + } } return $data; -- 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/DB.php | 2 +- system/database/DB_active_rec.php | 2 +- system/database/DB_cache.php | 2 +- system/database/DB_driver.php | 2 +- system/database/DB_forge.php | 2 +- system/database/DB_result.php | 2 +- system/database/DB_utility.php | 2 +- system/database/drivers/cubrid/cubrid_driver.php | 2 +- system/database/drivers/cubrid/cubrid_forge.php | 2 +- system/database/drivers/cubrid/cubrid_result.php | 2 +- system/database/drivers/cubrid/cubrid_utility.php | 2 +- system/database/drivers/interbase/interbase_driver.php | 2 +- system/database/drivers/interbase/interbase_forge.php | 2 +- system/database/drivers/interbase/interbase_result.php | 2 +- system/database/drivers/interbase/interbase_utility.php | 2 +- system/database/drivers/mssql/mssql_driver.php | 2 +- system/database/drivers/mssql/mssql_forge.php | 2 +- system/database/drivers/mssql/mssql_result.php | 2 +- system/database/drivers/mssql/mssql_utility.php | 2 +- system/database/drivers/mysql/mysql_driver.php | 2 +- system/database/drivers/mysql/mysql_forge.php | 2 +- system/database/drivers/mysql/mysql_result.php | 2 +- system/database/drivers/mysql/mysql_utility.php | 2 +- system/database/drivers/mysqli/mysqli_driver.php | 2 +- system/database/drivers/mysqli/mysqli_forge.php | 2 +- system/database/drivers/mysqli/mysqli_result.php | 2 +- system/database/drivers/mysqli/mysqli_utility.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 2 +- system/database/drivers/oci8/oci8_forge.php | 2 +- system/database/drivers/oci8/oci8_result.php | 2 +- system/database/drivers/oci8/oci8_utility.php | 2 +- system/database/drivers/odbc/odbc_driver.php | 2 +- system/database/drivers/odbc/odbc_forge.php | 2 +- system/database/drivers/odbc/odbc_result.php | 2 +- system/database/drivers/odbc/odbc_utility.php | 2 +- system/database/drivers/pdo/pdo_driver.php | 2 +- system/database/drivers/pdo/pdo_forge.php | 2 +- system/database/drivers/pdo/pdo_result.php | 2 +- system/database/drivers/pdo/pdo_utility.php | 2 +- system/database/drivers/postgre/postgre_driver.php | 2 +- system/database/drivers/postgre/postgre_forge.php | 2 +- system/database/drivers/postgre/postgre_result.php | 2 +- system/database/drivers/postgre/postgre_utility.php | 2 +- system/database/drivers/sqlite/sqlite_driver.php | 2 +- system/database/drivers/sqlite/sqlite_forge.php | 2 +- system/database/drivers/sqlite/sqlite_result.php | 2 +- system/database/drivers/sqlite/sqlite_utility.php | 2 +- system/database/drivers/sqlsrv/sqlsrv_driver.php | 2 +- system/database/drivers/sqlsrv/sqlsrv_forge.php | 2 +- system/database/drivers/sqlsrv/sqlsrv_result.php | 2 +- system/database/drivers/sqlsrv/sqlsrv_utility.php | 2 +- 51 files changed, 51 insertions(+), 51 deletions(-) (limited to 'system/database') diff --git a/system/database/DB.php b/system/database/DB.php index d06ffb40e..116116bf4 100755 --- a/system/database/DB.php +++ b/system/database/DB.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 * diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index f648e5591..c7df81963 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.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 * diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index 79651fcb0..fb0cfa89a 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.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 * diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index a61450d4c..59018cc91 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_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 * diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 336e9497d..fe2a67728 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.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 * diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 61aa56121..c3cdd24ff 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.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 * diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 4c881d8a1..c94f93e5e 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.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 * diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index afdaef351..1c65cbdd3 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_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 * diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 85e740057..293613e69 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.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 * diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php index 4c0fede10..a7eeb8a39 100644 --- a/system/database/drivers/cubrid/cubrid_result.php +++ b/system/database/drivers/cubrid/cubrid_result.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 * diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index 750c0d8dd..a13c0a5e4 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.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 * diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php index f4bd9e271..3e2ca4955 100644 --- a/system/database/drivers/interbase/interbase_driver.php +++ b/system/database/drivers/interbase/interbase_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 * diff --git a/system/database/drivers/interbase/interbase_forge.php b/system/database/drivers/interbase/interbase_forge.php index 023d278ce..f46043569 100644 --- a/system/database/drivers/interbase/interbase_forge.php +++ b/system/database/drivers/interbase/interbase_forge.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 * diff --git a/system/database/drivers/interbase/interbase_result.php b/system/database/drivers/interbase/interbase_result.php index 4b15eee20..5bf0c902d 100644 --- a/system/database/drivers/interbase/interbase_result.php +++ b/system/database/drivers/interbase/interbase_result.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 * diff --git a/system/database/drivers/interbase/interbase_utility.php b/system/database/drivers/interbase/interbase_utility.php index 76a0497c1..a88055ee0 100644 --- a/system/database/drivers/interbase/interbase_utility.php +++ b/system/database/drivers/interbase/interbase_utility.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 * diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 147c63483..534e8d9a8 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_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 * diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index dd8aa3448..50db595bf 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.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 * diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index bba2e6243..b205ce2d1 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.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 * diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index be6ed5bb0..28f34b999 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.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 * diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 7fd08a6ed..76fb057ea 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_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 * diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 0f251b086..3cd96a8a2 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.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 * diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 5a65d9c72..cec28dc2d 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.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 * diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 952f887fe..d716b004a 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.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 * diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 25b6ceca1..e0b2065a1 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_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 * diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 7de036127..deb8c0d9e 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.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 * diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index 8b909cc56..f135f4d46 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.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 * diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index 3fdc5c723..650ddfd18 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.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 * diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 35cafff6c..048149f30 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_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 * diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 0aa119907..e9c30e140 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.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 * diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 383b9f1a0..6f1b8b4c1 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.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 * diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index d60f98bc4..62dfb2f3c 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.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 * diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index a6e08cf2f..84e9a9801 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_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 * diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index e0ec687c8..d5c42518a 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.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 * diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index de2c58cb9..d19fa247e 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.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 * diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index bae3fe853..c146c1785 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.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 * 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 * diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php index 478b2dbfb..7c238473e 100644 --- a/system/database/drivers/pdo/pdo_forge.php +++ b/system/database/drivers/pdo/pdo_forge.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 * diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index c333abc40..309f1947d 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.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 * diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php index 971ec8803..c278c5172 100644 --- a/system/database/drivers/pdo/pdo_utility.php +++ b/system/database/drivers/pdo/pdo_utility.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 * diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 5b248e9bc..b8abbd742 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_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 * diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 756fd347a..216b4967c 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.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 * diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index 9161bf955..12d7547c5 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.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 * diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index c426b363b..e31a6db8f 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.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 * diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 3eaec949c..efb372707 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_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 * diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index fd0f3eb98..3e9e5d4ab 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.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 * diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 74c0dc549..ac2235cbc 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.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 * diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 8fefcd9e2..9f9ddca44 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.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 * diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 5c90cb4f2..5e920cbe8 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_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 * diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index 2a7766927..e00fc7d74 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.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 * diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 1ee19c2d1..52d338a30 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.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 * diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index e96df96f9..44e6fafeb 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.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 ca6404749a8dd3ee5dd68d64832374dce05fe6a3 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 9 Mar 2012 17:19:35 +0000 Subject: Allow arrays to be used for enum/set constraint. This was working in MySQL but not MySQLi. --- system/database/drivers/mysqli/mysqli_forge.php | 29 ++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 4ab7a639d..9cb1a0c70 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -86,9 +86,32 @@ class CI_DB_mysqli_forge extends CI_DB_forge { $sql .= "\n\t".$this->db->protect_identifiers($field) .( ! empty($attributes['NAME']) ? ' '.$this->db->protect_identifiers($attributes['NAME']).' ' : '') - .( ! empty($attributes['TYPE']) ? ' '.$attributes['TYPE'] : '') - .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '') - .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '') + ; + + if ( ! empty($attributes['TYPE'])) + { + $sql .= ' '.$attributes['TYPE']; + + if ( ! empty($attributes['CONSTRAINT'])) + { + switch (strtolower($attributes['TYPE'])) + { + case 'decimal': + case 'float': + case 'numeric': + $sql .= '('.implode(',', $attributes['CONSTRAINT']).')'; + break; + case 'enum': + case 'set': + $sql .= '("'.implode('","', $attributes['CONSTRAINT']).'")'; + break; + default: + $sql .= '('.$attributes['CONSTRAINT'].')'; + } + } + } + + $sql .= (( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '') .(isset($attributes['DEFAULT']) ? " DEFAULT '".$attributes['DEFAULT']."'" : '') .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL') .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : ''); -- cgit v1.2.3-24-g4f1b From 10aa8e660c6f439958b79fce5d85ce7e8eecf028 Mon Sep 17 00:00:00 2001 From: Joel Kallman Date: Fri, 9 Mar 2012 14:54:53 -0500 Subject: Adding Support to Properly Escape Objects that have __toString() magic method so that the object can be passed directly as a parameter in a condition without having to manually convert to a string Signed-off-by: Joel Kallman --- system/database/DB_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 9d92f2f87..a72bf3101 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -727,7 +727,7 @@ class CI_DB_driver { */ function escape($str) { - if (is_string($str)) + if (is_string($str) OR method_exists($str, '__toString')) { $str = "'".$this->escape_str($str)."'"; } -- cgit v1.2.3-24-g4f1b From f6a4114e57a305d0b2fd24a23f9e643290e71eec Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 15:34:10 +0200 Subject: Remove usage of SET NAMES and the deprecated mysql_escape_string() from MySQL/MySQLi drivers --- system/database/drivers/mysql/mysql_driver.php | 17 ++--------------- system/database/drivers/mysqli/mysqli_driver.php | 17 ++--------------- 2 files changed, 4 insertions(+), 30 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 7f4a4f2ca..0ca8413da 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -149,9 +149,7 @@ class CI_DB_mysql_driver extends CI_DB { */ protected function _db_set_charset($charset, $collation) { - return function_exists('mysql_set_charset') - ? @mysql_set_charset($charset, $this->conn_id) - : @mysql_query("SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'", $this->conn_id); + return @mysql_set_charset($charset, $this->conn_id) } // -------------------------------------------------------------------- @@ -289,18 +287,7 @@ class CI_DB_mysql_driver extends CI_DB { return $str; } - if (function_exists('mysql_real_escape_string') && is_resource($this->conn_id)) - { - $str = mysql_real_escape_string($str, $this->conn_id); - } - elseif (function_exists('mysql_escape_string')) - { - $str = mysql_escape_string($str); - } - else - { - $str = addslashes($str); - } + $str = is_resource($this->conn_id) ? mysql_real_escape_string($str, $this->conn_id) : addslashes($str); // escape LIKE condition wildcards if ($like === TRUE) diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 846ec0340..a965e619a 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -149,9 +149,7 @@ class CI_DB_mysqli_driver extends CI_DB { */ protected function _db_set_charset($charset, $collation) { - return function_exists('mysqli_set_charset') - ? @mysqli_set_charset($this->conn_id, $charset) - : @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'"); + return @mysqli_set_charset($this->conn_id, $charset) } // -------------------------------------------------------------------- @@ -289,18 +287,7 @@ class CI_DB_mysqli_driver extends CI_DB { return $str; } - if (function_exists('mysqli_real_escape_string') && is_object($this->conn_id)) - { - $str = mysqli_real_escape_string($this->conn_id, $str); - } - elseif (function_exists('mysql_escape_string')) - { - $str = mysql_escape_string($str); - } - else - { - $str = addslashes($str); - } + $str = is_object($this->conn_id) ? mysqli_real_escape_string($this->conn_id, $str) : addslashes($str); // escape LIKE condition wildcards if ($like === TRUE) -- cgit v1.2.3-24-g4f1b From b3442a165a091c552a3331ece94297d5fe316fee Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 15:35:40 +0200 Subject: Add missing semicolons --- system/database/drivers/mysql/mysql_driver.php | 2 +- system/database/drivers/mysqli/mysqli_driver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 0ca8413da..071ce4327 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -149,7 +149,7 @@ class CI_DB_mysql_driver extends CI_DB { */ protected function _db_set_charset($charset, $collation) { - return @mysql_set_charset($charset, $this->conn_id) + return @mysql_set_charset($charset, $this->conn_id); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index a965e619a..e84b8346d 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -149,7 +149,7 @@ class CI_DB_mysqli_driver extends CI_DB { */ protected function _db_set_charset($charset, $collation) { - return @mysqli_set_charset($this->conn_id, $charset) + return @mysqli_set_charset($this->conn_id, $charset); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 95bd1d1a5f5bdccfde53cc27d7d5c20991112643 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 16:22:28 +0200 Subject: Remove collation parameter from db_set_charset() (no longer needed) --- system/database/DB_driver.php | 6 +++--- system/database/drivers/mysql/mysql_driver.php | 3 +-- system/database/drivers/mysqli/mysqli_driver.php | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index a04a65eeb..12cd3917c 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -165,7 +165,7 @@ class CI_DB_driver { } // Now we set the character set and that's all - return $this->db_set_charset($this->char_set, $this->dbcollat); + return $this->db_set_charset($this->char_set); } // -------------------------------------------------------------------- @@ -177,9 +177,9 @@ class CI_DB_driver { * @param string * @return bool */ - public function db_set_charset($charset, $collation = '') + public function db_set_charset($charset) { - if (method_exists($this, '_db_set_charset') && ! $this->_db_set_charset($charset, $collation)) + if (method_exists($this, '_db_set_charset') && ! $this->_db_set_charset($charset)) { log_message('error', 'Unable to set database connection charset: '.$charset); diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 071ce4327..ba646d226 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -144,10 +144,9 @@ class CI_DB_mysql_driver extends CI_DB { * Set client character set * * @param string - * @param string * @return bool */ - protected function _db_set_charset($charset, $collation) + protected function _db_set_charset($charset) { return @mysql_set_charset($charset, $this->conn_id); } diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index e84b8346d..f38b94c13 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -144,10 +144,9 @@ class CI_DB_mysqli_driver extends CI_DB { * Set client character set * * @param string - * @param string * @return bool */ - protected function _db_set_charset($charset, $collation) + protected function _db_set_charset($charset) { return @mysqli_set_charset($this->conn_id, $charset); } -- cgit v1.2.3-24-g4f1b From 865ce1e3a2466259996e52d764650e2144ae10c9 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Sat, 17 Mar 2012 02:19:42 +0700 Subject: Spacing and replace array_key_exists --- system/database/drivers/pdo/pdo_result.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index 213b5d670..6bc923e38 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -162,7 +162,7 @@ class CI_DB_pdo_result extends CI_DB_result { { if (strpos($this->result_id->queryString, 'PRAGMA') !== FALSE) { - foreach($this->result_array() as $field) + foreach ($this->result_array() as $field) { preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field['type'], $matches); @@ -197,7 +197,7 @@ class CI_DB_pdo_result extends CI_DB_result { else { $F->max_length = ($field['len'] > 255) ? NULL : (string) $field['len']; - $F->primary_key = (int) (array_key_exists('flags', $field) && in_array('primary_key', $field['flags'])); + $F->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'])); } $data[] = $F; -- cgit v1.2.3-24-g4f1b From 4a80154b0bb28df04d407d3d3d83e112808b25d4 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Sun, 18 Mar 2012 01:00:36 +0700 Subject: Remove type casting --- system/database/drivers/pdo/pdo_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index 6bc923e38..1c72216b1 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -196,7 +196,7 @@ class CI_DB_pdo_result extends CI_DB_result { } else { - $F->max_length = ($field['len'] > 255) ? NULL : (string) $field['len']; + $F->max_length = ($field['len'] > 255) ? 0 : $field['len']; $F->primary_key = (int) ( ! empty($field['flags']) && in_array('primary_key', $field['flags'])); } -- cgit v1.2.3-24-g4f1b From 7eeda537a1fa8dc3a60bbdb88a7e473cc909f590 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 16:01:55 -0400 Subject: Made database parent classes and methods abstract --- system/database/DB_active_rec.php | 2 +- system/database/DB_driver.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 35164a79c..89369f190 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -38,7 +38,7 @@ * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_active_record extends CI_DB_driver { +abstract class CI_DB_active_record extends CI_DB_driver { protected $return_delete_sql = FALSE; protected $reset_delete_data = FALSE; diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index bcff43392..79b7285bd 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -38,7 +38,7 @@ * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_driver { +abstract class CI_DB_driver { public $dsn; public $username; @@ -1357,9 +1357,7 @@ class CI_DB_driver { * * @return void */ - protected function _reset_select() - { - } + abstract protected function _reset_select(); } -- cgit v1.2.3-24-g4f1b From 833d504a91f7c85fa2985bcff5016a052972bd7a Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 16:12:03 -0400 Subject: Made the rest of the db classes abstract \n except for the DB_cache class, because I'm not sure if it is directly called --- system/database/DB_forge.php | 2 +- system/database/DB_result.php | 2 +- system/database/DB_utility.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index fe2a67728..192b78fa6 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -34,7 +34,7 @@ * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_forge { +abstract class CI_DB_forge { public $fields = array(); public $keys = array(); diff --git a/system/database/DB_result.php b/system/database/DB_result.php index c3cdd24ff..d0205e0fd 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -36,7 +36,7 @@ * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_result { +abstract class CI_DB_result { public $conn_id = NULL; public $result_id = NULL; diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index c94f93e5e..a7db803e8 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -32,7 +32,7 @@ * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ -class CI_DB_utility extends CI_DB_forge { +abstract class CI_DB_utility extends CI_DB_forge { public $db; public $data_cache = array(); -- cgit v1.2.3-24-g4f1b From d2ff0bc1336e106e4b45abe7ee176bf6b9496b6e Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 16:52:10 -0400 Subject: Removed pointless _prep_sql methods --- system/database/DB_driver.php | 2 +- system/database/drivers/cubrid/cubrid_driver.php | 18 ------------------ .../database/drivers/interbase/interbase_driver.php | 16 ---------------- system/database/drivers/mssql/mssql_driver.php | 17 ----------------- system/database/drivers/oci8/oci8_driver.php | 20 ++------------------ system/database/drivers/odbc/odbc_driver.php | 17 ----------------- system/database/drivers/postgre/postgre_driver.php | 17 ----------------- system/database/drivers/sqlite/sqlite_driver.php | 19 ------------------- system/database/drivers/sqlsrv/sqlsrv_driver.php | 17 ----------------- 9 files changed, 3 insertions(+), 140 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 79b7285bd..42b1b35aa 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1362,4 +1362,4 @@ abstract class CI_DB_driver { } /* End of file DB_driver.php */ -/* Location: ./system/database/DB_driver.php */ +/* Location: ./system/database/DB_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index 244707395..32bd8a8b2 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -178,29 +178,11 @@ class CI_DB_cubrid_driver extends CI_DB { */ function _execute($sql) { - $sql = $this->_prep_query($sql); return @cubrid_query($sql, $this->conn_id); } // -------------------------------------------------------------------- - /** - * 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) - { - // No need to prepare - return $sql; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php index a9a647202..4af5b57ed 100644 --- a/system/database/drivers/interbase/interbase_driver.php +++ b/system/database/drivers/interbase/interbase_driver.php @@ -148,27 +148,11 @@ class CI_DB_interbase_driver extends CI_DB { */ protected function _execute($sql) { - $sql = $this->_prep_query($sql); return @ibase_query($this->conn_id, $sql); } // -------------------------------------------------------------------- - /** - * Prep the query - * - * If needed, each database adapter can prep the query string - * - * @param string an SQL query - * @return string - */ - protected function _prep_query($sql) - { - return $sql; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index b6b64cc44..a93ac57fe 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -146,28 +146,11 @@ class CI_DB_mssql_driver extends CI_DB { */ function _execute($sql) { - $sql = $this->_prep_query($sql); return @mssql_query($sql, $this->conn_id); } // -------------------------------------------------------------------- - /** - * 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; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 070d58a34..8d7040618 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -180,26 +180,10 @@ class CI_DB_oci8_driver extends CI_DB { { if ( ! is_resource($this->stmt_id)) { - $this->stmt_id = oci_parse($this->conn_id, $this->_prep_query($sql)); + $this->stmt_id = oci_parse($this->conn_id, $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 - */ - private function _prep_query($sql) - { - return $sql; - } - + // -------------------------------------------------------------------- /** diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index acc2838e3..58da07818 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -132,28 +132,11 @@ class CI_DB_odbc_driver extends CI_DB { */ function _execute($sql) { - $sql = $this->_prep_query($sql); return @odbc_exec($this->conn_id, $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; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 5d22af2e6..fad9539ff 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -197,28 +197,11 @@ class CI_DB_postgre_driver extends CI_DB { */ function _execute($sql) { - $sql = $this->_prep_query($sql); return @pg_query($this->conn_id, $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; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 55d9bfdb8..1870e73b7 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -27,8 +27,6 @@ // ------------------------------------------------------------------------ - - /** * SQLite Database Adapter Class * @@ -163,28 +161,11 @@ class CI_DB_sqlite_driver extends CI_DB { */ function _execute($sql) { - $sql = $this->_prep_query($sql); return @sqlite_query($this->conn_id, $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; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 5e920cbe8..ea9f9483b 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -152,7 +152,6 @@ class CI_DB_sqlsrv_driver extends CI_DB { */ function _execute($sql) { - $sql = $this->_prep_query($sql); return sqlsrv_query($this->conn_id, $sql, null, array( 'Scrollable' => SQLSRV_CURSOR_STATIC, 'SendStreamParamsAtExec' => true @@ -161,22 +160,6 @@ class CI_DB_sqlsrv_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * 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; - } - - // -------------------------------------------------------------------- - /** * Begin Transaction * -- cgit v1.2.3-24-g4f1b From 70b21018b4941414c0041900f26c637763e19cfe Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 17:33:05 -0400 Subject: Added access modifiers to CUBRID driver --- system/database/drivers/cubrid/cubrid_driver.php | 87 +++++++++--------------- 1 file changed, 31 insertions(+), 56 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index 32bd8a8b2..cc9f23d9e 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -66,10 +66,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + protected function db_connect() { // If no port is defined by the user, use the default value if ($this->port == '') @@ -106,13 +105,12 @@ class CI_DB_cubrid_driver extends CI_DB { * file by setting the CCI_PCONNECT parameter to ON. In that case, all * connections established between the client application and the * server will become persistent. This is calling the same - * @cubrid_connect function will establish persisten connection + * @cubrid_connect public function will establish persisten connection * considering that the CCI_PCONNECT is ON. * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { return $this->db_connect(); } @@ -125,10 +123,9 @@ class CI_DB_cubrid_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 (cubrid_ping($this->conn_id) === FALSE) { @@ -141,10 +138,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Select the database * - * @access private called by the base class * @return resource */ - function db_select() + public function db_select() { // In CUBRID there is no need to select a database as the database // is chosen at the connection time. @@ -172,11 +168,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { return @cubrid_query($sql, $this->conn_id); } @@ -186,10 +181,9 @@ class CI_DB_cubrid_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) { @@ -220,10 +214,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -251,10 +244,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -282,12 +274,11 @@ class CI_DB_cubrid_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)) { @@ -324,7 +315,7 @@ class CI_DB_cubrid_driver extends CI_DB { * * @return int */ - public function affected_rows() + public public function affected_rows() { return @cubrid_affected_rows(); } @@ -334,10 +325,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Insert ID * - * @access public * @return integer */ - function insert_id() + public function insert_id() { return @cubrid_insert_id($this->conn_id); } @@ -350,11 +340,10 @@ class CI_DB_cubrid_driver extends CI_DB { * Generates a platform-specific query string that counts all records in * the specified table * - * @access public * @param string * @return string */ - function count_all($table = '') + public function count_all($table = '') { if ($table == '') { @@ -379,11 +368,10 @@ class CI_DB_cubrid_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) { $sql = "SHOW TABLES"; @@ -402,11 +390,10 @@ class CI_DB_cubrid_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->protect_identifiers($table, TRUE, NULL, FALSE); } @@ -418,11 +405,10 @@ class CI_DB_cubrid_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) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -437,7 +423,7 @@ class CI_DB_cubrid_driver extends CI_DB { * * @return array */ - public function error() + public public function error() { return array('code' => cubrid_errno($this->conn_id), 'message' => cubrid_error($this->conn_id)); } @@ -445,13 +431,12 @@ class CI_DB_cubrid_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 == '') { @@ -487,14 +472,13 @@ class CI_DB_cubrid_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)) { @@ -511,13 +495,12 @@ class CI_DB_cubrid_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 ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } @@ -530,13 +513,12 @@ class CI_DB_cubrid_driver extends CI_DB { * * Generates a platform-specific replace 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 _replace($table, $keys, $values) + public function _replace($table, $keys, $values) { return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } @@ -548,13 +530,12 @@ class CI_DB_cubrid_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 ".$table." (\"".implode('", "', $keys)."\") VALUES ".implode(', ', $values); } @@ -567,7 +548,6 @@ class CI_DB_cubrid_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 @@ -575,7 +555,7 @@ class CI_DB_cubrid_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) { @@ -603,13 +583,12 @@ class CI_DB_cubrid_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 != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; @@ -656,13 +635,12 @@ class CI_DB_cubrid_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 "TRUNCATE ".$table; } @@ -674,13 +652,12 @@ class CI_DB_cubrid_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 = ''; @@ -708,13 +685,12 @@ class CI_DB_cubrid_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 ($offset == 0) { @@ -733,11 +709,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { @cubrid_close($conn_id); } -- cgit v1.2.3-24-g4f1b From f83f0d5448aadcf76fbdac363d0fe7ea811ca9bf Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 17:38:30 -0400 Subject: Added access modifiers to the rest of the Cubrid classes --- system/database/drivers/cubrid/cubrid_forge.php | 21 +++++++-------------- system/database/drivers/cubrid/cubrid_result.php | 23 ++++++++--------------- system/database/drivers/cubrid/cubrid_utility.php | 8 ++++---- 3 files changed, 19 insertions(+), 33 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 7d606ea36..6bfc7c28f 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -39,11 +39,10 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Create database * - * @access private * @param string the database name * @return bool */ - function _create_database($name) + protected function _create_database($name) { // CUBRID does not allow to create a database in SQL. The GUI tools // have to be used for this purpose. @@ -55,11 +54,10 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { // CUBRID does not allow to drop a database in SQL. The GUI tools // have to be used for this purpose. @@ -71,11 +69,10 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Process Fields * - * @access private * @param mixed the fields * @return string */ - function _process_fields($fields) + protected function _process_fields($fields) { $current_field_count = 0; $sql = ''; @@ -172,7 +169,6 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param mixed the fields * @param mixed primary key(s) @@ -180,7 +176,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -232,10 +228,9 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return string */ - function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); } @@ -248,14 +243,13 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param array fields * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $fields, $after_field = '') + protected function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -282,12 +276,11 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'RENAME TABLE '.$this->db->protect_identifiers($table_name).' AS '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php index a7eeb8a39..c7a7632aa 100644 --- a/system/database/drivers/cubrid/cubrid_result.php +++ b/system/database/drivers/cubrid/cubrid_result.php @@ -41,10 +41,9 @@ class CI_DB_cubrid_result extends CI_DB_result { /** * Number of rows in the result set * - * @access public * @return integer */ - function num_rows() + public function num_rows() { return @cubrid_num_rows($this->result_id); } @@ -54,10 +53,9 @@ class CI_DB_cubrid_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public * @return integer */ - function num_fields() + public function num_fields() { return @cubrid_num_fields($this->result_id); } @@ -69,10 +67,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { return cubrid_column_names($this->result_id); } @@ -84,10 +81,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); @@ -149,7 +145,7 @@ class CI_DB_cubrid_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if(is_resource($this->result_id) || get_resource_type($this->result_id) == "Unknown" && @@ -169,10 +165,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return cubrid_data_seek($this->result_id, $n); } @@ -184,10 +179,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return cubrid_fetch_assoc($this->result_id); } @@ -199,10 +193,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return cubrid_fetch_object($this->result_id); } diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index a13c0a5e4..de28e6335 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -42,7 +42,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @access private * @return array */ - function _list_databases() + protected function _list_databases() { // CUBRID does not allow to see the list of all databases on the // server. It is the way its architecture is designed. Every @@ -71,7 +71,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Optimize%20Database */ - function _optimize_table($table) + protected function _optimize_table($table) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table optimization can be performed using CUBRID Manager @@ -91,7 +91,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency */ - function _repair_table($table) + protected function _repair_table($table) { // Not supported in CUBRID as of version 8.4.0. Database or // table consistency can be checked using CUBRID Manager @@ -107,7 +107,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - function _backup($params = array()) + protected function _backup($params = array()) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table backup can be performed using CUBRID Manager -- cgit v1.2.3-24-g4f1b From ba1ebbefa9c5d225fa28c76dac276e6120263a25 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 17:48:46 -0400 Subject: Added access modifiers for MSSQL driver --- system/database/drivers/mssql/mssql_driver.php | 81 +++++++++---------------- system/database/drivers/mssql/mssql_forge.php | 20 +++--- system/database/drivers/mssql/mssql_result.php | 24 +++----- system/database/drivers/mssql/mssql_utility.php | 12 ++-- 4 files changed, 47 insertions(+), 90 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index a93ac57fe..9448f052c 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -62,10 +62,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + protected function db_connect() { if ($this->port != '') { @@ -80,10 +79,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { if ($this->port != '') { @@ -101,10 +99,9 @@ class CI_DB_mssql_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() { // not implemented in MSSQL } @@ -140,11 +137,10 @@ class CI_DB_mssql_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { return @mssql_query($sql, $this->conn_id); } @@ -154,10 +150,9 @@ class CI_DB_mssql_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) { @@ -184,10 +179,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -209,10 +203,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -234,12 +227,11 @@ class CI_DB_mssql_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)) { @@ -272,10 +264,9 @@ class CI_DB_mssql_driver extends CI_DB { /** * Affected Rows * - * @access public * @return integer */ - function affected_rows() + public function affected_rows() { return @mssql_rows_affected($this->conn_id); } @@ -287,10 +278,9 @@ class CI_DB_mssql_driver extends CI_DB { * * Returns the last id created in the Identity column. * - * @access public * @return integer */ - function insert_id() + public function insert_id() { $ver = self::_parse_major_version($this->version()); $sql = ($ver >= 8 ? "SELECT SCOPE_IDENTITY() AS last_id" : "SELECT @@IDENTITY AS last_id"); @@ -307,11 +297,10 @@ class CI_DB_mssql_driver extends CI_DB { * Grabs the major version number from the * database server version string passed in. * - * @access private * @param string $version * @return int16 major version number */ - function _parse_major_version($version) + protected function _parse_major_version($version) { preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); return $ver_info[1]; // return the major version b/c that's all we're interested in. @@ -324,7 +313,7 @@ class CI_DB_mssql_driver extends CI_DB { * * @return string */ - protected function _version() + protected public function _version() { return 'SELECT @@VERSION AS ver'; } @@ -337,11 +326,10 @@ class CI_DB_mssql_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 == '') { @@ -366,11 +354,10 @@ class CI_DB_mssql_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) { $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; @@ -391,11 +378,10 @@ class CI_DB_mssql_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * - * @access private * @param string the table name * @return string */ - function _list_columns($table = '') + protected function _list_columns($table = '') { return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; } @@ -407,11 +393,10 @@ class CI_DB_mssql_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) { return "SELECT TOP 1 * FROM ".$table; } @@ -438,13 +423,12 @@ class CI_DB_mssql_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 == '') { @@ -480,14 +464,13 @@ class CI_DB_mssql_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)) { @@ -504,13 +487,12 @@ class CI_DB_mssql_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -522,7 +504,6 @@ class CI_DB_mssql_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 @@ -530,7 +511,7 @@ class CI_DB_mssql_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) { @@ -558,13 +539,12 @@ class CI_DB_mssql_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 "TRUNCATE ".$table; } @@ -576,13 +556,12 @@ class CI_DB_mssql_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 = ''; @@ -610,13 +589,12 @@ class CI_DB_mssql_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) { $i = $limit + $offset; @@ -628,18 +606,15 @@ class CI_DB_mssql_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { @mssql_close($conn_id); } } - - /* End of file mssql_driver.php */ -/* Location: ./system/database/drivers/mssql/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 4a8089bb1..500dd9845 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -39,11 +39,10 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Create database * - * @access private * @param string the database name * @return bool */ - function _create_database($name) + protected function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -53,11 +52,10 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -67,10 +65,9 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return bool */ - function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE ".$this->db->_escape_identifiers($table); } @@ -80,7 +77,6 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -88,7 +84,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -190,7 +186,6 @@ class CI_DB_mssql_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -200,7 +195,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -242,12 +237,11 @@ class CI_DB_mssql_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); @@ -256,4 +250,4 @@ class CI_DB_mssql_forge extends CI_DB_forge { } /* End of file mssql_forge.php */ -/* Location: ./system/database/drivers/mssql/mssql_forge.php */ +/* Location: ./system/database/drivers/mssql/mssql_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index b205ce2d1..ff899406c 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -41,10 +41,9 @@ class CI_DB_mssql_result extends CI_DB_result { /** * Number of rows in the result set * - * @access public * @return integer */ - function num_rows() + public function num_rows() { return @mssql_num_rows($this->result_id); } @@ -54,10 +53,9 @@ class CI_DB_mssql_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public * @return integer */ - function num_fields() + public function num_fields() { return @mssql_num_fields($this->result_id); } @@ -69,10 +67,9 @@ class CI_DB_mssql_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { $field_names = array(); while ($field = mssql_fetch_field($this->result_id)) @@ -90,10 +87,9 @@ class CI_DB_mssql_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); while ($field = mssql_fetch_field($this->result_id)) @@ -118,7 +114,7 @@ class CI_DB_mssql_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if (is_resource($this->result_id)) { @@ -136,10 +132,9 @@ class CI_DB_mssql_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return mssql_data_seek($this->result_id, $n); } @@ -151,10 +146,9 @@ class CI_DB_mssql_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return mssql_fetch_assoc($this->result_id); } @@ -166,16 +160,14 @@ class CI_DB_mssql_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return mssql_fetch_object($this->result_id); } } - /* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index 28f34b999..e64874132 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -39,10 +39,9 @@ class CI_DB_mssql_utility extends CI_DB_utility { /** * List databases * - * @access private * @return bool */ - function _list_databases() + protected function _list_databases() { return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } @@ -54,11 +53,10 @@ class CI_DB_mssql_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * - * @access private * @param string the table name * @return object */ - function _optimize_table($table) + protected function _optimize_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -70,11 +68,10 @@ class CI_DB_mssql_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name * @return object */ - function _repair_table($table) + protected function _repair_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -84,11 +81,10 @@ class CI_DB_mssql_utility extends CI_DB_utility { /** * MSSQL Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 9f86f5cddea54e7fedf4be89d1d1cc90d1564488 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 17:53:37 -0400 Subject: Oci8 access modifiers --- system/database/drivers/oci8/oci8_driver.php | 26 ++++++++++++-------------- system/database/drivers/oci8/oci8_forge.php | 17 ++++++----------- system/database/drivers/oci8/oci8_result.php | 3 +-- system/database/drivers/oci8/oci8_utility.php | 12 ++++-------- 4 files changed, 23 insertions(+), 35 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 8d7040618..e7b744bd3 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -53,33 +53,33 @@ class CI_DB_oci8_driver extends CI_DB { - var $dbdriver = 'oci8'; + public $dbdriver = 'oci8'; // The character used for excaping - var $_escape_char = '"'; + public $_escape_char = '"'; // clause and character used for LIKE escape sequences - var $_like_escape_str = " escape '%s' "; - var $_like_escape_chr = '!'; + public $_like_escape_str = " escape '%s' "; + public $_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. */ - var $_count_string = "SELECT COUNT(1) AS "; - var $_random_keyword = ' ASC'; // not currently supported + public $_count_string = "SELECT COUNT(1) AS "; + public $_random_keyword = ' ASC'; // not currently supported // Set "auto commit" by default - var $_commit = OCI_COMMIT_ON_SUCCESS; + public $_commit = OCI_COMMIT_ON_SUCCESS; // need to track statement id and cursor id - var $stmt_id; - var $curs_id; + public $stmt_id; + public $curs_id; // if we use a limit, we will add a field that will // throw off num_fields later - var $limit_used; + public $limit_used; /** * Non-persistent database connection @@ -214,7 +214,7 @@ class CI_DB_oci8_driver extends CI_DB { * KEY OPTIONAL NOTES * name no the name of the parameter should be in : 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 + * this should be a reference to a publiciable * type yes the type of the parameter * length yes the max size of the parameter */ @@ -781,7 +781,5 @@ class CI_DB_oci8_driver extends CI_DB { } - - /* End of file oci8_driver.php */ -/* Location: ./system/database/drivers/oci8/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 7fcc8094d..f9a90ff0a 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -39,11 +39,10 @@ class CI_DB_oci8_forge extends CI_DB_forge { /** * Create database * - * @access public * @param string the database name * @return bool */ - function _create_database($name) + public function _create_database($name) { return FALSE; } @@ -53,11 +52,10 @@ class CI_DB_oci8_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { return FALSE; } @@ -144,10 +142,9 @@ class CI_DB_oci8_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return bool */ - function _drop_table($table) + protected function _drop_table($table) { return FALSE; } @@ -160,7 +157,6 @@ class CI_DB_oci8_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -170,7 +166,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -212,12 +208,11 @@ class CI_DB_oci8_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -225,4 +220,4 @@ class CI_DB_oci8_forge extends CI_DB_forge { } /* End of file oci8_forge.php */ -/* Location: ./system/database/drivers/oci8/oci8_forge.php */ +/* Location: ./system/database/drivers/oci8/oci8_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 6f1b8b4c1..a14e32eec 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -235,6 +235,5 @@ class CI_DB_oci8_result extends CI_DB_result { } - /* End of file oci8_result.php */ -/* Location: ./system/database/drivers/oci8/oci8_result.php */ +/* Location: ./system/database/drivers/oci8/oci8_result.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index 62dfb2f3c..f4863c0db 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -39,10 +39,9 @@ class CI_DB_oci8_utility extends CI_DB_utility { /** * List databases * - * @access private * @return bool */ - function _list_databases() + protected function _list_databases() { return FALSE; } @@ -54,11 +53,10 @@ class CI_DB_oci8_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * - * @access private * @param string the table name * @return object */ - function _optimize_table($table) + protected function _optimize_table($table) { return FALSE; // Is this supported in Oracle? } @@ -70,11 +68,10 @@ class CI_DB_oci8_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name * @return object */ - function _repair_table($table) + protected function _repair_table($table) { return FALSE; // Is this supported in Oracle? } @@ -84,11 +81,10 @@ class CI_DB_oci8_utility extends CI_DB_utility { /** * Oracle Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 142ca8e565b722b758b5ef88c888891d04da8700 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:00:35 -0400 Subject: ODBC access modifiers --- system/database/drivers/odbc/odbc_driver.php | 96 +++++++++++---------------- system/database/drivers/odbc/odbc_forge.php | 20 ++---- system/database/drivers/odbc/odbc_result.php | 19 ++---- system/database/drivers/odbc/odbc_utility.php | 12 ++-- 4 files changed, 55 insertions(+), 92 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 58da07818..78acd2ce9 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -48,32 +48,35 @@ class CI_DB_odbc_driver extends CI_DB { var $_escape_char = ''; // clause and character used for LIKE escape sequences - var $_like_escape_str = " {escape '%s'} "; - var $_like_escape_chr = '!'; + protected $_like_escape_str = " {escape '%s'} "; + 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; - - function __construct($params) + /** + * Constructor, to define random keyword + */ + public function __construct($params) { parent::__construct($params); $this->_random_keyword = ' RND('.time().')'; // database specific random keyword } + + // -------------------------------------------------------------------------- /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + protected function db_connect() { return @odbc_connect($this->hostname, $this->username, $this->password); } @@ -83,10 +86,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { return @odbc_pconnect($this->hostname, $this->username, $this->password); } @@ -99,10 +101,9 @@ class CI_DB_odbc_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() { // not implemented in odbc } @@ -112,10 +113,9 @@ class CI_DB_odbc_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 ODBC return TRUE; @@ -126,11 +126,10 @@ class CI_DB_odbc_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { return @odbc_exec($this->conn_id, $sql); } @@ -140,10 +139,9 @@ class CI_DB_odbc_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) { @@ -169,10 +167,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -195,10 +192,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -221,12 +217,11 @@ class CI_DB_odbc_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)) { @@ -257,10 +252,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Affected Rows * - * @access public * @return integer */ - function affected_rows() + public function affected_rows() { return @odbc_num_rows($this->conn_id); } @@ -285,11 +279,10 @@ class CI_DB_odbc_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 == '') { @@ -315,11 +308,10 @@ class CI_DB_odbc_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) { $sql = "SHOW TABLES FROM `".$this->database."`"; @@ -339,11 +331,10 @@ class CI_DB_odbc_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 ".$table; } @@ -355,11 +346,10 @@ class CI_DB_odbc_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) { return "SELECT TOP 1 FROM ".$table; } @@ -384,13 +374,12 @@ class CI_DB_odbc_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 == '') { @@ -426,14 +415,13 @@ class CI_DB_odbc_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)) { @@ -450,13 +438,12 @@ class CI_DB_odbc_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -468,7 +455,6 @@ class CI_DB_odbc_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 @@ -476,7 +462,7 @@ class CI_DB_odbc_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) { @@ -504,13 +490,12 @@ class CI_DB_odbc_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); } @@ -522,13 +507,12 @@ class CI_DB_odbc_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 = ''; @@ -556,13 +540,12 @@ class CI_DB_odbc_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) { // Does ODBC doesn't use the LIMIT clause? return $sql; @@ -573,19 +556,14 @@ class CI_DB_odbc_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { @odbc_close($conn_id); } - - } - - /* End of file odbc_driver.php */ -/* Location: ./system/database/drivers/odbc/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 acc2cadee..121c09606 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -39,11 +39,10 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Create database * - * @access private * @param string the database name * @return bool */ - function _create_database() + protected function _create_database() { // ODBC has no "create database" command since it's // designed to connect to an existing database @@ -59,11 +58,10 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { // ODBC has no "drop database" command since it's // designed to connect to an existing database @@ -79,7 +77,6 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -87,7 +84,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -186,10 +183,9 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return bool */ - function _drop_table($table) + protected function _drop_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -207,7 +203,6 @@ class CI_DB_odbc_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -217,7 +212,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -260,12 +255,11 @@ class CI_DB_odbc_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -273,4 +267,4 @@ class CI_DB_odbc_forge extends CI_DB_forge { } /* End of file odbc_forge.php */ -/* Location: ./system/database/drivers/odbc/odbc_forge.php */ +/* Location: ./system/database/drivers/odbc/odbc_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index d19fa247e..0b74871e0 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -130,7 +130,7 @@ class CI_DB_odbc_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if (is_resource($this->result_id)) { @@ -148,10 +148,9 @@ class CI_DB_odbc_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return FALSE; } @@ -163,10 +162,9 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { if (function_exists('odbc_fetch_object')) { @@ -185,10 +183,9 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { if (function_exists('odbc_fetch_object')) { @@ -207,10 +204,9 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_object function when * not available (odbc_fetch_object requires unixODBC) * - * @access private * @return object */ - function _odbc_fetch_object(& $odbc_result) { + protected function _odbc_fetch_object(& $odbc_result) { $rs = array(); $rs_obj = FALSE; if (odbc_fetch_into($odbc_result, $rs)) { @@ -229,10 +225,9 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_array function when * not available (odbc_fetch_array requires unixODBC) * - * @access private * @return array */ - function _odbc_fetch_array(& $odbc_result) { + protected function _odbc_fetch_array(& $odbc_result) { $rs = array(); $rs_assoc = FALSE; if (odbc_fetch_into($odbc_result, $rs)) { @@ -318,4 +313,4 @@ class CI_DB_odbc_result extends CI_DB_result { } /* End of file odbc_result.php */ -/* Location: ./system/database/drivers/odbc/odbc_result.php */ +/* Location: ./system/database/drivers/odbc/odbc_result.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index c146c1785..d663da1ad 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -39,10 +39,9 @@ class CI_DB_odbc_utility extends CI_DB_utility { /** * List databases * - * @access private * @return bool */ - function _list_databases() + protected function _list_databases() { // Not sure if ODBC lets you list all databases... if ($this->db->db_debug) @@ -59,11 +58,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * - * @access private * @param string the table name * @return object */ - function _optimize_table($table) + protected function _optimize_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -80,11 +78,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name * @return object */ - function _repair_table($table) + protected function _repair_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -99,11 +96,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { /** * ODBC Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- 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 +++++++++++----------------- system/database/drivers/pdo/pdo_result.php | 25 ++---- system/database/drivers/pdo/pdo_utility.php | 12 +-- 3 files changed, 63 insertions(+), 98 deletions(-) (limited to 'system/database') 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 diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index 384b753da..330a2e677 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -51,10 +51,9 @@ class CI_DB_pdo_result extends CI_DB_result { /** * Number of rows in the result set * - * @access public * @return integer */ - function num_rows() + public function num_rows() { if (empty($this->result_id) OR ! is_object($this->result_id)) { @@ -74,10 +73,9 @@ class CI_DB_pdo_result extends CI_DB_result { /** * Fetch the result handler * - * @access public * @return mixed */ - function result_assoc() + public function result_assoc() { // If the result already fetched before, use that one if (count($this->result_array) > 0 OR $this->is_fetched) @@ -116,10 +114,9 @@ class CI_DB_pdo_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public * @return integer */ - function num_fields() + public function num_fields() { return $this->result_id->columnCount(); } @@ -131,10 +128,9 @@ class CI_DB_pdo_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { if ($this->db->db_debug) { @@ -151,10 +147,9 @@ class CI_DB_pdo_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $data = array(); @@ -224,7 +219,7 @@ class CI_DB_pdo_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if (is_object($this->result_id)) { @@ -241,10 +236,9 @@ class CI_DB_pdo_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return FALSE; } @@ -256,10 +250,9 @@ class CI_DB_pdo_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return $this->result_id->fetch(PDO::FETCH_ASSOC); } @@ -274,7 +267,7 @@ class CI_DB_pdo_result extends CI_DB_result { * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return $this->result_id->fetchObject(); } diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php index c278c5172..2c12d7438 100644 --- a/system/database/drivers/pdo/pdo_utility.php +++ b/system/database/drivers/pdo/pdo_utility.php @@ -39,10 +39,9 @@ class CI_DB_pdo_utility extends CI_DB_utility { /** * List databases * - * @access private * @return bool */ - function _list_databases() + protected function _list_databases() { // Not sure if PDO lets you list all databases... if ($this->db->db_debug) @@ -59,11 +58,10 @@ class CI_DB_pdo_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * - * @access private * @param string the table name * @return object */ - function _optimize_table($table) + protected function _optimize_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -80,11 +78,10 @@ class CI_DB_pdo_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name * @return object */ - function _repair_table($table) + protected function _repair_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -99,11 +96,10 @@ class CI_DB_pdo_utility extends CI_DB_utility { /** * PDO Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 7a3f89716a5ea3fc00e69342f8c9c7de77ca99ce Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:18:27 -0400 Subject: Postgre visibility declarations --- system/database/drivers/postgre/postgre_driver.php | 83 ++++++++-------------- system/database/drivers/postgre/postgre_forge.php | 24 +++---- system/database/drivers/postgre/postgre_result.php | 25 +++---- .../database/drivers/postgre/postgre_utility.php | 4 +- 4 files changed, 50 insertions(+), 86 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index fad9539ff..6ef83726a 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -42,29 +42,28 @@ */ class CI_DB_postgre_driver extends CI_DB { - var $dbdriver = 'postgre'; + public $dbdriver = 'postgre'; - var $_escape_char = '"'; + protected $_escape_char = '"'; // clause and character used for LIKE escape sequences - var $_like_escape_str = " ESCAPE '%s' "; - var $_like_escape_chr = '!'; + protected $_like_escape_str = " ESCAPE '%s' "; + 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. */ - var $_count_string = "SELECT COUNT(*) AS "; - var $_random_keyword = ' RANDOM()'; // database specific random keyword + protected $_count_string = "SELECT COUNT(*) AS "; + protected $_random_keyword = ' RANDOM()'; // database specific random keyword /** * Connection String * - * @access private * @return string */ - function _connect_string() + protected function _connect_string() { $components = array( 'hostname' => 'host', @@ -90,10 +89,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + protected function db_connect() { return @pg_connect($this->_connect_string()); } @@ -103,10 +101,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { return @pg_pconnect($this->_connect_string()); } @@ -119,10 +116,9 @@ class CI_DB_postgre_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 (pg_ping($this->conn_id) === FALSE) { @@ -135,10 +131,9 @@ class CI_DB_postgre_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 Postgre so we'll return TRUE return TRUE; @@ -191,11 +186,10 @@ class CI_DB_postgre_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { return @pg_query($this->conn_id, $sql); } @@ -264,12 +258,11 @@ class CI_DB_postgre_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)) { @@ -299,10 +292,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Affected Rows * - * @access public * @return integer */ - function affected_rows() + public function affected_rows() { return @pg_affected_rows($this->result_id); } @@ -312,10 +304,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Insert ID * - * @access public * @return integer */ - function insert_id() + public function insert_id() { $v = $this->version(); @@ -355,11 +346,10 @@ class CI_DB_postgre_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 == '') { @@ -384,11 +374,10 @@ class CI_DB_postgre_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) { $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; @@ -407,11 +396,10 @@ class CI_DB_postgre_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 "SELECT column_name FROM information_schema.columns WHERE table_name ='".$table."'"; } @@ -423,11 +411,10 @@ class CI_DB_postgre_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) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -454,11 +441,10 @@ class CI_DB_postgre_driver extends CI_DB { * * This 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 == '') { @@ -497,11 +483,10 @@ class CI_DB_postgre_driver extends CI_DB { * 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 */ - function _from_tables($tables) + public function _from_tables($tables) { if ( ! is_array($tables)) { @@ -518,13 +503,12 @@ class CI_DB_postgre_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -536,13 +520,12 @@ class CI_DB_postgre_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 ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); } @@ -554,7 +537,6 @@ class CI_DB_postgre_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 @@ -562,7 +544,7 @@ class CI_DB_postgre_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) { @@ -585,11 +567,10 @@ class CI_DB_postgre_driver extends CI_DB { * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * - * @access public * @param string the table name * @return string */ - function _truncate($table) + public function _truncate($table) { return "TRUNCATE ".$table; } @@ -601,13 +582,12 @@ class CI_DB_postgre_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 = ''; @@ -632,13 +612,12 @@ class CI_DB_postgre_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) { $sql .= "LIMIT ".$limit; @@ -655,18 +634,14 @@ class CI_DB_postgre_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { @pg_close($conn_id); } - - } - /* End of file postgre_driver.php */ -/* Location: ./system/database/drivers/postgre/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 577100544..2aa6ee82a 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -39,11 +39,10 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Create database * - * @access private * @param string the database name * @return bool */ - function _create_database($name) + protected function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -53,11 +52,10 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -70,7 +68,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - function _process_fields($fields, $primary_keys=array()) + protected function _process_fields($fields, $primary_keys=array()) { $sql = ''; $current_field_count = 0; @@ -177,7 +175,6 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -185,7 +182,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -241,8 +238,11 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Drop Table + * + * @param string the table name + * @return string */ - function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table)." CASCADE"; } @@ -255,7 +255,6 @@ class CI_DB_postgre_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -265,7 +264,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $fields, $after_field = '') + protected function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -292,16 +291,15 @@ class CI_DB_postgre_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } } /* End of file postgre_forge.php */ -/* Location: ./system/database/drivers/postgre/postgre_forge.php */ +/* Location: ./system/database/drivers/postgre/postgre_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index 12d7547c5..b27afaedb 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -41,10 +41,9 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Number of rows in the result set * - * @access public * @return integer */ - function num_rows() + public function num_rows() { return @pg_num_rows($this->result_id); } @@ -54,10 +53,9 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public * @return integer */ - function num_fields() + public function num_fields() { return @pg_num_fields($this->result_id); } @@ -69,10 +67,9 @@ class CI_DB_postgre_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -90,10 +87,9 @@ class CI_DB_postgre_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -118,7 +114,7 @@ class CI_DB_postgre_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if (is_resource($this->result_id)) { @@ -136,10 +132,9 @@ class CI_DB_postgre_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return pg_result_seek($this->result_id, $n); } @@ -151,10 +146,9 @@ class CI_DB_postgre_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return pg_fetch_assoc($this->result_id); } @@ -166,16 +160,13 @@ class CI_DB_postgre_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return pg_fetch_object($this->result_id); } - } - /* End of file postgre_result.php */ /* Location: ./system/database/drivers/postgre/postgre_result.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index e31a6db8f..cf29201ff 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -78,7 +78,7 @@ class CI_DB_postgre_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - function _backup($params = array()) + public function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); @@ -86,4 +86,4 @@ class CI_DB_postgre_utility extends CI_DB_utility { } /* End of file postgre_utility.php */ -/* Location: ./system/database/drivers/postgre/postgre_utility.php */ +/* Location: ./system/database/drivers/postgre/postgre_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 1ed5995be34f499aec8cd7b6d4d525a33017fd94 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:25:43 -0400 Subject: SQlite visibility declarations --- system/database/drivers/sqlite/sqlite_driver.php | 94 ++++++++--------------- system/database/drivers/sqlite/sqlite_forge.php | 19 ++--- system/database/drivers/sqlite/sqlite_result.php | 25 ++---- system/database/drivers/sqlite/sqlite_utility.php | 2 +- 4 files changed, 50 insertions(+), 90 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 1870e73b7..6535d2753 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -42,30 +42,29 @@ */ class CI_DB_sqlite_driver extends CI_DB { - var $dbdriver = 'sqlite'; + public $dbdriver = 'sqlite'; // The character used to escape with - not needed for SQLite - var $_escape_char = ''; + protected $_escape_char = ''; // clause and character used for LIKE escape sequences - var $_like_escape_str = " ESCAPE '%s' "; - var $_like_escape_chr = '!'; + protected $_like_escape_str = " ESCAPE '%s' "; + 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 = ' Random()'; // database specific random keyword + protected $_count_string = "SELECT COUNT(*) AS "; + protected $_random_keyword = ' Random()'; // database specific random keyword /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + protected function db_connect() { if ( ! $conn_id = @sqlite_open($this->database, FILE_WRITE_MODE, $error)) { @@ -87,10 +86,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { if ( ! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error)) { @@ -115,10 +113,9 @@ class CI_DB_sqlite_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() { // not implemented in SQLite } @@ -128,10 +125,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Select the database * - * @access private called by the base class * @return resource */ - function db_select() + protected function db_select() { return TRUE; } @@ -155,11 +151,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { return @sqlite_query($this->conn_id, $sql); } @@ -169,10 +164,9 @@ class CI_DB_sqlite_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) { @@ -199,10 +193,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -224,10 +217,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -249,12 +241,11 @@ class CI_DB_sqlite_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)) { @@ -284,10 +275,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Affected Rows * - * @access public * @return integer */ - function affected_rows() + public function affected_rows() { return sqlite_changes($this->conn_id); } @@ -297,10 +287,9 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Insert ID * - * @access public * @return integer */ - function insert_id() + public function insert_id() { return @sqlite_last_insert_rowid($this->conn_id); } @@ -313,11 +302,10 @@ class CI_DB_sqlite_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 == '') { @@ -342,11 +330,10 @@ class CI_DB_sqlite_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) { $sql = "SELECT name from sqlite_master WHERE type='table'"; @@ -364,11 +351,10 @@ class CI_DB_sqlite_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 = '') { // Not supported return FALSE; @@ -381,11 +367,10 @@ class CI_DB_sqlite_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) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -412,13 +397,12 @@ class CI_DB_sqlite_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 == '') { @@ -454,14 +438,13 @@ class CI_DB_sqlite_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)) { @@ -478,13 +461,12 @@ class CI_DB_sqlite_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -496,7 +478,6 @@ class CI_DB_sqlite_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 @@ -504,7 +485,7 @@ class CI_DB_sqlite_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) { @@ -532,13 +513,12 @@ class CI_DB_sqlite_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); } @@ -550,13 +530,12 @@ class CI_DB_sqlite_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 = ''; @@ -584,13 +563,12 @@ class CI_DB_sqlite_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 ($offset == 0) { @@ -609,18 +587,14 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { @sqlite_close($conn_id); } - - } - /* End of file sqlite_driver.php */ -/* Location: ./system/database/drivers/sqlite/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 7fc531463..595d41968 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -43,7 +43,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the database name * @return bool */ - function _create_database() + public function _create_database() { // In SQLite, a database is created when you connect to the database. // We'll return TRUE so that an error isn't generated @@ -55,11 +55,10 @@ class CI_DB_sqlite_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) { @@ -76,7 +75,6 @@ class CI_DB_sqlite_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -84,7 +82,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -186,10 +184,9 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * * Unsupported feature in SQLite * - * @access private * @return bool */ - function _drop_table($table) + protected function _drop_table($table) { if ($this->db->db_debug) { @@ -206,7 +203,6 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -216,7 +212,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -261,12 +257,11 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -274,4 +269,4 @@ class CI_DB_sqlite_forge extends CI_DB_forge { } /* End of file sqlite_forge.php */ -/* Location: ./system/database/drivers/sqlite/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 ac2235cbc..beb4db6cd 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -41,10 +41,9 @@ class CI_DB_sqlite_result extends CI_DB_result { /** * Number of rows in the result set * - * @access public * @return integer */ - function num_rows() + public function num_rows() { return @sqlite_num_rows($this->result_id); } @@ -54,10 +53,9 @@ class CI_DB_sqlite_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public * @return integer */ - function num_fields() + public function num_fields() { return @sqlite_num_fields($this->result_id); } @@ -69,10 +67,9 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -90,10 +87,9 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -118,7 +114,7 @@ class CI_DB_sqlite_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { // Not implemented in SQLite } @@ -132,10 +128,9 @@ class CI_DB_sqlite_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return sqlite_seek($this->result_id, $n); } @@ -147,10 +142,9 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return sqlite_fetch_array($this->result_id); } @@ -162,10 +156,9 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { if (function_exists('sqlite_fetch_object')) { @@ -183,9 +176,7 @@ class CI_DB_sqlite_result extends CI_DB_result { } } } - } - /* End of file sqlite_result.php */ /* Location: ./system/database/drivers/sqlite/sqlite_result.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 9f9ddca44..c07004c54 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -94,4 +94,4 @@ class CI_DB_sqlite_utility extends CI_DB_utility { } /* End of file sqlite_utility.php */ -/* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ +/* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From b4172695910bf8c0c07933e9baf536d22c9e097a Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:34:11 -0400 Subject: Sqlsrv driver visibility declarations --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 109 +++++++++------------- system/database/drivers/sqlsrv/sqlsrv_forge.php | 20 ++-- system/database/drivers/sqlsrv/sqlsrv_result.php | 24 ++--- system/database/drivers/sqlsrv/sqlsrv_utility.php | 12 +-- 4 files changed, 61 insertions(+), 104 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index ea9f9483b..95ab61b9f 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -42,30 +42,29 @@ */ class CI_DB_sqlsrv_driver extends CI_DB { - var $dbdriver = 'sqlsrv'; + public $dbdriver = 'sqlsrv'; // The character used for escaping - var $_escape_char = ''; + protected $_escape_char = ''; // clause and character used for LIKE escape sequences - var $_like_escape_str = " ESCAPE '%s' "; - var $_like_escape_chr = '!'; + protected $_like_escape_str = " ESCAPE '%s' "; + 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 = ' ASC'; // not currently supported + protected $_count_string = "SELECT COUNT(*) AS "; + protected $_random_keyword = ' ASC'; // not currently supported /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect($pooling = false) + protected function db_connect($pooling = false) { // Check for a UTF-8 charset being passed as CI's default 'utf8'. $character_set = (0 === strcasecmp('utf8', $this->char_set)) ? 'UTF-8' : $this->char_set; @@ -93,10 +92,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + protected function db_pconnect() { return $this->db_connect(TRUE); } @@ -109,10 +107,9 @@ class CI_DB_sqlsrv_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() { // not implemented in MSSQL } @@ -146,11 +143,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { return sqlsrv_query($this->conn_id, $sql, null, array( 'Scrollable' => SQLSRV_CURSOR_STATIC, @@ -163,10 +159,9 @@ class CI_DB_sqlsrv_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) { @@ -192,10 +187,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -216,10 +210,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -240,12 +233,11 @@ class CI_DB_sqlsrv_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) { // Escape single quotes return str_replace("'", "''", $str); @@ -256,10 +248,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Affected Rows * - * @access public * @return integer */ - function affected_rows() + public function affected_rows() { return @sqlrv_rows_affected($this->conn_id); } @@ -271,10 +262,9 @@ class CI_DB_sqlsrv_driver extends CI_DB { * * Returns the last id created in the Identity column. * - * @access public * @return integer */ - function insert_id() + public function insert_id() { return $this->query('select @@IDENTITY as insert_id')->row('insert_id'); } @@ -287,11 +277,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { * Grabs the major version number from the * database server version string passed in. * - * @access private * @param string $version * @return int16 major version number */ - function _parse_major_version($version) + protected function _parse_major_version($version) { preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); return $ver_info[1]; // return the major version b/c that's all we're interested in. @@ -327,11 +316,10 @@ class CI_DB_sqlsrv_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 == '') return '0'; @@ -353,11 +341,10 @@ class CI_DB_sqlsrv_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) { return "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; } @@ -369,11 +356,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * - * @access private * @param string the table name * @return string */ - function _list_columns($table = '') + protected function _list_columns($table = '') { return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->_escape_table($table)."'"; } @@ -385,11 +371,10 @@ class CI_DB_sqlsrv_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) { return "SELECT TOP 1 * FROM " . $this->_escape_table($table); } @@ -437,46 +422,44 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Escape Table Name * - * This function adds backticks if the table name has a period + * This public 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) + protected function _escape_table($table) { return $table; - } - + } + + // -------------------------------------------------------------------------- /** * 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) { return $item; } - // -------------------------------------------------------------------- + // -------------------------------------------------------------------------- /** * 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 + * @param string the table name + * @return string */ - function _from_tables($tables) + public function _from_tables($tables) { if ( ! is_array($tables)) { @@ -493,13 +476,12 @@ class CI_DB_sqlsrv_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->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -511,7 +493,6 @@ class CI_DB_sqlsrv_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 @@ -519,7 +500,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where) + public function _update($table, $values, $where) { foreach($values as $key => $val) { @@ -536,13 +517,12 @@ class CI_DB_sqlsrv_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 "TRUNCATE ".$table; } @@ -554,13 +534,12 @@ class CI_DB_sqlsrv_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) + public function _delete($table, $where) { return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); } @@ -572,13 +551,12 @@ class CI_DB_sqlsrv_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) { $i = $limit + $offset; @@ -590,18 +568,15 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + public function _close($conn_id) { @sqlsrv_close($conn_id); } } - - /* End of file mssql_driver.php */ -/* Location: ./system/database/drivers/mssql/mssql_driver.php */ +/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index cd061dd23..645274232 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -39,11 +39,10 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Create database * - * @access private * @param string the database name * @return bool */ - function _create_database($name) + protected function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -53,11 +52,10 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + protected function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -67,10 +65,9 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return bool */ - function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE ".$this->db->_escape_identifiers($table); } @@ -80,7 +77,6 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -88,7 +84,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -190,7 +186,6 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -200,7 +195,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -242,12 +237,11 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); @@ -256,4 +250,4 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { } /* End of file sqlsrv_forge.php */ -/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ +/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 52d338a30..095e3440a 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -41,10 +41,9 @@ class CI_DB_sqlsrv_result extends CI_DB_result { /** * Number of rows in the result set * - * @access public * @return integer */ - function num_rows() + public function num_rows() { return @sqlsrv_num_rows($this->result_id); } @@ -54,10 +53,9 @@ class CI_DB_sqlsrv_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public * @return integer */ - function num_fields() + pubilc function num_fields() { return @sqlsrv_num_fields($this->result_id); } @@ -69,10 +67,9 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { $field_names = array(); foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) @@ -90,10 +87,9 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) @@ -118,7 +114,7 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if (is_resource($this->result_id)) { @@ -136,10 +132,9 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { // Not implemented } @@ -151,10 +146,9 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC); } @@ -166,16 +160,14 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return sqlsrv_fetch_object($this->result_id); } } - /* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 44e6fafeb..9e9dde32e 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -39,10 +39,9 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { /** * List databases * - * @access private * @return bool */ - function _list_databases() + protected function _list_databases() { return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } @@ -54,11 +53,10 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * - * @access private * @param string the table name * @return object */ - function _optimize_table($table) + protected function _optimize_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -70,11 +68,10 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name * @return object */ - function _repair_table($table) + protected function _repair_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -84,11 +81,10 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { /** * MSSQL Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 9cc5c60052d1942a5f49016a8f36cf90b27b7c78 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:36:37 -0400 Subject: Minor mysql/mysqli formatting fixes --- system/database/drivers/mysql/mysql_driver.php | 2 +- system/database/drivers/mysql/mysql_forge.php | 2 +- system/database/drivers/mysql/mysql_result.php | 2 +- system/database/drivers/mysql/mysql_utility.php | 2 +- system/database/drivers/mysqli/mysqli_driver.php | 2 +- system/database/drivers/mysqli/mysqli_forge.php | 2 +- system/database/drivers/mysqli/mysqli_result.php | 2 +- system/database/drivers/mysqli/mysqli_utility.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index ba646d226..bef4111c3 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -701,4 +701,4 @@ class CI_DB_mysql_driver extends CI_DB { } /* End of file mysql_driver.php */ -/* Location: ./system/database/drivers/mysql/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 004a5a103..8e5143818 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -237,4 +237,4 @@ class CI_DB_mysql_forge extends CI_DB_forge { } /* End of file mysql_forge.php */ -/* Location: ./system/database/drivers/mysql/mysql_forge.php */ +/* Location: ./system/database/drivers/mysql/mysql_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index cec28dc2d..f76076f4c 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -166,4 +166,4 @@ class CI_DB_mysql_result extends CI_DB_result { } /* End of file mysql_result.php */ -/* Location: ./system/database/drivers/mysql/mysql_result.php */ +/* Location: ./system/database/drivers/mysql/mysql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index d716b004a..2d89cb9cb 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -204,4 +204,4 @@ class CI_DB_mysql_utility extends CI_DB_utility { } /* End of file mysql_utility.php */ -/* Location: ./system/database/drivers/mysql/mysql_utility.php */ +/* Location: ./system/database/drivers/mysql/mysql_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index f38b94c13..4c5d52127 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -697,4 +697,4 @@ class CI_DB_mysqli_driver extends CI_DB { } /* End of file mysqli_driver.php */ -/* Location: ./system/database/drivers/mysqli/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 9cb1a0c70..c1be117f3 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -237,4 +237,4 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } /* End of file mysqli_forge.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ +/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index f135f4d46..83d88aae3 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -167,4 +167,4 @@ class CI_DB_mysqli_result extends CI_DB_result { } /* End of file mysqli_result.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_result.php */ +/* Location: ./system/database/drivers/mysqli/mysqli_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index 650ddfd18..4d7002e78 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -90,4 +90,4 @@ class CI_DB_mysqli_utility extends CI_DB_utility { } /* End of file mysqli_utility.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ +/* Location: ./system/database/drivers/mysqli/mysqli_utility.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 78a2de4e049f478ec1efd92d639aaf11be933335 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 18:57:56 -0400 Subject: Fixed visibility declarations on dbforge and utility classes --- system/database/drivers/cubrid/cubrid_forge.php | 14 +++++++------- system/database/drivers/cubrid/cubrid_utility.php | 8 ++++---- system/database/drivers/oci8/oci8_forge.php | 8 ++++---- system/database/drivers/oci8/oci8_utility.php | 8 ++++---- system/database/drivers/odbc/odbc_forge.php | 12 ++++++------ system/database/drivers/odbc/odbc_utility.php | 8 ++++---- system/database/drivers/pdo/pdo_forge.php | 20 +++++++------------- system/database/drivers/pdo/pdo_utility.php | 8 ++++---- system/database/drivers/postgre/postgre_forge.php | 14 +++++++------- system/database/drivers/sqlite/sqlite_forge.php | 10 +++++----- system/database/drivers/sqlsrv/sqlsrv_forge.php | 12 ++++++------ system/database/drivers/sqlsrv/sqlsrv_utility.php | 8 ++++---- 12 files changed, 62 insertions(+), 68 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 6bfc7c28f..c3251bd3f 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -42,7 +42,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _create_database($name) + public function _create_database($name) { // CUBRID does not allow to create a database in SQL. The GUI tools // have to be used for this purpose. @@ -57,7 +57,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _drop_database($name) + public function _drop_database($name) { // CUBRID does not allow to drop a database in SQL. The GUI tools // have to be used for this purpose. @@ -72,7 +72,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - protected function _process_fields($fields) + public function _process_fields($fields) { $current_field_count = 0; $sql = ''; @@ -176,7 +176,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -230,7 +230,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * * @return string */ - protected function _drop_table($table) + public function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); } @@ -249,7 +249,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $fields, $after_field = '') + public function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -280,7 +280,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'RENAME TABLE '.$this->db->protect_identifiers($table_name).' AS '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index de28e6335..bc54e7a1b 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -42,7 +42,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @access private * @return array */ - protected function _list_databases() + public function _list_databases() { // CUBRID does not allow to see the list of all databases on the // server. It is the way its architecture is designed. Every @@ -71,7 +71,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Optimize%20Database */ - protected function _optimize_table($table) + public function _optimize_table($table) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table optimization can be performed using CUBRID Manager @@ -91,7 +91,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency */ - protected function _repair_table($table) + public function _repair_table($table) { // Not supported in CUBRID as of version 8.4.0. Database or // table consistency can be checked using CUBRID Manager @@ -107,7 +107,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + public function _backup($params = array()) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table backup can be performed using CUBRID Manager diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index f9a90ff0a..c59cfa709 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -55,7 +55,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _drop_database($name) + public function _drop_database($name) { return FALSE; } @@ -144,7 +144,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * * @return bool */ - protected function _drop_table($table) + public function _drop_table($table) { return FALSE; } @@ -166,7 +166,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -212,7 +212,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index f4863c0db..bfbf87140 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -41,7 +41,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * * @return bool */ - protected function _list_databases() + public function _list_databases() { return FALSE; } @@ -56,7 +56,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _optimize_table($table) + public function _optimize_table($table) { return FALSE; // Is this supported in Oracle? } @@ -71,7 +71,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _repair_table($table) + public function _repair_table($table) { return FALSE; // Is this supported in Oracle? } @@ -84,7 +84,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + public function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index 121c09606..c5b062e5c 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -42,7 +42,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _create_database() + public function _create_database() { // ODBC has no "create database" command since it's // designed to connect to an existing database @@ -61,7 +61,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _drop_database($name) + public function _drop_database($name) { // ODBC has no "drop database" command since it's // designed to connect to an existing database @@ -84,7 +84,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -185,7 +185,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * * @return bool */ - protected function _drop_table($table) + public function _drop_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -212,7 +212,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -259,7 +259,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index d663da1ad..a07d3b64e 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -41,7 +41,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * @return bool */ - protected function _list_databases() + public function _list_databases() { // Not sure if ODBC lets you list all databases... if ($this->db->db_debug) @@ -61,7 +61,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _optimize_table($table) + public function _optimize_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -81,7 +81,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _repair_table($table) + public function _repair_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -99,7 +99,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + public function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php index 87b638570..7fca962b3 100644 --- a/system/database/drivers/pdo/pdo_forge.php +++ b/system/database/drivers/pdo/pdo_forge.php @@ -39,11 +39,10 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Create database * - * @access private * @param string the database name * @return bool */ - function _create_database() + public function _create_database() { // PDO has no "create database" command since it's // designed to connect to an existing database @@ -59,11 +58,10 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Drop database * - * @access private * @param string the database name * @return bool */ - function _drop_database($name) + public function _drop_database($name) { // PDO has no "drop database" command since it's // designed to connect to an existing database @@ -79,7 +77,6 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -87,7 +84,7 @@ class CI_DB_pdo_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -191,10 +188,9 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return bool */ - function _drop_table($table) + public function _drop_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -212,7 +208,6 @@ class CI_DB_pdo_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -222,7 +217,7 @@ class CI_DB_pdo_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE `'.$this->db->protect_identifiers($table).'` '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -265,12 +260,11 @@ class CI_DB_pdo_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -278,4 +272,4 @@ class CI_DB_pdo_forge extends CI_DB_forge { } /* End of file pdo_forge.php */ -/* Location: ./system/database/drivers/pdo/pdo_forge.php */ +/* Location: ./system/database/drivers/pdo/pdo_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php index 2c12d7438..02373b720 100644 --- a/system/database/drivers/pdo/pdo_utility.php +++ b/system/database/drivers/pdo/pdo_utility.php @@ -41,7 +41,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * * @return bool */ - protected function _list_databases() + public function _list_databases() { // Not sure if PDO lets you list all databases... if ($this->db->db_debug) @@ -61,7 +61,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _optimize_table($table) + public function _optimize_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -81,7 +81,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _repair_table($table) + public function _repair_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -99,7 +99,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + public function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 2aa6ee82a..04622586d 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -42,7 +42,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _create_database($name) + public function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -55,7 +55,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _drop_database($name) + public function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -68,7 +68,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - protected function _process_fields($fields, $primary_keys=array()) + public function _process_fields($fields, $primary_keys=array()) { $sql = ''; $current_field_count = 0; @@ -182,7 +182,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -242,7 +242,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the table name * @return string */ - protected function _drop_table($table) + public function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table)." CASCADE"; } @@ -264,7 +264,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $fields, $after_field = '') + public function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -295,7 +295,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 595d41968..4b22989ea 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -58,7 +58,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _drop_database($name) + public function _drop_database($name) { if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) { @@ -82,7 +82,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -186,7 +186,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * * @return bool */ - protected function _drop_table($table) + public function _drop_table($table) { if ($this->db->db_debug) { @@ -212,7 +212,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -261,7 +261,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index 645274232..b7b45a4e6 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -42,7 +42,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _create_database($name) + public function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -55,7 +55,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the database name * @return bool */ - protected function _drop_database($name) + public function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -67,7 +67,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * * @return bool */ - protected function _drop_table($table) + public function _drop_table($table) { return "DROP TABLE ".$this->db->_escape_identifiers($table); } @@ -84,7 +84,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -195,7 +195,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -241,7 +241,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 9e9dde32e..4d40f0675 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -41,7 +41,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * * @return bool */ - protected function _list_databases() + public function _list_databases() { return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } @@ -56,7 +56,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _optimize_table($table) + public function _optimize_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -71,7 +71,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * @param string the table name * @return object */ - protected function _repair_table($table) + public function _repair_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -84,7 +84,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + public function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 5137ebcafe525752bfc79abc0628e45f55eb196e Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:05:25 -0400 Subject: Revert "Fixed visibility declarations on dbforge and utility classes" This reverts commit 78a2de4e049f478ec1efd92d639aaf11be933335. --- system/database/drivers/cubrid/cubrid_forge.php | 14 +++++++------- system/database/drivers/cubrid/cubrid_utility.php | 8 ++++---- system/database/drivers/oci8/oci8_forge.php | 8 ++++---- system/database/drivers/oci8/oci8_utility.php | 8 ++++---- system/database/drivers/odbc/odbc_forge.php | 12 ++++++------ system/database/drivers/odbc/odbc_utility.php | 8 ++++---- system/database/drivers/pdo/pdo_forge.php | 20 +++++++++++++------- system/database/drivers/pdo/pdo_utility.php | 8 ++++---- system/database/drivers/postgre/postgre_forge.php | 14 +++++++------- system/database/drivers/sqlite/sqlite_forge.php | 10 +++++----- system/database/drivers/sqlsrv/sqlsrv_forge.php | 12 ++++++------ system/database/drivers/sqlsrv/sqlsrv_utility.php | 8 ++++---- 12 files changed, 68 insertions(+), 62 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index c3251bd3f..6bfc7c28f 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -42,7 +42,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _create_database($name) + protected function _create_database($name) { // CUBRID does not allow to create a database in SQL. The GUI tools // have to be used for this purpose. @@ -57,7 +57,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _drop_database($name) + protected function _drop_database($name) { // CUBRID does not allow to drop a database in SQL. The GUI tools // have to be used for this purpose. @@ -72,7 +72,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - public function _process_fields($fields) + protected function _process_fields($fields) { $current_field_count = 0; $sql = ''; @@ -176,7 +176,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -230,7 +230,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * * @return string */ - public function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); } @@ -249,7 +249,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $fields, $after_field = '') + protected function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -280,7 +280,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'RENAME TABLE '.$this->db->protect_identifiers($table_name).' AS '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index bc54e7a1b..de28e6335 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -42,7 +42,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @access private * @return array */ - public function _list_databases() + protected function _list_databases() { // CUBRID does not allow to see the list of all databases on the // server. It is the way its architecture is designed. Every @@ -71,7 +71,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Optimize%20Database */ - public function _optimize_table($table) + protected function _optimize_table($table) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table optimization can be performed using CUBRID Manager @@ -91,7 +91,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency */ - public function _repair_table($table) + protected function _repair_table($table) { // Not supported in CUBRID as of version 8.4.0. Database or // table consistency can be checked using CUBRID Manager @@ -107,7 +107,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - public function _backup($params = array()) + protected function _backup($params = array()) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table backup can be performed using CUBRID Manager diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index c59cfa709..f9a90ff0a 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -55,7 +55,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _drop_database($name) + protected function _drop_database($name) { return FALSE; } @@ -144,7 +144,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * * @return bool */ - public function _drop_table($table) + protected function _drop_table($table) { return FALSE; } @@ -166,7 +166,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -212,7 +212,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index bfbf87140..f4863c0db 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -41,7 +41,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * * @return bool */ - public function _list_databases() + protected function _list_databases() { return FALSE; } @@ -56,7 +56,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _optimize_table($table) + protected function _optimize_table($table) { return FALSE; // Is this supported in Oracle? } @@ -71,7 +71,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _repair_table($table) + protected function _repair_table($table) { return FALSE; // Is this supported in Oracle? } @@ -84,7 +84,7 @@ class CI_DB_oci8_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - public function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index c5b062e5c..121c09606 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -42,7 +42,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _create_database() + protected function _create_database() { // ODBC has no "create database" command since it's // designed to connect to an existing database @@ -61,7 +61,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _drop_database($name) + protected function _drop_database($name) { // ODBC has no "drop database" command since it's // designed to connect to an existing database @@ -84,7 +84,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -185,7 +185,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * * @return bool */ - public function _drop_table($table) + protected function _drop_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -212,7 +212,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -259,7 +259,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index a07d3b64e..d663da1ad 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -41,7 +41,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * @return bool */ - public function _list_databases() + protected function _list_databases() { // Not sure if ODBC lets you list all databases... if ($this->db->db_debug) @@ -61,7 +61,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _optimize_table($table) + protected function _optimize_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -81,7 +81,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _repair_table($table) + protected function _repair_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -99,7 +99,7 @@ class CI_DB_odbc_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - public function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php index 7fca962b3..87b638570 100644 --- a/system/database/drivers/pdo/pdo_forge.php +++ b/system/database/drivers/pdo/pdo_forge.php @@ -39,10 +39,11 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Create database * + * @access private * @param string the database name * @return bool */ - public function _create_database() + function _create_database() { // PDO has no "create database" command since it's // designed to connect to an existing database @@ -58,10 +59,11 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - public function _drop_database($name) + function _drop_database($name) { // PDO has no "drop database" command since it's // designed to connect to an existing database @@ -77,6 +79,7 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -84,7 +87,7 @@ class CI_DB_pdo_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -188,9 +191,10 @@ class CI_DB_pdo_forge extends CI_DB_forge { /** * Drop Table * + * @access private * @return bool */ - public function _drop_table($table) + function _drop_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -208,6 +212,7 @@ class CI_DB_pdo_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -217,7 +222,7 @@ class CI_DB_pdo_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE `'.$this->db->protect_identifiers($table).'` '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -260,11 +265,12 @@ class CI_DB_pdo_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -272,4 +278,4 @@ class CI_DB_pdo_forge extends CI_DB_forge { } /* End of file pdo_forge.php */ -/* Location: ./system/database/drivers/pdo/pdo_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/pdo/pdo_forge.php */ diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php index 02373b720..2c12d7438 100644 --- a/system/database/drivers/pdo/pdo_utility.php +++ b/system/database/drivers/pdo/pdo_utility.php @@ -41,7 +41,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * * @return bool */ - public function _list_databases() + protected function _list_databases() { // Not sure if PDO lets you list all databases... if ($this->db->db_debug) @@ -61,7 +61,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _optimize_table($table) + protected function _optimize_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -81,7 +81,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _repair_table($table) + protected function _repair_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -99,7 +99,7 @@ class CI_DB_pdo_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - public function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 04622586d..2aa6ee82a 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -42,7 +42,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _create_database($name) + protected function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -55,7 +55,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _drop_database($name) + protected function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -68,7 +68,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - public function _process_fields($fields, $primary_keys=array()) + protected function _process_fields($fields, $primary_keys=array()) { $sql = ''; $current_field_count = 0; @@ -182,7 +182,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -242,7 +242,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the table name * @return string */ - public function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table)." CASCADE"; } @@ -264,7 +264,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $fields, $after_field = '') + protected function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -295,7 +295,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 4b22989ea..595d41968 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -58,7 +58,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _drop_database($name) + protected function _drop_database($name) { if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) { @@ -82,7 +82,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -186,7 +186,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * * @return bool */ - public function _drop_table($table) + protected function _drop_table($table) { if ($this->db->db_debug) { @@ -212,7 +212,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -261,7 +261,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index b7b45a4e6..645274232 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -42,7 +42,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _create_database($name) + protected function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -55,7 +55,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _drop_database($name) + protected function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -67,7 +67,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * * @return bool */ - public function _drop_table($table) + protected function _drop_table($table) { return "DROP TABLE ".$this->db->_escape_identifiers($table); } @@ -84,7 +84,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -195,7 +195,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -241,7 +241,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the new table name * @return string */ - public function _rename_table($table_name, $new_table_name) + protected function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 4d40f0675..9e9dde32e 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -41,7 +41,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * * @return bool */ - public function _list_databases() + protected function _list_databases() { return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } @@ -56,7 +56,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _optimize_table($table) + protected function _optimize_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -71,7 +71,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * @param string the table name * @return object */ - public function _repair_table($table) + protected function _repair_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -84,7 +84,7 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - public function _backup($params = array()) + protected function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 0e20da17ff71bbe4a7082940b38f6161d7b6e7f8 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:05:46 -0400 Subject: Revert "Sqlsrv driver visibility declarations" This reverts commit b4172695910bf8c0c07933e9baf536d22c9e097a. --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 109 +++++++++++++--------- system/database/drivers/sqlsrv/sqlsrv_forge.php | 20 ++-- system/database/drivers/sqlsrv/sqlsrv_result.php | 24 +++-- system/database/drivers/sqlsrv/sqlsrv_utility.php | 12 ++- 4 files changed, 104 insertions(+), 61 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 95ab61b9f..ea9f9483b 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -42,29 +42,30 @@ */ class CI_DB_sqlsrv_driver extends CI_DB { - public $dbdriver = 'sqlsrv'; + var $dbdriver = 'sqlsrv'; // The character used for escaping - protected $_escape_char = ''; + var $_escape_char = ''; // clause and character used for LIKE escape sequences - protected $_like_escape_str = " ESCAPE '%s' "; - protected $_like_escape_chr = '!'; + var $_like_escape_str = " ESCAPE '%s' "; + 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 = ' ASC'; // not currently supported + var $_count_string = "SELECT COUNT(*) AS "; + var $_random_keyword = ' ASC'; // not currently supported /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect($pooling = false) + function db_connect($pooling = false) { // Check for a UTF-8 charset being passed as CI's default 'utf8'. $character_set = (0 === strcasecmp('utf8', $this->char_set)) ? 'UTF-8' : $this->char_set; @@ -92,9 +93,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { return $this->db_connect(TRUE); } @@ -107,9 +109,10 @@ class CI_DB_sqlsrv_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() { // not implemented in MSSQL } @@ -143,10 +146,11 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return resource */ - protected function _execute($sql) + function _execute($sql) { return sqlsrv_query($this->conn_id, $sql, null, array( 'Scrollable' => SQLSRV_CURSOR_STATIC, @@ -159,9 +163,10 @@ class CI_DB_sqlsrv_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) { @@ -187,9 +192,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Commit Transaction * + * @access public * @return bool */ - public function trans_commit() + function trans_commit() { if ( ! $this->trans_enabled) { @@ -210,9 +216,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Rollback Transaction * + * @access public * @return bool */ - public function trans_rollback() + function trans_rollback() { if ( ! $this->trans_enabled) { @@ -233,11 +240,12 @@ class CI_DB_sqlsrv_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) { // Escape single quotes return str_replace("'", "''", $str); @@ -248,9 +256,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Affected Rows * + * @access public * @return integer */ - public function affected_rows() + function affected_rows() { return @sqlrv_rows_affected($this->conn_id); } @@ -262,9 +271,10 @@ class CI_DB_sqlsrv_driver extends CI_DB { * * Returns the last id created in the Identity column. * + * @access public * @return integer */ - public function insert_id() + function insert_id() { return $this->query('select @@IDENTITY as insert_id')->row('insert_id'); } @@ -277,10 +287,11 @@ class CI_DB_sqlsrv_driver extends CI_DB { * Grabs the major version number from the * database server version string passed in. * + * @access private * @param string $version * @return int16 major version number */ - protected function _parse_major_version($version) + function _parse_major_version($version) { preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); return $ver_info[1]; // return the major version b/c that's all we're interested in. @@ -316,10 +327,11 @@ class CI_DB_sqlsrv_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 == '') return '0'; @@ -341,10 +353,11 @@ class CI_DB_sqlsrv_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) { return "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; } @@ -356,10 +369,11 @@ class CI_DB_sqlsrv_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * + * @access private * @param string the table name * @return string */ - protected function _list_columns($table = '') + function _list_columns($table = '') { return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->_escape_table($table)."'"; } @@ -371,10 +385,11 @@ class CI_DB_sqlsrv_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) { return "SELECT TOP 1 * FROM " . $this->_escape_table($table); } @@ -422,44 +437,46 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Escape Table Name * - * This public function adds backticks if the table name has a period + * 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 */ - protected function _escape_table($table) + function _escape_table($table) { return $table; - } - - // -------------------------------------------------------------------------- + } + /** * 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) { return $item; } - // -------------------------------------------------------------------------- + // -------------------------------------------------------------------- /** * 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 * - * @param string the table name - * @return string + * @access public + * @param type + * @return type */ - public function _from_tables($tables) + function _from_tables($tables) { if ( ! is_array($tables)) { @@ -476,12 +493,13 @@ class CI_DB_sqlsrv_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->_escape_table($table)." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -493,6 +511,7 @@ class CI_DB_sqlsrv_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 @@ -500,7 +519,7 @@ class CI_DB_sqlsrv_driver extends CI_DB { * @param array the limit clause * @return string */ - public function _update($table, $values, $where) + function _update($table, $values, $where) { foreach($values as $key => $val) { @@ -517,12 +536,13 @@ class CI_DB_sqlsrv_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 "TRUNCATE ".$table; } @@ -534,12 +554,13 @@ class CI_DB_sqlsrv_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) + function _delete($table, $where) { return "DELETE FROM ".$this->_escape_table($table)." WHERE ".implode(" ", $where); } @@ -551,12 +572,13 @@ class CI_DB_sqlsrv_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) { $i = $limit + $offset; @@ -568,15 +590,18 @@ class CI_DB_sqlsrv_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { @sqlsrv_close($conn_id); } } + + /* End of file mssql_driver.php */ -/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/mssql/mssql_driver.php */ diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index 645274232..cd061dd23 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -39,10 +39,11 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Create database * + * @access private * @param string the database name * @return bool */ - protected function _create_database($name) + function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -52,10 +53,11 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -65,9 +67,10 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Drop Table * + * @access private * @return bool */ - protected function _drop_table($table) + function _drop_table($table) { return "DROP TABLE ".$this->db->_escape_identifiers($table); } @@ -77,6 +80,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -84,7 +88,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -186,6 +190,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -195,7 +200,7 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -237,11 +242,12 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); @@ -250,4 +256,4 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { } /* End of file sqlsrv_forge.php */ -/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 095e3440a..52d338a30 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -41,9 +41,10 @@ class CI_DB_sqlsrv_result extends CI_DB_result { /** * Number of rows in the result set * + * @access public * @return integer */ - public function num_rows() + function num_rows() { return @sqlsrv_num_rows($this->result_id); } @@ -53,9 +54,10 @@ class CI_DB_sqlsrv_result extends CI_DB_result { /** * Number of fields in the result set * + * @access public * @return integer */ - pubilc function num_fields() + function num_fields() { return @sqlsrv_num_fields($this->result_id); } @@ -67,9 +69,10 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Generates an array of column names * + * @access public * @return array */ - public function list_fields() + function list_fields() { $field_names = array(); foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) @@ -87,9 +90,10 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * + * @access public * @return array */ - public function field_data() + function field_data() { $retval = array(); foreach(sqlsrv_field_metadata($this->result_id) as $offset => $field) @@ -114,7 +118,7 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { if (is_resource($this->result_id)) { @@ -132,9 +136,10 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { // Not implemented } @@ -146,9 +151,10 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { return sqlsrv_fetch_array($this->result_id, SQLSRV_FETCH_ASSOC); } @@ -160,14 +166,16 @@ class CI_DB_sqlsrv_result extends CI_DB_result { * * Returns the result set as an object * + * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { return sqlsrv_fetch_object($this->result_id); } } + /* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 9e9dde32e..44e6fafeb 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -39,9 +39,10 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { /** * List databases * + * @access private * @return bool */ - protected function _list_databases() + function _list_databases() { return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } @@ -53,10 +54,11 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * + * @access private * @param string the table name * @return object */ - protected function _optimize_table($table) + function _optimize_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -68,10 +70,11 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * + * @access private * @param string the table name * @return object */ - protected function _repair_table($table) + function _repair_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -81,10 +84,11 @@ class CI_DB_sqlsrv_utility extends CI_DB_utility { /** * MSSQL Export * + * @access private * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 691a8e747dc3b9a277488b133a5a02914ff210eb Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:06:00 -0400 Subject: Revert "SQlite visibility declarations" This reverts commit 1ed5995be34f499aec8cd7b6d4d525a33017fd94. --- system/database/drivers/sqlite/sqlite_driver.php | 94 +++++++++++++++-------- system/database/drivers/sqlite/sqlite_forge.php | 19 +++-- system/database/drivers/sqlite/sqlite_result.php | 25 ++++-- system/database/drivers/sqlite/sqlite_utility.php | 2 +- 4 files changed, 90 insertions(+), 50 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 6535d2753..1870e73b7 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -42,29 +42,30 @@ */ class CI_DB_sqlite_driver extends CI_DB { - public $dbdriver = 'sqlite'; + var $dbdriver = 'sqlite'; // The character used to escape with - not needed for SQLite - protected $_escape_char = ''; + var $_escape_char = ''; // clause and character used for LIKE escape sequences - protected $_like_escape_str = " ESCAPE '%s' "; - protected $_like_escape_chr = '!'; + var $_like_escape_str = " ESCAPE '%s' "; + 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 = ' Random()'; // database specific random keyword + var $_count_string = "SELECT COUNT(*) AS "; + var $_random_keyword = ' Random()'; // database specific random keyword /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect() + function db_connect() { if ( ! $conn_id = @sqlite_open($this->database, FILE_WRITE_MODE, $error)) { @@ -86,9 +87,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { if ( ! $conn_id = @sqlite_popen($this->database, FILE_WRITE_MODE, $error)) { @@ -113,9 +115,10 @@ class CI_DB_sqlite_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() { // not implemented in SQLite } @@ -125,9 +128,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Select the database * + * @access private called by the base class * @return resource */ - protected function db_select() + function db_select() { return TRUE; } @@ -151,10 +155,11 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return resource */ - protected function _execute($sql) + function _execute($sql) { return @sqlite_query($this->conn_id, $sql); } @@ -164,9 +169,10 @@ class CI_DB_sqlite_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) { @@ -193,9 +199,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Commit Transaction * + * @access public * @return bool */ - public function trans_commit() + function trans_commit() { if ( ! $this->trans_enabled) { @@ -217,9 +224,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Rollback Transaction * + * @access public * @return bool */ - public function trans_rollback() + function trans_rollback() { if ( ! $this->trans_enabled) { @@ -241,11 +249,12 @@ class CI_DB_sqlite_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)) { @@ -275,9 +284,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Affected Rows * + * @access public * @return integer */ - public function affected_rows() + function affected_rows() { return sqlite_changes($this->conn_id); } @@ -287,9 +297,10 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Insert ID * + * @access public * @return integer */ - public function insert_id() + function insert_id() { return @sqlite_last_insert_rowid($this->conn_id); } @@ -302,10 +313,11 @@ class CI_DB_sqlite_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 == '') { @@ -330,10 +342,11 @@ class CI_DB_sqlite_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) { $sql = "SELECT name from sqlite_master WHERE type='table'"; @@ -351,10 +364,11 @@ class CI_DB_sqlite_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 = '') { // Not supported return FALSE; @@ -367,10 +381,11 @@ class CI_DB_sqlite_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) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -397,12 +412,13 @@ class CI_DB_sqlite_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 == '') { @@ -438,13 +454,14 @@ class CI_DB_sqlite_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)) { @@ -461,12 +478,13 @@ class CI_DB_sqlite_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -478,6 +496,7 @@ class CI_DB_sqlite_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 @@ -485,7 +504,7 @@ class CI_DB_sqlite_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) { @@ -513,12 +532,13 @@ class CI_DB_sqlite_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); } @@ -530,12 +550,13 @@ class CI_DB_sqlite_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 = ''; @@ -563,12 +584,13 @@ class CI_DB_sqlite_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 ($offset == 0) { @@ -587,14 +609,18 @@ class CI_DB_sqlite_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { @sqlite_close($conn_id); } + + } + /* End of file sqlite_driver.php */ -/* Location: ./system/database/drivers/sqlite/sqlite_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/sqlite/sqlite_driver.php */ diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 595d41968..7fc531463 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -43,7 +43,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the database name * @return bool */ - public function _create_database() + function _create_database() { // In SQLite, a database is created when you connect to the database. // We'll return TRUE so that an error isn't generated @@ -55,10 +55,11 @@ class CI_DB_sqlite_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { if ( ! @file_exists($this->db->database) OR ! @unlink($this->db->database)) { @@ -75,6 +76,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -82,7 +84,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -184,9 +186,10 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * * Unsupported feature in SQLite * + * @access private * @return bool */ - protected function _drop_table($table) + function _drop_table($table) { if ($this->db->db_debug) { @@ -203,6 +206,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -212,7 +216,7 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -257,11 +261,12 @@ class CI_DB_sqlite_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -269,4 +274,4 @@ class CI_DB_sqlite_forge extends CI_DB_forge { } /* End of file sqlite_forge.php */ -/* Location: ./system/database/drivers/sqlite/sqlite_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/sqlite/sqlite_forge.php */ diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index beb4db6cd..ac2235cbc 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -41,9 +41,10 @@ class CI_DB_sqlite_result extends CI_DB_result { /** * Number of rows in the result set * + * @access public * @return integer */ - public function num_rows() + function num_rows() { return @sqlite_num_rows($this->result_id); } @@ -53,9 +54,10 @@ class CI_DB_sqlite_result extends CI_DB_result { /** * Number of fields in the result set * + * @access public * @return integer */ - public function num_fields() + function num_fields() { return @sqlite_num_fields($this->result_id); } @@ -67,9 +69,10 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Generates an array of column names * + * @access public * @return array */ - public function list_fields() + function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -87,9 +90,10 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * + * @access public * @return array */ - public function field_data() + function field_data() { $retval = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -114,7 +118,7 @@ class CI_DB_sqlite_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { // Not implemented in SQLite } @@ -128,9 +132,10 @@ class CI_DB_sqlite_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { return sqlite_seek($this->result_id, $n); } @@ -142,9 +147,10 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { return sqlite_fetch_array($this->result_id); } @@ -156,9 +162,10 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Returns the result set as an object * + * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { if (function_exists('sqlite_fetch_object')) { @@ -176,7 +183,9 @@ class CI_DB_sqlite_result extends CI_DB_result { } } } + } + /* End of file sqlite_result.php */ /* Location: ./system/database/drivers/sqlite/sqlite_result.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index c07004c54..9f9ddca44 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -94,4 +94,4 @@ class CI_DB_sqlite_utility extends CI_DB_utility { } /* End of file sqlite_utility.php */ -/* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ \ No newline at end of file +/* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ -- cgit v1.2.3-24-g4f1b From 99c02ef1dfbdfb444e3effb58906c4369f17b20e Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:06:16 -0400 Subject: Revert "Postgre visibility declarations" This reverts commit 7a3f89716a5ea3fc00e69342f8c9c7de77ca99ce. --- system/database/drivers/postgre/postgre_driver.php | 83 ++++++++++++++-------- system/database/drivers/postgre/postgre_forge.php | 24 ++++--- system/database/drivers/postgre/postgre_result.php | 25 ++++--- .../database/drivers/postgre/postgre_utility.php | 4 +- 4 files changed, 86 insertions(+), 50 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 6ef83726a..fad9539ff 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -42,28 +42,29 @@ */ class CI_DB_postgre_driver extends CI_DB { - public $dbdriver = 'postgre'; + var $dbdriver = 'postgre'; - protected $_escape_char = '"'; + var $_escape_char = '"'; // clause and character used for LIKE escape sequences - protected $_like_escape_str = " ESCAPE '%s' "; - protected $_like_escape_chr = '!'; + var $_like_escape_str = " ESCAPE '%s' "; + 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() functions. */ - protected $_count_string = "SELECT COUNT(*) AS "; - protected $_random_keyword = ' RANDOM()'; // database specific random keyword + var $_count_string = "SELECT COUNT(*) AS "; + var $_random_keyword = ' RANDOM()'; // database specific random keyword /** * Connection String * + * @access private * @return string */ - protected function _connect_string() + function _connect_string() { $components = array( 'hostname' => 'host', @@ -89,9 +90,10 @@ class CI_DB_postgre_driver extends CI_DB { /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect() + function db_connect() { return @pg_connect($this->_connect_string()); } @@ -101,9 +103,10 @@ class CI_DB_postgre_driver extends CI_DB { /** * Persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { return @pg_pconnect($this->_connect_string()); } @@ -116,9 +119,10 @@ class CI_DB_postgre_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 (pg_ping($this->conn_id) === FALSE) { @@ -131,9 +135,10 @@ class CI_DB_postgre_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 Postgre so we'll return TRUE return TRUE; @@ -186,10 +191,11 @@ class CI_DB_postgre_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return resource */ - protected function _execute($sql) + function _execute($sql) { return @pg_query($this->conn_id, $sql); } @@ -258,11 +264,12 @@ class CI_DB_postgre_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)) { @@ -292,9 +299,10 @@ class CI_DB_postgre_driver extends CI_DB { /** * Affected Rows * + * @access public * @return integer */ - public function affected_rows() + function affected_rows() { return @pg_affected_rows($this->result_id); } @@ -304,9 +312,10 @@ class CI_DB_postgre_driver extends CI_DB { /** * Insert ID * + * @access public * @return integer */ - public function insert_id() + function insert_id() { $v = $this->version(); @@ -346,10 +355,11 @@ class CI_DB_postgre_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 == '') { @@ -374,10 +384,11 @@ class CI_DB_postgre_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) { $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; @@ -396,10 +407,11 @@ class CI_DB_postgre_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 "SELECT column_name FROM information_schema.columns WHERE table_name ='".$table."'"; } @@ -411,10 +423,11 @@ class CI_DB_postgre_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) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -441,10 +454,11 @@ class CI_DB_postgre_driver extends CI_DB { * * 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 == '') { @@ -483,10 +497,11 @@ class CI_DB_postgre_driver extends CI_DB { * 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)) { @@ -503,12 +518,13 @@ class CI_DB_postgre_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -520,12 +536,13 @@ class CI_DB_postgre_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 ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); } @@ -537,6 +554,7 @@ class CI_DB_postgre_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 @@ -544,7 +562,7 @@ class CI_DB_postgre_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) { @@ -567,10 +585,11 @@ class CI_DB_postgre_driver extends CI_DB { * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * + * @access public * @param string the table name * @return string */ - public function _truncate($table) + function _truncate($table) { return "TRUNCATE ".$table; } @@ -582,12 +601,13 @@ class CI_DB_postgre_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 = ''; @@ -612,12 +632,13 @@ class CI_DB_postgre_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) { $sql .= "LIMIT ".$limit; @@ -634,14 +655,18 @@ class CI_DB_postgre_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { @pg_close($conn_id); } + + } + /* End of file postgre_driver.php */ -/* Location: ./system/database/drivers/postgre/postgre_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/postgre/postgre_driver.php */ diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 2aa6ee82a..577100544 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -39,10 +39,11 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Create database * + * @access private * @param string the database name * @return bool */ - protected function _create_database($name) + function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -52,10 +53,11 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -68,7 +70,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - protected function _process_fields($fields, $primary_keys=array()) + function _process_fields($fields, $primary_keys=array()) { $sql = ''; $current_field_count = 0; @@ -175,6 +177,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -182,7 +185,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -238,11 +241,8 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Drop Table - * - * @param string the table name - * @return string */ - protected function _drop_table($table) + function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table)." CASCADE"; } @@ -255,6 +255,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -264,7 +265,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $fields, $after_field = '') + function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -291,15 +292,16 @@ class CI_DB_postgre_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } } /* End of file postgre_forge.php */ -/* Location: ./system/database/drivers/postgre/postgre_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/postgre/postgre_forge.php */ diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index b27afaedb..12d7547c5 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -41,9 +41,10 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Number of rows in the result set * + * @access public * @return integer */ - public function num_rows() + function num_rows() { return @pg_num_rows($this->result_id); } @@ -53,9 +54,10 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Number of fields in the result set * + * @access public * @return integer */ - public function num_fields() + function num_fields() { return @pg_num_fields($this->result_id); } @@ -67,9 +69,10 @@ class CI_DB_postgre_result extends CI_DB_result { * * Generates an array of column names * + * @access public * @return array */ - public function list_fields() + function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -87,9 +90,10 @@ class CI_DB_postgre_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * + * @access public * @return array */ - public function field_data() + function field_data() { $retval = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -114,7 +118,7 @@ class CI_DB_postgre_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { if (is_resource($this->result_id)) { @@ -132,9 +136,10 @@ class CI_DB_postgre_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { return pg_result_seek($this->result_id, $n); } @@ -146,9 +151,10 @@ class CI_DB_postgre_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { return pg_fetch_assoc($this->result_id); } @@ -160,13 +166,16 @@ class CI_DB_postgre_result extends CI_DB_result { * * Returns the result set as an object * + * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { return pg_fetch_object($this->result_id); } + } + /* End of file postgre_result.php */ /* Location: ./system/database/drivers/postgre/postgre_result.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index cf29201ff..e31a6db8f 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -78,7 +78,7 @@ class CI_DB_postgre_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - public function _backup($params = array()) + function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); @@ -86,4 +86,4 @@ class CI_DB_postgre_utility extends CI_DB_utility { } /* End of file postgre_utility.php */ -/* Location: ./system/database/drivers/postgre/postgre_utility.php */ \ No newline at end of file +/* Location: ./system/database/drivers/postgre/postgre_utility.php */ -- 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 +++++++++++++++++----------- system/database/drivers/pdo/pdo_result.php | 25 ++++-- system/database/drivers/pdo/pdo_utility.php | 12 ++- 3 files changed, 98 insertions(+), 63 deletions(-) (limited to 'system/database') 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 */ diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index 330a2e677..384b753da 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -51,9 +51,10 @@ class CI_DB_pdo_result extends CI_DB_result { /** * Number of rows in the result set * + * @access public * @return integer */ - public function num_rows() + function num_rows() { if (empty($this->result_id) OR ! is_object($this->result_id)) { @@ -73,9 +74,10 @@ class CI_DB_pdo_result extends CI_DB_result { /** * Fetch the result handler * + * @access public * @return mixed */ - public function result_assoc() + function result_assoc() { // If the result already fetched before, use that one if (count($this->result_array) > 0 OR $this->is_fetched) @@ -114,9 +116,10 @@ class CI_DB_pdo_result extends CI_DB_result { /** * Number of fields in the result set * + * @access public * @return integer */ - public function num_fields() + function num_fields() { return $this->result_id->columnCount(); } @@ -128,9 +131,10 @@ class CI_DB_pdo_result extends CI_DB_result { * * Generates an array of column names * + * @access public * @return array */ - public function list_fields() + function list_fields() { if ($this->db->db_debug) { @@ -147,9 +151,10 @@ class CI_DB_pdo_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * + * @access public * @return array */ - public function field_data() + function field_data() { $data = array(); @@ -219,7 +224,7 @@ class CI_DB_pdo_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { if (is_object($this->result_id)) { @@ -236,9 +241,10 @@ class CI_DB_pdo_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { return FALSE; } @@ -250,9 +256,10 @@ class CI_DB_pdo_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { return $this->result_id->fetch(PDO::FETCH_ASSOC); } @@ -267,7 +274,7 @@ class CI_DB_pdo_result extends CI_DB_result { * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { return $this->result_id->fetchObject(); } diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php index 2c12d7438..c278c5172 100644 --- a/system/database/drivers/pdo/pdo_utility.php +++ b/system/database/drivers/pdo/pdo_utility.php @@ -39,9 +39,10 @@ class CI_DB_pdo_utility extends CI_DB_utility { /** * List databases * + * @access private * @return bool */ - protected function _list_databases() + function _list_databases() { // Not sure if PDO lets you list all databases... if ($this->db->db_debug) @@ -58,10 +59,11 @@ class CI_DB_pdo_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * + * @access private * @param string the table name * @return object */ - protected function _optimize_table($table) + function _optimize_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -78,10 +80,11 @@ class CI_DB_pdo_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * + * @access private * @param string the table name * @return object */ - protected function _repair_table($table) + function _repair_table($table) { // Not a supported PDO feature if ($this->db->db_debug) @@ -96,10 +99,11 @@ class CI_DB_pdo_utility extends CI_DB_utility { /** * PDO Export * + * @access private * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 9e560a4c4828901a562f5459157ba0f76612c34f Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:06:46 -0400 Subject: Revert "ODBC access modifiers" This reverts commit 142ca8e565b722b758b5ef88c888891d04da8700. --- system/database/drivers/odbc/odbc_driver.php | 96 ++++++++++++++++----------- system/database/drivers/odbc/odbc_forge.php | 20 ++++-- system/database/drivers/odbc/odbc_result.php | 19 ++++-- system/database/drivers/odbc/odbc_utility.php | 12 ++-- 4 files changed, 92 insertions(+), 55 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 78acd2ce9..58da07818 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -48,35 +48,32 @@ class CI_DB_odbc_driver extends CI_DB { var $_escape_char = ''; // clause and character used for LIKE escape sequences - protected $_like_escape_str = " {escape '%s'} "; - protected $_like_escape_chr = '!'; + var $_like_escape_str = " {escape '%s'} "; + 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; - /** - * Constructor, to define random keyword - */ - public function __construct($params) + + function __construct($params) { parent::__construct($params); $this->_random_keyword = ' RND('.time().')'; // database specific random keyword } - - // -------------------------------------------------------------------------- /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect() + function db_connect() { return @odbc_connect($this->hostname, $this->username, $this->password); } @@ -86,9 +83,10 @@ class CI_DB_odbc_driver extends CI_DB { /** * Persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { return @odbc_pconnect($this->hostname, $this->username, $this->password); } @@ -101,9 +99,10 @@ class CI_DB_odbc_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() { // not implemented in odbc } @@ -113,9 +112,10 @@ class CI_DB_odbc_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 ODBC return TRUE; @@ -126,10 +126,11 @@ class CI_DB_odbc_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return resource */ - protected function _execute($sql) + function _execute($sql) { return @odbc_exec($this->conn_id, $sql); } @@ -139,9 +140,10 @@ class CI_DB_odbc_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) { @@ -167,9 +169,10 @@ class CI_DB_odbc_driver extends CI_DB { /** * Commit Transaction * + * @access public * @return bool */ - public function trans_commit() + function trans_commit() { if ( ! $this->trans_enabled) { @@ -192,9 +195,10 @@ class CI_DB_odbc_driver extends CI_DB { /** * Rollback Transaction * + * @access public * @return bool */ - public function trans_rollback() + function trans_rollback() { if ( ! $this->trans_enabled) { @@ -217,11 +221,12 @@ class CI_DB_odbc_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)) { @@ -252,9 +257,10 @@ class CI_DB_odbc_driver extends CI_DB { /** * Affected Rows * + * @access public * @return integer */ - public function affected_rows() + function affected_rows() { return @odbc_num_rows($this->conn_id); } @@ -279,10 +285,11 @@ class CI_DB_odbc_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 == '') { @@ -308,10 +315,11 @@ class CI_DB_odbc_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) { $sql = "SHOW TABLES FROM `".$this->database."`"; @@ -331,10 +339,11 @@ class CI_DB_odbc_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 ".$table; } @@ -346,10 +355,11 @@ class CI_DB_odbc_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) { return "SELECT TOP 1 FROM ".$table; } @@ -374,12 +384,13 @@ class CI_DB_odbc_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 == '') { @@ -415,13 +426,14 @@ class CI_DB_odbc_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)) { @@ -438,12 +450,13 @@ class CI_DB_odbc_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -455,6 +468,7 @@ class CI_DB_odbc_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 @@ -462,7 +476,7 @@ class CI_DB_odbc_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) { @@ -490,12 +504,13 @@ class CI_DB_odbc_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); } @@ -507,12 +522,13 @@ class CI_DB_odbc_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 = ''; @@ -540,12 +556,13 @@ class CI_DB_odbc_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) { // Does ODBC doesn't use the LIMIT clause? return $sql; @@ -556,14 +573,19 @@ class CI_DB_odbc_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { @odbc_close($conn_id); } + + } + + /* End of file odbc_driver.php */ -/* Location: ./system/database/drivers/odbc/odbc_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/odbc/odbc_driver.php */ diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index 121c09606..acc2cadee 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -39,10 +39,11 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Create database * + * @access private * @param string the database name * @return bool */ - protected function _create_database() + function _create_database() { // ODBC has no "create database" command since it's // designed to connect to an existing database @@ -58,10 +59,11 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { // ODBC has no "drop database" command since it's // designed to connect to an existing database @@ -77,6 +79,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -84,7 +87,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -183,9 +186,10 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Drop Table * + * @access private * @return bool */ - protected function _drop_table($table) + function _drop_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -203,6 +207,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -212,7 +217,7 @@ class CI_DB_odbc_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -255,11 +260,12 @@ class CI_DB_odbc_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -267,4 +273,4 @@ class CI_DB_odbc_forge extends CI_DB_forge { } /* End of file odbc_forge.php */ -/* Location: ./system/database/drivers/odbc/odbc_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/odbc/odbc_forge.php */ diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 0b74871e0..d19fa247e 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -130,7 +130,7 @@ class CI_DB_odbc_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { if (is_resource($this->result_id)) { @@ -148,9 +148,10 @@ class CI_DB_odbc_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { return FALSE; } @@ -162,9 +163,10 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { if (function_exists('odbc_fetch_object')) { @@ -183,9 +185,10 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an object * + * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { if (function_exists('odbc_fetch_object')) { @@ -204,9 +207,10 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_object function when * not available (odbc_fetch_object requires unixODBC) * + * @access private * @return object */ - protected function _odbc_fetch_object(& $odbc_result) { + function _odbc_fetch_object(& $odbc_result) { $rs = array(); $rs_obj = FALSE; if (odbc_fetch_into($odbc_result, $rs)) { @@ -225,9 +229,10 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_array function when * not available (odbc_fetch_array requires unixODBC) * + * @access private * @return array */ - protected function _odbc_fetch_array(& $odbc_result) { + function _odbc_fetch_array(& $odbc_result) { $rs = array(); $rs_assoc = FALSE; if (odbc_fetch_into($odbc_result, $rs)) { @@ -313,4 +318,4 @@ class CI_DB_odbc_result extends CI_DB_result { } /* End of file odbc_result.php */ -/* Location: ./system/database/drivers/odbc/odbc_result.php */ \ No newline at end of file +/* Location: ./system/database/drivers/odbc/odbc_result.php */ diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index d663da1ad..c146c1785 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -39,9 +39,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { /** * List databases * + * @access private * @return bool */ - protected function _list_databases() + function _list_databases() { // Not sure if ODBC lets you list all databases... if ($this->db->db_debug) @@ -58,10 +59,11 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * + * @access private * @param string the table name * @return object */ - protected function _optimize_table($table) + function _optimize_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -78,10 +80,11 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * + * @access private * @param string the table name * @return object */ - protected function _repair_table($table) + function _repair_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -96,10 +99,11 @@ class CI_DB_odbc_utility extends CI_DB_utility { /** * ODBC Export * + * @access private * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 48e1d2e78efea9f41e5ae65b600d35bb87b2e40f Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:07:07 -0400 Subject: Revert "Oci8 access modifiers" This reverts commit 9f86f5cddea54e7fedf4be89d1d1cc90d1564488. --- system/database/drivers/oci8/oci8_driver.php | 26 ++++++++++++++------------ system/database/drivers/oci8/oci8_forge.php | 17 +++++++++++------ system/database/drivers/oci8/oci8_result.php | 3 ++- system/database/drivers/oci8/oci8_utility.php | 12 ++++++++---- 4 files changed, 35 insertions(+), 23 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index e7b744bd3..8d7040618 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -53,33 +53,33 @@ class CI_DB_oci8_driver extends CI_DB { - public $dbdriver = 'oci8'; + var $dbdriver = 'oci8'; // The character used for excaping - public $_escape_char = '"'; + var $_escape_char = '"'; // clause and character used for LIKE escape sequences - public $_like_escape_str = " escape '%s' "; - public $_like_escape_chr = '!'; + var $_like_escape_str = " escape '%s' "; + 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() functions. */ - public $_count_string = "SELECT COUNT(1) AS "; - public $_random_keyword = ' ASC'; // not currently supported + var $_count_string = "SELECT COUNT(1) AS "; + var $_random_keyword = ' ASC'; // not currently supported // Set "auto commit" by default - public $_commit = OCI_COMMIT_ON_SUCCESS; + var $_commit = OCI_COMMIT_ON_SUCCESS; // need to track statement id and cursor id - public $stmt_id; - public $curs_id; + var $stmt_id; + var $curs_id; // if we use a limit, we will add a field that will // throw off num_fields later - public $limit_used; + var $limit_used; /** * Non-persistent database connection @@ -214,7 +214,7 @@ class CI_DB_oci8_driver extends CI_DB { * KEY OPTIONAL NOTES * name no the name of the parameter should be in : format * value no the value of the parameter. If this is an OUT or IN OUT parameter, - * this should be a reference to a publiciable + * this should be a reference to a variable * type yes the type of the parameter * length yes the max size of the parameter */ @@ -781,5 +781,7 @@ class CI_DB_oci8_driver extends CI_DB { } + + /* End of file oci8_driver.php */ -/* Location: ./system/database/drivers/oci8/oci8_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/oci8/oci8_driver.php */ diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index f9a90ff0a..7fcc8094d 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -39,10 +39,11 @@ class CI_DB_oci8_forge extends CI_DB_forge { /** * Create database * + * @access public * @param string the database name * @return bool */ - public function _create_database($name) + function _create_database($name) { return FALSE; } @@ -52,10 +53,11 @@ class CI_DB_oci8_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { return FALSE; } @@ -142,9 +144,10 @@ class CI_DB_oci8_forge extends CI_DB_forge { /** * Drop Table * + * @access private * @return bool */ - protected function _drop_table($table) + function _drop_table($table) { return FALSE; } @@ -157,6 +160,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -166,7 +170,7 @@ class CI_DB_oci8_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -208,11 +212,12 @@ class CI_DB_oci8_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } @@ -220,4 +225,4 @@ class CI_DB_oci8_forge extends CI_DB_forge { } /* End of file oci8_forge.php */ -/* Location: ./system/database/drivers/oci8/oci8_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/oci8/oci8_forge.php */ diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index a14e32eec..6f1b8b4c1 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -235,5 +235,6 @@ class CI_DB_oci8_result extends CI_DB_result { } + /* End of file oci8_result.php */ -/* Location: ./system/database/drivers/oci8/oci8_result.php */ \ No newline at end of file +/* Location: ./system/database/drivers/oci8/oci8_result.php */ diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index f4863c0db..62dfb2f3c 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -39,9 +39,10 @@ class CI_DB_oci8_utility extends CI_DB_utility { /** * List databases * + * @access private * @return bool */ - protected function _list_databases() + function _list_databases() { return FALSE; } @@ -53,10 +54,11 @@ class CI_DB_oci8_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * + * @access private * @param string the table name * @return object */ - protected function _optimize_table($table) + function _optimize_table($table) { return FALSE; // Is this supported in Oracle? } @@ -68,10 +70,11 @@ class CI_DB_oci8_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * + * @access private * @param string the table name * @return object */ - protected function _repair_table($table) + function _repair_table($table) { return FALSE; // Is this supported in Oracle? } @@ -81,10 +84,11 @@ class CI_DB_oci8_utility extends CI_DB_utility { /** * Oracle Export * + * @access private * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 8c1b2dc39d104774b3a7be87dc41f2b702bb883c Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:07:18 -0400 Subject: Revert "Added access modifiers for MSSQL driver" This reverts commit ba1ebbefa9c5d225fa28c76dac276e6120263a25. --- system/database/drivers/mssql/mssql_driver.php | 81 ++++++++++++++++--------- system/database/drivers/mssql/mssql_forge.php | 20 +++--- system/database/drivers/mssql/mssql_result.php | 24 +++++--- system/database/drivers/mssql/mssql_utility.php | 12 ++-- 4 files changed, 90 insertions(+), 47 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index 9448f052c..a93ac57fe 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -62,9 +62,10 @@ class CI_DB_mssql_driver extends CI_DB { /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect() + function db_connect() { if ($this->port != '') { @@ -79,9 +80,10 @@ class CI_DB_mssql_driver extends CI_DB { /** * Persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { if ($this->port != '') { @@ -99,9 +101,10 @@ class CI_DB_mssql_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() { // not implemented in MSSQL } @@ -137,10 +140,11 @@ class CI_DB_mssql_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return resource */ - protected function _execute($sql) + function _execute($sql) { return @mssql_query($sql, $this->conn_id); } @@ -150,9 +154,10 @@ class CI_DB_mssql_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) { @@ -179,9 +184,10 @@ class CI_DB_mssql_driver extends CI_DB { /** * Commit Transaction * + * @access public * @return bool */ - public function trans_commit() + function trans_commit() { if ( ! $this->trans_enabled) { @@ -203,9 +209,10 @@ class CI_DB_mssql_driver extends CI_DB { /** * Rollback Transaction * + * @access public * @return bool */ - public function trans_rollback() + function trans_rollback() { if ( ! $this->trans_enabled) { @@ -227,11 +234,12 @@ class CI_DB_mssql_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)) { @@ -264,9 +272,10 @@ class CI_DB_mssql_driver extends CI_DB { /** * Affected Rows * + * @access public * @return integer */ - public function affected_rows() + function affected_rows() { return @mssql_rows_affected($this->conn_id); } @@ -278,9 +287,10 @@ class CI_DB_mssql_driver extends CI_DB { * * Returns the last id created in the Identity column. * + * @access public * @return integer */ - public function insert_id() + function insert_id() { $ver = self::_parse_major_version($this->version()); $sql = ($ver >= 8 ? "SELECT SCOPE_IDENTITY() AS last_id" : "SELECT @@IDENTITY AS last_id"); @@ -297,10 +307,11 @@ class CI_DB_mssql_driver extends CI_DB { * Grabs the major version number from the * database server version string passed in. * + * @access private * @param string $version * @return int16 major version number */ - protected function _parse_major_version($version) + function _parse_major_version($version) { preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $version, $ver_info); return $ver_info[1]; // return the major version b/c that's all we're interested in. @@ -313,7 +324,7 @@ class CI_DB_mssql_driver extends CI_DB { * * @return string */ - protected public function _version() + protected function _version() { return 'SELECT @@VERSION AS ver'; } @@ -326,10 +337,11 @@ class CI_DB_mssql_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 == '') { @@ -354,10 +366,11 @@ class CI_DB_mssql_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) { $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; @@ -378,10 +391,11 @@ class CI_DB_mssql_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * + * @access private * @param string the table name * @return string */ - protected function _list_columns($table = '') + function _list_columns($table = '') { return "SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$table."'"; } @@ -393,10 +407,11 @@ class CI_DB_mssql_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) { return "SELECT TOP 1 * FROM ".$table; } @@ -423,12 +438,13 @@ class CI_DB_mssql_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 == '') { @@ -464,13 +480,14 @@ class CI_DB_mssql_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)) { @@ -487,12 +504,13 @@ class CI_DB_mssql_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 ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -504,6 +522,7 @@ class CI_DB_mssql_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 @@ -511,7 +530,7 @@ class CI_DB_mssql_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) { @@ -539,12 +558,13 @@ class CI_DB_mssql_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 "TRUNCATE ".$table; } @@ -556,12 +576,13 @@ class CI_DB_mssql_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 = ''; @@ -589,12 +610,13 @@ class CI_DB_mssql_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) { $i = $limit + $offset; @@ -606,15 +628,18 @@ class CI_DB_mssql_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { @mssql_close($conn_id); } } + + /* End of file mssql_driver.php */ -/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file +/* Location: ./system/database/drivers/mssql/mssql_driver.php */ diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index 500dd9845..4a8089bb1 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -39,10 +39,11 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Create database * + * @access private * @param string the database name * @return bool */ - protected function _create_database($name) + function _create_database($name) { return "CREATE DATABASE ".$name; } @@ -52,10 +53,11 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { return "DROP DATABASE ".$name; } @@ -65,9 +67,10 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Drop Table * + * @access private * @return bool */ - protected function _drop_table($table) + function _drop_table($table) { return "DROP TABLE ".$this->db->_escape_identifiers($table); } @@ -77,6 +80,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) @@ -84,7 +88,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -186,6 +190,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -195,7 +200,7 @@ class CI_DB_mssql_forge extends CI_DB_forge { * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -237,11 +242,12 @@ class CI_DB_mssql_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { // I think this syntax will work, but can find little documentation on renaming tables in MSSQL return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); @@ -250,4 +256,4 @@ class CI_DB_mssql_forge extends CI_DB_forge { } /* End of file mssql_forge.php */ -/* Location: ./system/database/drivers/mssql/mssql_forge.php */ \ No newline at end of file +/* Location: ./system/database/drivers/mssql/mssql_forge.php */ diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index ff899406c..b205ce2d1 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -41,9 +41,10 @@ class CI_DB_mssql_result extends CI_DB_result { /** * Number of rows in the result set * + * @access public * @return integer */ - public function num_rows() + function num_rows() { return @mssql_num_rows($this->result_id); } @@ -53,9 +54,10 @@ class CI_DB_mssql_result extends CI_DB_result { /** * Number of fields in the result set * + * @access public * @return integer */ - public function num_fields() + function num_fields() { return @mssql_num_fields($this->result_id); } @@ -67,9 +69,10 @@ class CI_DB_mssql_result extends CI_DB_result { * * Generates an array of column names * + * @access public * @return array */ - public function list_fields() + function list_fields() { $field_names = array(); while ($field = mssql_fetch_field($this->result_id)) @@ -87,9 +90,10 @@ class CI_DB_mssql_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * + * @access public * @return array */ - public function field_data() + function field_data() { $retval = array(); while ($field = mssql_fetch_field($this->result_id)) @@ -114,7 +118,7 @@ class CI_DB_mssql_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { if (is_resource($this->result_id)) { @@ -132,9 +136,10 @@ class CI_DB_mssql_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { return mssql_data_seek($this->result_id, $n); } @@ -146,9 +151,10 @@ class CI_DB_mssql_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { return mssql_fetch_assoc($this->result_id); } @@ -160,14 +166,16 @@ class CI_DB_mssql_result extends CI_DB_result { * * Returns the result set as an object * + * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { return mssql_fetch_object($this->result_id); } } + /* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index e64874132..28f34b999 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -39,9 +39,10 @@ class CI_DB_mssql_utility extends CI_DB_utility { /** * List databases * + * @access private * @return bool */ - protected function _list_databases() + function _list_databases() { return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases } @@ -53,10 +54,11 @@ class CI_DB_mssql_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * + * @access private * @param string the table name * @return object */ - protected function _optimize_table($table) + function _optimize_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -68,10 +70,11 @@ class CI_DB_mssql_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * + * @access private * @param string the table name * @return object */ - protected function _repair_table($table) + function _repair_table($table) { return FALSE; // Is this supported in MS SQL? } @@ -81,10 +84,11 @@ class CI_DB_mssql_utility extends CI_DB_utility { /** * MSSQL Export * + * @access private * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); -- cgit v1.2.3-24-g4f1b From 0c2747151f0cd32b6188ecd8c1dcdcdb6fe44792 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:08:29 -0400 Subject: Revert "Added access modifiers to the rest of the Cubrid classes" This reverts commit f83f0d5448aadcf76fbdac363d0fe7ea811ca9bf. --- system/database/drivers/cubrid/cubrid_forge.php | 21 ++++++++++++++------- system/database/drivers/cubrid/cubrid_result.php | 23 +++++++++++++++-------- system/database/drivers/cubrid/cubrid_utility.php | 8 ++++---- 3 files changed, 33 insertions(+), 19 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 6bfc7c28f..7d606ea36 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -39,10 +39,11 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Create database * + * @access private * @param string the database name * @return bool */ - protected function _create_database($name) + function _create_database($name) { // CUBRID does not allow to create a database in SQL. The GUI tools // have to be used for this purpose. @@ -54,10 +55,11 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Drop database * + * @access private * @param string the database name * @return bool */ - protected function _drop_database($name) + function _drop_database($name) { // CUBRID does not allow to drop a database in SQL. The GUI tools // have to be used for this purpose. @@ -69,10 +71,11 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Process Fields * + * @access private * @param mixed the fields * @return string */ - protected function _process_fields($fields) + function _process_fields($fields) { $current_field_count = 0; $sql = ''; @@ -169,6 +172,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Create Table * + * @access private * @param string the table name * @param mixed the fields * @param mixed primary key(s) @@ -176,7 +180,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * @param boolean should 'IF NOT EXISTS' be added to the SQL * @return bool */ - protected function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -228,9 +232,10 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Drop Table * + * @access private * @return string */ - protected function _drop_table($table) + function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); } @@ -243,13 +248,14 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * + * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param array fields * @param string the field after which we should add the new field * @return object */ - protected function _alter_table($alter_type, $table, $fields, $after_field = '') + function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -276,11 +282,12 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * + * @access private * @param string the old table name * @param string the new table name * @return string */ - protected function _rename_table($table_name, $new_table_name) + function _rename_table($table_name, $new_table_name) { return 'RENAME TABLE '.$this->db->protect_identifiers($table_name).' AS '.$this->db->protect_identifiers($new_table_name); } diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php index c7a7632aa..a7eeb8a39 100644 --- a/system/database/drivers/cubrid/cubrid_result.php +++ b/system/database/drivers/cubrid/cubrid_result.php @@ -41,9 +41,10 @@ class CI_DB_cubrid_result extends CI_DB_result { /** * Number of rows in the result set * + * @access public * @return integer */ - public function num_rows() + function num_rows() { return @cubrid_num_rows($this->result_id); } @@ -53,9 +54,10 @@ class CI_DB_cubrid_result extends CI_DB_result { /** * Number of fields in the result set * + * @access public * @return integer */ - public function num_fields() + function num_fields() { return @cubrid_num_fields($this->result_id); } @@ -67,9 +69,10 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Generates an array of column names * + * @access public * @return array */ - public function list_fields() + function list_fields() { return cubrid_column_names($this->result_id); } @@ -81,9 +84,10 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * + * @access public * @return array */ - public function field_data() + function field_data() { $retval = array(); @@ -145,7 +149,7 @@ class CI_DB_cubrid_result extends CI_DB_result { * * @return null */ - public function free_result() + function free_result() { if(is_resource($this->result_id) || get_resource_type($this->result_id) == "Unknown" && @@ -165,9 +169,10 @@ class CI_DB_cubrid_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * + * @access private * @return array */ - protected function _data_seek($n = 0) + function _data_seek($n = 0) { return cubrid_data_seek($this->result_id, $n); } @@ -179,9 +184,10 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Returns the result set as an array * + * @access private * @return array */ - protected function _fetch_assoc() + function _fetch_assoc() { return cubrid_fetch_assoc($this->result_id); } @@ -193,9 +199,10 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Returns the result set as an object * + * @access private * @return object */ - protected function _fetch_object() + function _fetch_object() { return cubrid_fetch_object($this->result_id); } diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index de28e6335..a13c0a5e4 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -42,7 +42,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @access private * @return array */ - protected function _list_databases() + function _list_databases() { // CUBRID does not allow to see the list of all databases on the // server. It is the way its architecture is designed. Every @@ -71,7 +71,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Optimize%20Database */ - protected function _optimize_table($table) + function _optimize_table($table) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table optimization can be performed using CUBRID Manager @@ -91,7 +91,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @return object * @link http://www.cubrid.org/manual/840/en/Checking%20Database%20Consistency */ - protected function _repair_table($table) + function _repair_table($table) { // Not supported in CUBRID as of version 8.4.0. Database or // table consistency can be checked using CUBRID Manager @@ -107,7 +107,7 @@ class CI_DB_cubrid_utility extends CI_DB_utility { * @param array Preferences * @return mixed */ - protected function _backup($params = array()) + function _backup($params = array()) { // No SQL based support in CUBRID as of version 8.4.0. Database or // table backup can be performed using CUBRID Manager -- cgit v1.2.3-24-g4f1b From 175e289d092578952f134f7cad549bcc5e3efa17 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 19 Mar 2012 19:08:39 -0400 Subject: Revert "Added access modifiers to CUBRID driver" This reverts commit 70b21018b4941414c0041900f26c637763e19cfe. --- system/database/drivers/cubrid/cubrid_driver.php | 87 +++++++++++++++--------- 1 file changed, 56 insertions(+), 31 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index cc9f23d9e..32bd8a8b2 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -66,9 +66,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Non-persistent database connection * + * @access private called by the base class * @return resource */ - protected function db_connect() + function db_connect() { // If no port is defined by the user, use the default value if ($this->port == '') @@ -105,12 +106,13 @@ class CI_DB_cubrid_driver extends CI_DB { * file by setting the CCI_PCONNECT parameter to ON. In that case, all * connections established between the client application and the * server will become persistent. This is calling the same - * @cubrid_connect public function will establish persisten connection + * @cubrid_connect function will establish persisten connection * considering that the CCI_PCONNECT is ON. * + * @access private called by the base class * @return resource */ - protected function db_pconnect() + function db_pconnect() { return $this->db_connect(); } @@ -123,9 +125,10 @@ class CI_DB_cubrid_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 (cubrid_ping($this->conn_id) === FALSE) { @@ -138,9 +141,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Select the database * + * @access private called by the base class * @return resource */ - public function db_select() + function db_select() { // In CUBRID there is no need to select a database as the database // is chosen at the connection time. @@ -168,10 +172,11 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Execute the query * + * @access private called by the base class * @param string an SQL query * @return resource */ - protected function _execute($sql) + function _execute($sql) { return @cubrid_query($sql, $this->conn_id); } @@ -181,9 +186,10 @@ class CI_DB_cubrid_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) { @@ -214,9 +220,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Commit Transaction * + * @access public * @return bool */ - public function trans_commit() + function trans_commit() { if ( ! $this->trans_enabled) { @@ -244,9 +251,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Rollback Transaction * + * @access public * @return bool */ - public function trans_rollback() + function trans_rollback() { if ( ! $this->trans_enabled) { @@ -274,11 +282,12 @@ class CI_DB_cubrid_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)) { @@ -315,7 +324,7 @@ class CI_DB_cubrid_driver extends CI_DB { * * @return int */ - public public function affected_rows() + public function affected_rows() { return @cubrid_affected_rows(); } @@ -325,9 +334,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Insert ID * + * @access public * @return integer */ - public function insert_id() + function insert_id() { return @cubrid_insert_id($this->conn_id); } @@ -340,10 +350,11 @@ class CI_DB_cubrid_driver extends CI_DB { * Generates a platform-specific query string that counts all records in * the specified table * + * @access public * @param string * @return string */ - public function count_all($table = '') + function count_all($table = '') { if ($table == '') { @@ -368,10 +379,11 @@ class CI_DB_cubrid_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) { $sql = "SHOW TABLES"; @@ -390,10 +402,11 @@ class CI_DB_cubrid_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->protect_identifiers($table, TRUE, NULL, FALSE); } @@ -405,10 +418,11 @@ class CI_DB_cubrid_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) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -423,7 +437,7 @@ class CI_DB_cubrid_driver extends CI_DB { * * @return array */ - public public function error() + public function error() { return array('code' => cubrid_errno($this->conn_id), 'message' => cubrid_error($this->conn_id)); } @@ -431,12 +445,13 @@ class CI_DB_cubrid_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 == '') { @@ -472,13 +487,14 @@ class CI_DB_cubrid_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)) { @@ -495,12 +511,13 @@ class CI_DB_cubrid_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 ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } @@ -513,12 +530,13 @@ class CI_DB_cubrid_driver extends CI_DB { * * Generates a platform-specific replace 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 _replace($table, $keys, $values) + function _replace($table, $keys, $values) { return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } @@ -530,12 +548,13 @@ class CI_DB_cubrid_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 ".$table." (\"".implode('", "', $keys)."\") VALUES ".implode(', ', $values); } @@ -548,6 +567,7 @@ class CI_DB_cubrid_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 @@ -555,7 +575,7 @@ class CI_DB_cubrid_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) { @@ -583,12 +603,13 @@ class CI_DB_cubrid_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 != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; @@ -635,12 +656,13 @@ class CI_DB_cubrid_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 "TRUNCATE ".$table; } @@ -652,12 +674,13 @@ class CI_DB_cubrid_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 = ''; @@ -685,12 +708,13 @@ class CI_DB_cubrid_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 ($offset == 0) { @@ -709,10 +733,11 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Close DB Connection * + * @access public * @param resource * @return void */ - public function _close($conn_id) + function _close($conn_id) { @cubrid_close($conn_id); } -- cgit v1.2.3-24-g4f1b From 738497c1dbfbc9558af0c5637e4715aefeb100da Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:12:25 +0200 Subject: Visibility declarations and cleanup for CI_DB_postgre_driver --- system/database/drivers/postgre/postgre_driver.php | 105 ++++++++------------- 1 file changed, 39 insertions(+), 66 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 5d22af2e6..1114e4cb2 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -1,13 +1,13 @@ - 'host', @@ -90,10 +87,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Non-persistent database connection * - * @access private called by the base class * @return resource */ - function db_connect() + public function db_connect() { return @pg_connect($this->_connect_string()); } @@ -103,10 +99,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + public function db_pconnect() { return @pg_pconnect($this->_connect_string()); } @@ -119,10 +114,9 @@ class CI_DB_postgre_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 (pg_ping($this->conn_id) === FALSE) { @@ -135,10 +129,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Select the database * - * @access private called by the base class * @return resource */ - function db_select() + public function db_select() { // Not needed for Postgre so we'll return TRUE return TRUE; @@ -191,11 +184,10 @@ class CI_DB_postgre_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { $sql = $this->_prep_query($sql); return @pg_query($this->conn_id, $sql); @@ -208,11 +200,10 @@ class CI_DB_postgre_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) { return $sql; } @@ -281,12 +272,11 @@ class CI_DB_postgre_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)) { @@ -316,10 +306,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Affected Rows * - * @access public - * @return integer + * @return int */ - function affected_rows() + public function affected_rows() { return @pg_affected_rows($this->result_id); } @@ -329,10 +318,9 @@ class CI_DB_postgre_driver extends CI_DB { /** * Insert ID * - * @access public - * @return integer + * @return string */ - function insert_id() + public function insert_id() { $v = $this->version(); @@ -372,11 +360,10 @@ class CI_DB_postgre_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 == '') { @@ -401,11 +388,10 @@ class CI_DB_postgre_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @access private - * @param boolean + * @param bool * @return string */ - function _list_tables($prefix_limit = FALSE) + protected function _list_tables($prefix_limit = FALSE) { $sql = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"; @@ -424,11 +410,10 @@ class CI_DB_postgre_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 = '') + protected function _list_columns($table = '') { return "SELECT column_name FROM information_schema.columns WHERE table_name ='".$table."'"; } @@ -440,11 +425,10 @@ class CI_DB_postgre_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) + protected function _field_data($table) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -471,11 +455,10 @@ class CI_DB_postgre_driver extends CI_DB { * * This function escapes column and table names * - * @access private * @param string * @return string */ - function _escape_identifiers($item) + public function _escape_identifiers($item) { if ($this->_escape_char == '') { @@ -514,11 +497,10 @@ class CI_DB_postgre_driver extends CI_DB { * 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 + * @param array + * @return string */ - function _from_tables($tables) + protected function _from_tables($tables) { if ( ! is_array($tables)) { @@ -535,13 +517,12 @@ class CI_DB_postgre_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) + protected function _insert($table, $keys, $values) { return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -553,13 +534,12 @@ class CI_DB_postgre_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) + protected function _insert_batch($table, $keys, $values) { return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES ".implode(', ', $values); } @@ -571,7 +551,6 @@ class CI_DB_postgre_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 @@ -579,7 +558,7 @@ class CI_DB_postgre_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { @@ -602,11 +581,10 @@ class CI_DB_postgre_driver extends CI_DB { * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * - * @access public * @param string the table name * @return string */ - function _truncate($table) + protected function _truncate($table) { return "TRUNCATE ".$table; } @@ -618,13 +596,12 @@ class CI_DB_postgre_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) + protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) { $conditions = ''; @@ -649,13 +626,12 @@ class CI_DB_postgre_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 + * @param int the number of rows to limit the query to + * @param int the offset value * @return string */ - function _limit($sql, $limit, $offset) + protected function _limit($sql, $limit, $offset) { $sql .= "LIMIT ".$limit; @@ -672,18 +648,15 @@ class CI_DB_postgre_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + protected function _close($conn_id) { @pg_close($conn_id); } - } - /* End of file postgre_driver.php */ /* Location: ./system/database/drivers/postgre/postgre_driver.php */ -- cgit v1.2.3-24-g4f1b From bde70bdd693bb0c56ad7a3b9144f88c1a84a4dfd Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:15:12 +0200 Subject: Visibility declarations and cleanup for CI_DB_postgre_forge --- system/database/drivers/postgre/postgre_forge.php | 39 ++++++++++------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 577100544..2a8fdd676 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -1,13 +1,13 @@ -$attributes) + foreach ($fields as $field => $attributes) { // Numeric field names aren't allowed in databases, so if the key is // numeric, we know it was assigned by PHP and the developer manually @@ -168,7 +164,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { $sql .= ','; } } - + return $sql; } @@ -177,15 +173,14 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param array the fields * @param mixed primary key(s) * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @param bool should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -241,8 +236,10 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Drop Table + * + * @return string */ - function _drop_table($table) + public function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table)." CASCADE"; } @@ -255,7 +252,6 @@ class CI_DB_postgre_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name @@ -263,9 +259,9 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @param string the default value * @param boolean should 'NOT NULL' be added * @param string the field after which we should add the new field - * @return object + * @return string */ - function _alter_table($alter_type, $table, $fields, $after_field = '') + public function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -292,12 +288,11 @@ class CI_DB_postgre_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } -- cgit v1.2.3-24-g4f1b From 02878c248f0fd83a890f9c75c54d9e39cd6be631 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:16:53 +0200 Subject: Visibility declarations and cleanup for CI_DB_postgre_result --- system/database/drivers/postgre/postgre_result.php | 42 +++++++++------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index 12d7547c5..b3eafb8f7 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -1,13 +1,13 @@ -result_id); } @@ -54,10 +51,9 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public - * @return integer + * @return int */ - function num_fields() + public function num_fields() { return @pg_num_fields($this->result_id); } @@ -69,10 +65,9 @@ class CI_DB_postgre_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { $field_names = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -90,10 +85,9 @@ class CI_DB_postgre_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); for ($i = 0; $i < $this->num_fields(); $i++) @@ -116,9 +110,9 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Free the result * - * @return null + * @return void */ - function free_result() + public function free_result() { if (is_resource($this->result_id)) { @@ -132,14 +126,13 @@ class CI_DB_postgre_result extends CI_DB_result { /** * Data Seek * - * Moves the internal pointer to the desired offset. We call + * Moves the internal pointer to the desired offset. We call * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return pg_result_seek($this->result_id, $n); } @@ -151,10 +144,9 @@ class CI_DB_postgre_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return pg_fetch_assoc($this->result_id); } @@ -166,16 +158,14 @@ class CI_DB_postgre_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return pg_fetch_object($this->result_id); } } - /* End of file postgre_result.php */ -/* Location: ./system/database/drivers/postgre/postgre_result.php */ \ No newline at end of file +/* Location: ./system/database/drivers/postgre/postgre_result.php */ -- cgit v1.2.3-24-g4f1b From 55201acd0692f02eb5927f412db73b925b6ba738 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:20:39 +0200 Subject: Fixed an issue with PostgreSQL's escape_str() --- system/database/drivers/postgre/postgre_driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 1114e4cb2..8112cf9de 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -293,9 +293,9 @@ class CI_DB_postgre_driver extends CI_DB { // escape LIKE condition wildcards if ($like === TRUE) { - $str = str_replace( array('%', '_', $this->_like_escape_chr), - array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), - $str); + return str_replace(array($this->_like_escape_chr, '%', '_'), + array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), + $str); } return $str; -- cgit v1.2.3-24-g4f1b From 5f356bfa899ac953e987b4de67c954a779e8d3c9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:32:27 +0200 Subject: Visibility declarations and cleanup for CI_DB_odbc_driver --- system/database/drivers/odbc/odbc_driver.php | 108 ++++++++++----------------- 1 file changed, 40 insertions(+), 68 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index acc2838e3..b70713ce9 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -1,13 +1,13 @@ -hostname, $this->username, $this->password); } @@ -83,10 +80,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Persistent database connection * - * @access private called by the base class * @return resource */ - function db_pconnect() + public function db_pconnect() { return @odbc_pconnect($this->hostname, $this->username, $this->password); } @@ -99,10 +95,9 @@ class CI_DB_odbc_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() { // not implemented in odbc } @@ -112,10 +107,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Select the database * - * @access private called by the base class * @return resource */ - function db_select() + public function db_select() { // Not needed for ODBC return TRUE; @@ -126,11 +120,10 @@ class CI_DB_odbc_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { $sql = $this->_prep_query($sql); return @odbc_exec($this->conn_id, $sql); @@ -143,11 +136,10 @@ class CI_DB_odbc_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) { return $sql; } @@ -157,10 +149,9 @@ class CI_DB_odbc_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) { @@ -186,10 +177,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -212,10 +202,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -238,12 +227,11 @@ class CI_DB_odbc_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)) { @@ -274,10 +262,9 @@ class CI_DB_odbc_driver extends CI_DB { /** * Affected Rows * - * @access public - * @return integer + * @return int */ - function affected_rows() + public function affected_rows() { return @odbc_num_rows($this->conn_id); } @@ -302,11 +289,10 @@ class CI_DB_odbc_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 == '') { @@ -332,11 +318,10 @@ class CI_DB_odbc_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @access private - * @param boolean + * @param bool * @return string */ - function _list_tables($prefix_limit = FALSE) + protected function _list_tables($prefix_limit = FALSE) { $sql = "SHOW TABLES FROM `".$this->database."`"; @@ -356,11 +341,10 @@ class CI_DB_odbc_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 = '') + protected function _list_columns($table = '') { return "SHOW COLUMNS FROM ".$table; } @@ -372,11 +356,10 @@ class CI_DB_odbc_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 + * @return string */ - function _field_data($table) + protected function _field_data($table) { return "SELECT TOP 1 FROM ".$table; } @@ -403,11 +386,10 @@ class CI_DB_odbc_driver extends CI_DB { * * This function escapes column and table names * - * @access private * @param string * @return string */ - function _escape_identifiers($item) + public function _escape_identifiers($item) { if ($this->_escape_char == '') { @@ -446,11 +428,10 @@ class CI_DB_odbc_driver extends CI_DB { * 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 + * @param array + * @return string */ - function _from_tables($tables) + protected function _from_tables($tables) { if ( ! is_array($tables)) { @@ -467,13 +448,12 @@ class CI_DB_odbc_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) + protected function _insert($table, $keys, $values) { return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } @@ -485,7 +465,6 @@ class CI_DB_odbc_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 @@ -493,7 +472,7 @@ class CI_DB_odbc_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { @@ -523,11 +502,10 @@ class CI_DB_odbc_driver extends CI_DB { * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * - * @access public * @param string the table name * @return string */ - function _truncate($table) + protected function _truncate($table) { return $this->_delete($table); } @@ -539,13 +517,12 @@ class CI_DB_odbc_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) + protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) { $conditions = ''; @@ -573,13 +550,12 @@ class CI_DB_odbc_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 + * @param int the number of rows to limit the query to + * @param int the offset value * @return string */ - function _limit($sql, $limit, $offset) + protected function _limit($sql, $limit, $offset) { // Does ODBC doesn't use the LIMIT clause? return $sql; @@ -590,19 +566,15 @@ class CI_DB_odbc_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + protected function _close($conn_id) { @odbc_close($conn_id); } - } - - /* End of file odbc_driver.php */ /* Location: ./system/database/drivers/odbc/odbc_driver.php */ -- cgit v1.2.3-24-g4f1b From f1bda680e08453e4c73177b9920b22fe362819eb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:35:06 +0200 Subject: Alter str_replace() order in ODBC's escape_str() --- system/database/drivers/odbc/odbc_driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index b70713ce9..5e3fd7aef 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -249,9 +249,9 @@ class CI_DB_odbc_driver extends CI_DB { // escape LIKE condition wildcards if ($like === TRUE) { - $str = str_replace( array('%', '_', $this->_like_escape_chr), - array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr), - $str); + return str_replace(array($this->_like_escape_chr.$this->_like_escape_chr, '%', '_'), + array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), + $str); } return $str; -- cgit v1.2.3-24-g4f1b From 9a8a11155a747bc7008f51393403eeb0dcc6aab0 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:37:23 +0200 Subject: Visibility declarations and cleanup for CI_DB_odbc_forge --- system/database/drivers/odbc/odbc_forge.php | 34 +++++++++++------------------ 1 file changed, 13 insertions(+), 21 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index acc2cadee..26a524a64 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -1,13 +1,13 @@ -db->_escape_identifiers($table)." ("; $current_field_count = 0; - foreach ($fields as $field=>$attributes) + foreach ($fields as $field => $attributes) { // Numeric field names aren't allowed in databases, so if the key is // numeric, we know it was assigned by PHP and the developer manually @@ -186,10 +181,9 @@ class CI_DB_odbc_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return bool */ - function _drop_table($table) + public function _drop_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -207,17 +201,16 @@ class CI_DB_odbc_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param string the table name * @param string the column definition * @param string the default value - * @param boolean should 'NOT NULL' be added + * @param bool should 'NOT NULL' be added * @param string the field after which we should add the new field - * @return object + * @return string */ - function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') + public function _alter_table($alter_type, $table, $column_name, $column_definition = '', $default_value = '', $null = '', $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '.$this->db->protect_identifiers($column_name); @@ -260,12 +253,11 @@ class CI_DB_odbc_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'ALTER TABLE '.$this->db->protect_identifiers($table_name).' RENAME TO '.$this->db->protect_identifiers($new_table_name); } -- cgit v1.2.3-24-g4f1b From 2227fbaecf9dfea80958f23e8a1d359e2d6c5f72 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:40:14 +0200 Subject: Visibility declarations and cleanup for CI_DB_odbc_utility --- system/database/drivers/odbc/odbc_utility.php | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index c146c1785..5244f084f 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -1,13 +1,13 @@ -db->db_debug) @@ -59,11 +56,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be optimized * - * @access private * @param string the table name - * @return object + * @return bool */ - function _optimize_table($table) + public function _optimize_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -80,11 +76,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { * * Generates a platform-specific query so that a table can be repaired * - * @access private * @param string the table name - * @return object + * @return bool */ - function _repair_table($table) + public function _repair_table($table) { // Not a supported ODBC feature if ($this->db->db_debug) @@ -99,11 +94,10 @@ class CI_DB_odbc_utility extends CI_DB_utility { /** * ODBC Export * - * @access private * @param array Preferences * @return mixed */ - function _backup($params = array()) + public function _backup($params = array()) { // Currently unsupported return $this->db->display_error('db_unsuported_feature'); @@ -112,4 +106,4 @@ class CI_DB_odbc_utility extends CI_DB_utility { } /* End of file odbc_utility.php */ -/* Location: ./system/database/drivers/odbc/odbc_utility.php */ \ No newline at end of file +/* Location: ./system/database/drivers/odbc/odbc_utility.php */ -- cgit v1.2.3-24-g4f1b From 78ef5a58e180e288100639c08245c6d13d157455 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:43:34 +0200 Subject: Visibility declarations and cleanup for CI_DB_odbc_result --- system/database/drivers/odbc/odbc_result.php | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index d19fa247e..f6aee356f 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -1,13 +1,13 @@ -result_id)) { @@ -148,10 +146,9 @@ class CI_DB_odbc_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private - * @return array + * @return bool */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return FALSE; } @@ -163,12 +160,11 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { - if (function_exists('odbc_fetch_object')) + if (function_exists('odbc_fetch_array')) { return odbc_fetch_array($this->result_id); } @@ -185,10 +181,9 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { if (function_exists('odbc_fetch_object')) { @@ -200,6 +195,7 @@ class CI_DB_odbc_result extends CI_DB_result { } } + // -------------------------------------------------------------------- /** * Result - object @@ -207,21 +203,24 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_object function when * not available (odbc_fetch_object requires unixODBC) * - * @access private * @return object */ - function _odbc_fetch_object(& $odbc_result) { + protected function _odbc_fetch_object(& $odbc_result) + { $rs = array(); $rs_obj = FALSE; - if (odbc_fetch_into($odbc_result, $rs)) { - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); + if (odbc_fetch_into($odbc_result, $rs)) + { + foreach ($rs as $k => $v) + { + $field_name = odbc_field_name($odbc_result, $k+1); $rs_obj->$field_name = $v; } } return $rs_obj; } + // -------------------------------------------------------------------- /** * Result - array @@ -229,16 +228,18 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_array function when * not available (odbc_fetch_array requires unixODBC) * - * @access private * @return array */ - function _odbc_fetch_array(& $odbc_result) { + protected function _odbc_fetch_array(& $odbc_result) + { $rs = array(); $rs_assoc = FALSE; - if (odbc_fetch_into($odbc_result, $rs)) { - $rs_assoc=array(); - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); + if (odbc_fetch_into($odbc_result, $rs)) + { + $rs_assoc = array(); + foreach ($rs as $k => $v) + { + $field_name = odbc_field_name($odbc_result, $k+1); $rs_assoc[$field_name] = $v; } } -- cgit v1.2.3-24-g4f1b From 6ea625e7f31b65838f1829408d37ac26009c79bc Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:46:27 +0200 Subject: Again alter ODBC's escape_str() --- system/database/drivers/odbc/odbc_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database') diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 5e3fd7aef..cfa561c3d 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -249,7 +249,7 @@ class CI_DB_odbc_driver extends CI_DB { // escape LIKE condition wildcards if ($like === TRUE) { - return str_replace(array($this->_like_escape_chr.$this->_like_escape_chr, '%', '_'), + return str_replace(array($this->_like_escape_chr, '%', '_'), array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), $str); } -- cgit v1.2.3-24-g4f1b From 592f4ec753a35e75d4c83d5ce19975f3e7287a08 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:10:08 +0200 Subject: Visibility declarations and cleanup for CI_DB_cubrid_driver --- system/database/drivers/cubrid/cubrid_driver.php | 124 +++++++++-------------- 1 file changed, 46 insertions(+), 78 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index 244707395..7b468bc5c 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -1,13 +1,13 @@ -port == '') { - $this->port = self::DEFAULT_PORT; + // Default CUBRID Broker port + $this->port = 33000; } $conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password); @@ -101,6 +95,7 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Persistent database connection + * * In CUBRID persistent DB connection is supported natively in CUBRID * engine which can be configured in the CUBRID Broker configuration * file by setting the CCI_PCONNECT parameter to ON. In that case, all @@ -109,10 +104,9 @@ class CI_DB_cubrid_driver extends CI_DB { * @cubrid_connect function will establish persisten connection * considering that the CCI_PCONNECT is ON. * - * @access private called by the base class * @return resource */ - function db_pconnect() + public function db_pconnect() { return $this->db_connect(); } @@ -125,10 +119,9 @@ class CI_DB_cubrid_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 (cubrid_ping($this->conn_id) === FALSE) { @@ -141,10 +134,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Select the database * - * @access private called by the base class * @return resource */ - function db_select() + public function db_select() { // In CUBRID there is no need to select a database as the database // is chosen at the connection time. @@ -172,11 +164,10 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { $sql = $this->_prep_query($sql); return @cubrid_query($sql, $this->conn_id); @@ -189,11 +180,10 @@ class CI_DB_cubrid_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) { // No need to prepare return $sql; @@ -204,10 +194,9 @@ class CI_DB_cubrid_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) { @@ -238,10 +227,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Commit Transaction * - * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -269,10 +257,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Rollback Transaction * - * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -300,12 +287,11 @@ class CI_DB_cubrid_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)) { @@ -352,10 +338,9 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Insert ID * - * @access public - * @return integer + * @return int */ - function insert_id() + public function insert_id() { return @cubrid_insert_id($this->conn_id); } @@ -368,11 +353,10 @@ class CI_DB_cubrid_driver extends CI_DB { * Generates a platform-specific query string that counts all records in * the specified table * - * @access public * @param string - * @return string + * @return int */ - function count_all($table = '') + public function count_all($table = '') { if ($table == '') { @@ -397,11 +381,10 @@ class CI_DB_cubrid_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @access private - * @param boolean + * @param bool * @return string */ - function _list_tables($prefix_limit = FALSE) + protected function _list_tables($prefix_limit = FALSE) { $sql = "SHOW TABLES"; @@ -420,11 +403,10 @@ class CI_DB_cubrid_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 = '') + protected function _list_columns($table = '') { return 'SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE); } @@ -436,11 +418,10 @@ class CI_DB_cubrid_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 + * @return string */ - function _field_data($table) + protected function _field_data($table) { return "SELECT * FROM ".$table." LIMIT 1"; } @@ -465,11 +446,10 @@ class CI_DB_cubrid_driver extends CI_DB { * * This function escapes column and table names * - * @access private * @param string * @return string */ - function _escape_identifiers($item) + public function _escape_identifiers($item) { if ($this->_escape_char == '') { @@ -508,11 +488,10 @@ class CI_DB_cubrid_driver extends CI_DB { * 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 + * @param array + * @return string */ - function _from_tables($tables) + protected function _from_tables($tables) { if ( ! is_array($tables)) { @@ -529,13 +508,12 @@ class CI_DB_cubrid_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) + protected function _insert($table, $keys, $values) { return "INSERT INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } @@ -548,13 +526,12 @@ class CI_DB_cubrid_driver extends CI_DB { * * Generates a platform-specific replace 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 _replace($table, $keys, $values) + protected function _replace($table, $keys, $values) { return "REPLACE INTO ".$table." (\"".implode('", "', $keys)."\") VALUES (".implode(', ', $values).")"; } @@ -566,13 +543,12 @@ class CI_DB_cubrid_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) + protected function _insert_batch($table, $keys, $values) { return "INSERT INTO ".$table." (\"".implode('", "', $keys)."\") VALUES ".implode(', ', $values); } @@ -585,7 +561,6 @@ class CI_DB_cubrid_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 @@ -593,7 +568,7 @@ class CI_DB_cubrid_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { @@ -621,13 +596,12 @@ class CI_DB_cubrid_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) + protected function _update_batch($table, $values, $index, $where = NULL) { $ids = array(); $where = ($where != '' AND count($where) >=1) ? implode(" ", $where).' AND ' : ''; @@ -668,7 +642,6 @@ class CI_DB_cubrid_driver extends CI_DB { // -------------------------------------------------------------------- - /** * Truncate statement * @@ -676,11 +649,10 @@ class CI_DB_cubrid_driver extends CI_DB { * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * - * @access public * @param string the table name * @return string */ - function _truncate($table) + protected function _truncate($table) { return "TRUNCATE ".$table; } @@ -692,13 +664,12 @@ class CI_DB_cubrid_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) + protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) { $conditions = ''; @@ -726,13 +697,12 @@ class CI_DB_cubrid_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 + * @param int the number of rows to limit the query to + * @param int the offset value * @return string */ - function _limit($sql, $limit, $offset) + protected function _limit($sql, $limit, $offset) { if ($offset == 0) { @@ -751,17 +721,15 @@ class CI_DB_cubrid_driver extends CI_DB { /** * Close DB Connection * - * @access public * @param resource * @return void */ - function _close($conn_id) + protected function _close($conn_id) { @cubrid_close($conn_id); } } - /* End of file cubrid_driver.php */ /* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ -- cgit v1.2.3-24-g4f1b From 32ed1cc894726aefc333870a7183e0e944c61c0e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:11:50 +0200 Subject: Visibility declarations and cleanup for CI_DB_cubrid_result --- system/database/drivers/cubrid/cubrid_result.php | 38 +++++++++--------------- 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php index a7eeb8a39..6a61a213d 100644 --- a/system/database/drivers/cubrid/cubrid_result.php +++ b/system/database/drivers/cubrid/cubrid_result.php @@ -1,13 +1,13 @@ -result_id); } @@ -54,10 +51,9 @@ class CI_DB_cubrid_result extends CI_DB_result { /** * Number of fields in the result set * - * @access public - * @return integer + * @return int */ - function num_fields() + public function num_fields() { return @cubrid_num_fields($this->result_id); } @@ -69,10 +65,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Generates an array of column names * - * @access public * @return array */ - function list_fields() + public function list_fields() { return cubrid_column_names($this->result_id); } @@ -84,10 +79,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Generates an array of objects containing field meta-data * - * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); @@ -147,9 +141,9 @@ class CI_DB_cubrid_result extends CI_DB_result { /** * Free the result * - * @return null + * @return void */ - function free_result() + public function free_result() { if(is_resource($this->result_id) || get_resource_type($this->result_id) == "Unknown" && @@ -169,10 +163,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return cubrid_data_seek($this->result_id, $n); } @@ -184,10 +177,9 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { return cubrid_fetch_assoc($this->result_id); } @@ -199,16 +191,14 @@ class CI_DB_cubrid_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { return cubrid_fetch_object($this->result_id); } } - /* End of file cubrid_result.php */ /* Location: ./system/database/drivers/cubrid/cubrid_result.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 582d6a828221c8628faff91b62c5db981adbb1d8 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:13:49 +0200 Subject: Visibility declarations and cleanup for CI_DB_cubrid_forge --- system/database/drivers/cubrid/cubrid_forge.php | 37 ++++++++++--------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 7d606ea36..bbda484c4 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -1,13 +1,13 @@ -$attributes) + foreach ($fields as $field => $attributes) { // Numeric field names aren't allowed in databases, so if the key is // numeric, we know it was assigned by PHP and the developer manually @@ -172,15 +167,14 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Create Table * - * @access private * @param string the table name * @param mixed the fields * @param mixed primary key(s) * @param mixed key(s) - * @param boolean should 'IF NOT EXISTS' be added to the SQL + * @param bool should 'IF NOT EXISTS' be added to the SQL * @return bool */ - function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) + public function _create_table($table, $fields, $primary_keys, $keys, $if_not_exists) { $sql = 'CREATE TABLE '; @@ -232,10 +226,9 @@ class CI_DB_cubrid_forge extends CI_DB_forge { /** * Drop Table * - * @access private * @return string */ - function _drop_table($table) + public function _drop_table($table) { return "DROP TABLE IF EXISTS ".$this->db->_escape_identifiers($table); } @@ -248,14 +241,13 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * Generates a platform-specific query so that a table can be altered * Called by add_column(), drop_column(), and column_alter(), * - * @access private * @param string the ALTER type (ADD, DROP, CHANGE) * @param string the column name * @param array fields * @param string the field after which we should add the new field - * @return object + * @return string */ - function _alter_table($alter_type, $table, $fields, $after_field = '') + public function _alter_table($alter_type, $table, $fields, $after_field = '') { $sql = 'ALTER TABLE '.$this->db->protect_identifiers($table).' '.$alter_type.' '; @@ -282,12 +274,11 @@ class CI_DB_cubrid_forge extends CI_DB_forge { * * Generates a platform-specific query so that a table can be renamed * - * @access private * @param string the old table name * @param string the new table name * @return string */ - function _rename_table($table_name, $new_table_name) + public function _rename_table($table_name, $new_table_name) { return 'RENAME TABLE '.$this->db->protect_identifiers($table_name).' AS '.$this->db->protect_identifiers($new_table_name); } @@ -295,4 +286,4 @@ class CI_DB_cubrid_forge extends CI_DB_forge { } /* End of file cubrid_forge.php */ -/* Location: ./system/database/drivers/cubrid/cubrid_forge.php */ +/* Location: ./system/database/drivers/cubrid/cubrid_forge.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e3e3d50576608e0aa0428358b2fae2da29759901 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:14:45 +0200 Subject: Visibility declarations and cleanup for CI_DB_cubrid_utility --- system/database/drivers/cubrid/cubrid_utility.php | 24 +++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index a13c0a5e4..dafd66146 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -1,13 +1,13 @@ - Date: Tue, 20 Mar 2012 15:15:57 +0200 Subject: Switch _process_fields() method in MySQL/MySQLi to protected --- system/database/drivers/mysql/mysql_forge.php | 2 +- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database') diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index 004a5a103..d317ac3e0 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -66,7 +66,7 @@ class CI_DB_mysql_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - private function _process_fields($fields) + protected function _process_fields($fields) { $current_field_count = 0; $sql = ''; diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 9cb1a0c70..9ec4bf7aa 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -66,7 +66,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { * @param mixed the fields * @return string */ - public function _process_fields($fields) + protected function _process_fields($fields) { $current_field_count = 0; $sql = ''; -- 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/DB_active_rec.php | 22 +++++++++++----------- system/database/DB_cache.php | 2 +- system/database/DB_forge.php | 2 +- system/database/DB_result.php | 2 +- system/database/DB_utility.php | 2 +- system/database/drivers/cubrid/cubrid_driver.php | 2 +- .../drivers/interbase/interbase_driver.php | 2 +- system/database/drivers/mssql/mssql_driver.php | 4 +--- system/database/drivers/mssql/mssql_forge.php | 2 +- system/database/drivers/mssql/mssql_result.php | 1 - system/database/drivers/mysql/mysql_forge.php | 2 +- system/database/drivers/mysqli/mysqli_forge.php | 2 +- system/database/drivers/oci8/oci8_driver.php | 4 +--- system/database/drivers/oci8/oci8_forge.php | 2 +- system/database/drivers/oci8/oci8_result.php | 3 +-- system/database/drivers/odbc/odbc_driver.php | 2 +- system/database/drivers/odbc/odbc_forge.php | 2 +- system/database/drivers/odbc/odbc_result.php | 2 +- system/database/drivers/odbc/odbc_utility.php | 2 +- system/database/drivers/pdo/pdo_driver.php | 2 +- system/database/drivers/pdo/pdo_forge.php | 2 +- system/database/drivers/postgre/postgre_forge.php | 2 +- system/database/drivers/postgre/postgre_result.php | 2 +- .../database/drivers/postgre/postgre_utility.php | 2 +- system/database/drivers/sqlite/sqlite_driver.php | 2 +- system/database/drivers/sqlite/sqlite_forge.php | 2 +- system/database/drivers/sqlite/sqlite_utility.php | 2 +- system/database/drivers/sqlsrv/sqlsrv_driver.php | 4 +--- system/database/drivers/sqlsrv/sqlsrv_forge.php | 2 +- system/database/drivers/sqlsrv/sqlsrv_result.php | 1 - 30 files changed, 38 insertions(+), 47 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 89369f190..fe591dda1 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -2197,19 +2197,19 @@ abstract class CI_DB_active_record extends CI_DB_driver { protected function _reset_write() { $this->_reset_run(array( - 'ar_set' => array(), - 'ar_from' => array(), - 'ar_where' => array(), - 'ar_like' => array(), - 'ar_orderby' => array(), - 'ar_keys' => array(), - 'ar_limit' => FALSE, - 'ar_order' => FALSE - ) - ); + 'ar_set' => array(), + 'ar_from' => array(), + 'ar_where' => array(), + 'ar_like' => array(), + 'ar_orderby' => array(), + 'ar_keys' => array(), + 'ar_limit' => FALSE, + 'ar_order' => FALSE + ) + ); } } /* End of file DB_active_rec.php */ -/* Location: ./system/database/DB_active_rec.php */ +/* Location: ./system/database/DB_active_rec.php */ \ No newline at end of file diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index fb0cfa89a..58e6968c0 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -183,4 +183,4 @@ class CI_DB_Cache { } /* End of file DB_cache.php */ -/* Location: ./system/database/DB_cache.php */ +/* Location: ./system/database/DB_cache.php */ \ No newline at end of file diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 192b78fa6..34c502a99 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -346,4 +346,4 @@ abstract class CI_DB_forge { } /* End of file DB_forge.php */ -/* Location: ./system/database/DB_forge.php */ +/* Location: ./system/database/DB_forge.php */ \ No newline at end of file diff --git a/system/database/DB_result.php b/system/database/DB_result.php index d0205e0fd..37c50e577 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -392,4 +392,4 @@ abstract class CI_DB_result { } /* End of file DB_result.php */ -/* Location: ./system/database/DB_result.php */ +/* Location: ./system/database/DB_result.php */ \ No newline at end of file diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index a7db803e8..642a004bd 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -384,4 +384,4 @@ abstract class CI_DB_utility extends CI_DB_forge { } /* End of file DB_utility.php */ -/* Location: ./system/database/DB_utility.php */ +/* Location: ./system/database/DB_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index f6b08daa0..f39c2ad76 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -715,4 +715,4 @@ class CI_DB_cubrid_driver extends CI_DB { } /* End of file cubrid_driver.php */ -/* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ +/* Location: ./system/database/drivers/cubrid/cubrid_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/interbase/interbase_driver.php b/system/database/drivers/interbase/interbase_driver.php index 4af5b57ed..9fa03adc7 100644 --- a/system/database/drivers/interbase/interbase_driver.php +++ b/system/database/drivers/interbase/interbase_driver.php @@ -607,4 +607,4 @@ SQL; } /* End of file interbase_driver.php */ -/* Location: ./system/database/drivers/interbase/interbase_driver.php */ +/* Location: ./system/database/drivers/interbase/interbase_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index a93ac57fe..ccbc3c456 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -639,7 +639,5 @@ class CI_DB_mssql_driver extends CI_DB { } - - /* End of file mssql_driver.php */ -/* Location: ./system/database/drivers/mssql/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 4a8089bb1..ee8b8f544 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -256,4 +256,4 @@ class CI_DB_mssql_forge extends CI_DB_forge { } /* End of file mssql_forge.php */ -/* Location: ./system/database/drivers/mssql/mssql_forge.php */ +/* Location: ./system/database/drivers/mssql/mssql_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index b205ce2d1..c77c5a752 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -176,6 +176,5 @@ class CI_DB_mssql_result extends CI_DB_result { } - /* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.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 d317ac3e0..11172b41b 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -237,4 +237,4 @@ class CI_DB_mysql_forge extends CI_DB_forge { } /* End of file mysql_forge.php */ -/* Location: ./system/database/drivers/mysql/mysql_forge.php */ +/* Location: ./system/database/drivers/mysql/mysql_forge.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 9ec4bf7aa..8cf0ae1fd 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -237,4 +237,4 @@ class CI_DB_mysqli_forge extends CI_DB_forge { } /* End of file mysqli_forge.php */ -/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ +/* Location: ./system/database/drivers/mysqli/mysqli_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 8d7040618..e3846bc1a 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -781,7 +781,5 @@ class CI_DB_oci8_driver extends CI_DB { } - - /* End of file oci8_driver.php */ -/* Location: ./system/database/drivers/oci8/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 7fcc8094d..0a251998b 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -225,4 +225,4 @@ class CI_DB_oci8_forge extends CI_DB_forge { } /* End of file oci8_forge.php */ -/* Location: ./system/database/drivers/oci8/oci8_forge.php */ +/* Location: ./system/database/drivers/oci8/oci8_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 6f1b8b4c1..a14e32eec 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -235,6 +235,5 @@ class CI_DB_oci8_result extends CI_DB_result { } - /* End of file oci8_result.php */ -/* Location: ./system/database/drivers/oci8/oci8_result.php */ +/* Location: ./system/database/drivers/oci8/oci8_result.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 87abedec9..6704264c6 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -561,4 +561,4 @@ class CI_DB_odbc_driver extends CI_DB { } /* End of file odbc_driver.php */ -/* Location: ./system/database/drivers/odbc/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 26a524a64..486a8dd7f 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -265,4 +265,4 @@ class CI_DB_odbc_forge extends CI_DB_forge { } /* End of file odbc_forge.php */ -/* Location: ./system/database/drivers/odbc/odbc_forge.php */ +/* Location: ./system/database/drivers/odbc/odbc_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index f6aee356f..30cc979ce 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -319,4 +319,4 @@ class CI_DB_odbc_result extends CI_DB_result { } /* End of file odbc_result.php */ -/* Location: ./system/database/drivers/odbc/odbc_result.php */ +/* Location: ./system/database/drivers/odbc/odbc_result.php */ \ No newline at end of file diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index 5244f084f..65445e96c 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -106,4 +106,4 @@ class CI_DB_odbc_utility extends CI_DB_utility { } /* End of file odbc_utility.php */ -/* Location: ./system/database/drivers/odbc/odbc_utility.php */ +/* Location: ./system/database/drivers/odbc/odbc_utility.php */ \ No newline at end of file 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 diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php index 87b638570..2e5c81de3 100644 --- a/system/database/drivers/pdo/pdo_forge.php +++ b/system/database/drivers/pdo/pdo_forge.php @@ -278,4 +278,4 @@ class CI_DB_pdo_forge extends CI_DB_forge { } /* End of file pdo_forge.php */ -/* Location: ./system/database/drivers/pdo/pdo_forge.php */ +/* Location: ./system/database/drivers/pdo/pdo_forge.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 2a8fdd676..a72449820 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -299,4 +299,4 @@ class CI_DB_postgre_forge extends CI_DB_forge { } /* End of file postgre_forge.php */ -/* Location: ./system/database/drivers/postgre/postgre_forge.php */ +/* Location: ./system/database/drivers/postgre/postgre_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index b3eafb8f7..8b22564b3 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -168,4 +168,4 @@ class CI_DB_postgre_result extends CI_DB_result { } /* End of file postgre_result.php */ -/* Location: ./system/database/drivers/postgre/postgre_result.php */ +/* Location: ./system/database/drivers/postgre/postgre_result.php */ \ No newline at end of file diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index e31a6db8f..c6b71b4d9 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -86,4 +86,4 @@ class CI_DB_postgre_utility extends CI_DB_utility { } /* End of file postgre_utility.php */ -/* Location: ./system/database/drivers/postgre/postgre_utility.php */ +/* Location: ./system/database/drivers/postgre/postgre_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 1870e73b7..de72b5454 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -623,4 +623,4 @@ class CI_DB_sqlite_driver extends CI_DB { /* End of file sqlite_driver.php */ -/* Location: ./system/database/drivers/sqlite/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 7fc531463..26d0d94bf 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -274,4 +274,4 @@ class CI_DB_sqlite_forge extends CI_DB_forge { } /* End of file sqlite_forge.php */ -/* Location: ./system/database/drivers/sqlite/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_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 9f9ddca44..c07004c54 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -94,4 +94,4 @@ class CI_DB_sqlite_utility extends CI_DB_utility { } /* End of file sqlite_utility.php */ -/* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ +/* Location: ./system/database/drivers/sqlite/sqlite_utility.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index ea9f9483b..0239e8f56 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -601,7 +601,5 @@ class CI_DB_sqlsrv_driver extends CI_DB { } - - /* End of file mssql_driver.php */ -/* Location: ./system/database/drivers/mssql/mssql_driver.php */ +/* Location: ./system/database/drivers/mssql/mssql_driver.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index cd061dd23..0a276e172 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -256,4 +256,4 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge { } /* End of file sqlsrv_forge.php */ -/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ +/* Location: ./system/database/drivers/sqlsrv/sqlsrv_forge.php */ \ No newline at end of file diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index 52d338a30..d980f98ff 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -176,6 +176,5 @@ class CI_DB_sqlsrv_result extends CI_DB_result { } - /* End of file mssql_result.php */ /* Location: ./system/database/drivers/mssql/mssql_result.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b