summaryrefslogtreecommitdiffstats
path: root/system/codeigniter/Base4.php
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-10 09:12:31 +0200
committeradmin <devnull@localhost>2006-10-10 09:12:31 +0200
commitcf49390d3d699d878eb6e151745e80285465ddb9 (patch)
treefa66a6ae5d96f9cf828ecc86435e5dbde9fa285b /system/codeigniter/Base4.php
parentada5fa37c19c2f7f3de210869dca6243ca9b4174 (diff)
Diffstat (limited to 'system/codeigniter/Base4.php')
-rw-r--r--system/codeigniter/Base4.php29
1 files changed, 22 insertions, 7 deletions
diff --git a/system/codeigniter/Base4.php b/system/codeigniter/Base4.php
index eccf58ed8..115c10727 100644
--- a/system/codeigniter/Base4.php
+++ b/system/codeigniter/Base4.php
@@ -18,10 +18,18 @@
/**
* CI_BASE - For PHP 4
*
- * This file is used only when Code Igniter is being run under PHP 4.
- * Since PHP 4 has such poor object handling we had to come up with
- * a hack (and a really ugly one at that...) to resolve some scoping
- * problems. PHP 5 doesn't suffer from this problem so we load one of
+ * 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 class of the Controller Base class. It's the only way we
+ * could enable functions like $this->load->library('email') to instantiate
+ * classes that can then be used within controllers as $this->email->send()
+ *
+ * PHP 4 also has trouble referencing the CI super object within application
+ * constructors since objects do not exist until the class is fully
+ * instantiated. Basically PHP 4 sucks...
+ *
+ * Since PHP 5 doesn't suffer from this problem so we load one of
* two files based on the version of PHP being run.
*
* @package CodeIgniter
@@ -34,18 +42,25 @@
function CI_Base()
{
- global $OBJ;
parent::CI_Loader();
$this->load =& $this;
+
+ global $OBJ;
$OBJ = $this->load;
}
}
function &get_instance()
{
- global $OBJ, $CI;
+ global $CI, $OBJ;
+
+ if (is_object($CI))
+ {
+ $CI->_ci_use_instance = TRUE;
+ return $CI;
+ }
- return (is_object($CI)) ? $CI : $OBJ->load;
+ return $OBJ->load;
}
?> \ No newline at end of file