diff options
author | admin <devnull@localhost> | 2006-10-10 09:12:31 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-10-10 09:12:31 +0200 |
commit | cf49390d3d699d878eb6e151745e80285465ddb9 (patch) | |
tree | fa66a6ae5d96f9cf828ecc86435e5dbde9fa285b /system/codeigniter/Base4.php | |
parent | ada5fa37c19c2f7f3de210869dca6243ca9b4174 (diff) |
Diffstat (limited to 'system/codeigniter/Base4.php')
-rw-r--r-- | system/codeigniter/Base4.php | 29 |
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 |