Controller.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /**
  3. * CodeIgniter
  4. *
  5. * An open source application development framework for PHP 5.1.6 or newer
  6. *
  7. * @package CodeIgniter
  8. * @author EllisLab Dev Team
  9. * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc.
  10. * @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
  11. * @license http://codeigniter.com/user_guide/license.html
  12. * @link http://codeigniter.com
  13. * @since Version 1.0
  14. * @filesource
  15. */
  16. // ------------------------------------------------------------------------
  17. /**
  18. * CodeIgniter Application Controller Class
  19. *
  20. * This class object is the super class that every library in
  21. * CodeIgniter will be assigned to.
  22. *
  23. * @package CodeIgniter
  24. * @subpackage Libraries
  25. * @category Libraries
  26. * @author EllisLab Dev Team
  27. * @link http://codeigniter.com/user_guide/general/controllers.html
  28. */
  29. class CI_Controller {
  30. private static $instance;
  31. /**
  32. * Constructor
  33. */
  34. public function __construct()
  35. {
  36. self::$instance =& $this;
  37. // Assign all the class objects that were instantiated by the
  38. // bootstrap file (CodeIgniter.php) to local class variables
  39. // so that CI can run as one big super object.
  40. foreach (is_loaded() as $var => $class)
  41. {
  42. $this->$var =& load_class($class);
  43. }
  44. $this->load =& load_class('Loader', 'core');
  45. $this->load->initialize();
  46. log_message('debug', "Controller Class Initialized");
  47. }
  48. public static function &get_instance()
  49. {
  50. return self::$instance;
  51. }
  52. }
  53. // END Controller class
  54. /* End of file Controller.php */
  55. /* Location: ./system/core/Controller.php */