From 57bdeb61bf199d1ae3ceaede4e9a9af8290ce715 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 5 Mar 2012 15:59:16 +0200 Subject: Removed oci8-specific stuff from DB_driver.php and added a constructor to DB_result to handle initialization --- system/database/DB_result.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 730443222..61aa56121 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -47,6 +47,12 @@ class CI_DB_result { public $num_rows = 0; public $row_data = NULL; + public function __construct(&$driver_object) + { + $this->conn_id = $driver_object->conn_id; + $this->result_id = $driver_object->result_id; + } + /** * Query result. Acts as a wrapper function for the following functions. * -- 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_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_result.php') 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 * -- 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_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_result.php') 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; -- 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_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_result.php') 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 -- cgit v1.2.3-24-g4f1b From 6dd4aff404c675d8da6ddfbd905bf4dbc13dece7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 15:54:23 +0200 Subject: Revert CI_DB_result to a regular class It's directly instantiated for cached database results --- system/database/DB_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 37c50e577..04f964fb1 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/ */ -abstract class CI_DB_result { +class CI_DB_result { public $conn_id = NULL; public $result_id = NULL; -- cgit v1.2.3-24-g4f1b From 38b2a256758ee8184d354cbdb0eac467118af36b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 29 Mar 2012 11:35:32 +0300 Subject: Changed the dummy DB free_result() method to void (that's how it's implemented by all drivers) and some style/comment changes in DB_result --- system/database/DB_result.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 04f964fb1..bb09c014c 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -57,7 +57,7 @@ class CI_DB_result { * Query result. Acts as a wrapper function for the following functions. * * @param string can be "object" or "array" - * @return mixed either a result object or array + * @return object */ public function result($type = 'object') { @@ -108,9 +108,9 @@ class CI_DB_result { // -------------------------------------------------------------------- /** - * Query result. "object" version. + * Query result. "object" version. * - * @return object + * @return array */ public function result_object() { @@ -224,7 +224,7 @@ class CI_DB_result { return; } - if ($key != '' AND ! is_null($value)) + if ($key != '' && ! is_null($value)) { $this->row_data[$key] = $value; } @@ -245,7 +245,7 @@ class CI_DB_result { return $result; } - if ($n != $this->current_row AND isset($result[$n])) + if ($n != $this->current_row && isset($result[$n])) { $this->current_row = $n; } @@ -266,7 +266,7 @@ class CI_DB_result { return $result; } - if ($n != $this->current_row AND isset($result[$n])) + if ($n != $this->current_row && isset($result[$n])) { $this->current_row = $n; } @@ -289,7 +289,7 @@ class CI_DB_result { return $result; } - if ($n != $this->current_row AND isset($result[$n])) + if ($n != $this->current_row && isset($result[$n])) { $this->current_row = $n; } @@ -297,7 +297,6 @@ class CI_DB_result { return $result[$this->current_row]; } - // -------------------------------------------------------------------- /** @@ -374,9 +373,9 @@ class CI_DB_result { /** * The following functions are normally overloaded by the identically named * methods in the platform-specific driver -- except when query caching - * is used. When caching is enabled we do not load the other driver. + * is used. When caching is enabled we do not load the other driver. * These functions are primarily here to prevent undefined function errors - * when a cached result object is in use. They are not otherwise fully + * when a cached result object is in use. They are not otherwise fully * operational due to the unavailability of the database resource IDs with * cached results. */ @@ -384,7 +383,7 @@ class CI_DB_result { public function num_fields() { return 0; } public function list_fields() { return array(); } public function field_data() { return array(); } - public function free_result() { return TRUE; } + public function free_result() { $this->result_id = FALSE; } protected function _data_seek() { return TRUE; } protected function _fetch_assoc() { return array(); } protected function _fetch_object() { return array(); } -- cgit v1.2.3-24-g4f1b From 8f3566fffcb9015ba53dbf52922fc5724ffa6045 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 12 Apr 2012 14:30:05 +0300 Subject: Changed default CI_DB_result::_data_seek() return value to FALSE and removed the method from drivers that don't support it --- system/database/DB_result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index bb09c014c..196febe2c 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -384,7 +384,7 @@ class CI_DB_result { public function list_fields() { return array(); } public function field_data() { return array(); } public function free_result() { $this->result_id = FALSE; } - protected function _data_seek() { return TRUE; } + protected function _data_seek() { return FALSE; } protected function _fetch_assoc() { return array(); } protected function _fetch_object() { return array(); } -- cgit v1.2.3-24-g4f1b