summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-11 21:16:58 +0200
committeradmin <devnull@localhost>2006-10-11 21:16:58 +0200
commit4003718f35247ef9b4a8d678389bda639677bac7 (patch)
tree9cb7a9a559b5adfc4f5c6139078b4753aecb544d /system
parent2799120c10b8d2544dd71e37b3a48c1eaa834c48 (diff)
Diffstat (limited to 'system')
-rw-r--r--system/codeigniter/Base4.php6
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/libraries/Controller.php3
-rw-r--r--system/libraries/Table.php8
4 files changed, 12 insertions, 7 deletions
diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php
index 9366b4588..2793317e7 100644
--- a/system/codeigniter/Base4.php
+++ b/system/codeigniter/Base4.php
@@ -21,7 +21,7 @@
* This file is used only when Code Igniter is being run under PHP 4.
*
* In order to allow CI to work under PHP 4 we had to make the Loader class
- * the parent of the Controller Base class. It's the only way we enabled
+ * the parent of the Controller Base class. It's the only way we can
* enable functions like $this->load->library('email') to instantiate
* classes that can then be used within controllers as $this->email->send()
*
@@ -42,11 +42,13 @@
function CI_Base()
{
+ // This allows syntax like $this->load->foo() to work
parent::CI_Loader();
$this->load =& $this;
+ // This allows resources used within controller constructors to work
global $OBJ;
- $OBJ = $this->load;
+ $OBJ = $this->load; // Do NOT use a reference.
}
}
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 6da645a38..22f91ed4c 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -400,7 +400,7 @@ class CI_DB_driver {
$this->initialize();
}
- return $this->_execute($sql, $this->conn_id);
+ return $this->_execute($sql);
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index 938c46e4c..88ab46164 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -75,8 +75,7 @@ class Controller extends CI_Base {
{
$this->$var =& load_class($class);
}
-
-
+
// In PHP 5 the Controller class is run as a discreet
// class. In PHP 4 it extends the Controller
if (floor(phpversion()) >= 5)
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index 0f2c49d96..61d04eef5 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -211,9 +211,13 @@ class CI_Table {
}
// Next blast through the result array and build out the rows
- foreach ($query->result_array() as $row)
+
+ if ($query->num_rows() > 0)
{
- $this->rows[] = $row;
+ foreach ($query->result_array() as $row)
+ {
+ $this->rows[] = $row;
+ }
}
}