admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 1 | <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); |
| 2 | /** |
| 3 | * Code Igniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 4.3.2 or newer |
| 6 | * |
| 7 | * @package CodeIgniter |
| 8 | * @author Rick Ellis |
| 9 | * @copyright Copyright (c) 2006, pMachine, Inc. |
| 10 | * @license http://www.codeignitor.com/user_guide/license.html |
| 11 | * @link http://www.codeigniter.com |
| 12 | * @since Version 1.3 |
| 13 | * @filesource |
| 14 | */ |
| 15 | |
| 16 | // ------------------------------------------------------------------------ |
| 17 | |
| 18 | /** |
| 19 | * CI_BASE - For PHP 4 |
| 20 | * |
| 21 | * This file is used only when Code Igniter is being run under PHP 4. |
| 22 | * Since PHP 4 has such poor object handling we had to come up with |
admin | 6871d95 | 2006-10-04 00:36:18 +0000 | [diff] [blame] | 23 | * a hack (and a really ugly one at that...) to resolve some scoping |
| 24 | * problems. PHP 5 doesn't suffer from this problem so we load one of |
| 25 | * two files based on the version of PHP being run. |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 26 | * |
| 27 | * @package CodeIgniter |
| 28 | * @subpackage codeigniter |
| 29 | * @category front-controller |
| 30 | * @author Rick Ellis |
| 31 | * @link http://www.codeigniter.com/user_guide/ |
| 32 | */ |
| 33 | class CI_Base extends CI_Loader { |
| 34 | |
| 35 | function CI_Base() |
| 36 | { |
| 37 | global $OBJ; |
| 38 | parent::CI_Loader(); |
| 39 | $this->load =& $this; |
| 40 | $OBJ = $this->load; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | function &get_instance() |
| 45 | { |
| 46 | global $OBJ, $CI; |
| 47 | |
admin | 6871d95 | 2006-10-04 00:36:18 +0000 | [diff] [blame] | 48 | return (is_object($CI)) ? $CI : $OBJ->load; |
admin | b0dd10f | 2006-08-25 17:25:49 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | ?> |