Example #1
0
 /**
  * Returns a new instance of the Kohana_Config library
  * based on the singleton pattern
  *
  * @param   string       driver
  * @return  Kohana_Config
  * @access  public
  * @static
  */
 public static function &instance()
 {
     // If the driver has not been initialised, intialise it
     if (empty(Kohana_Config::$instance)) {
         //call a 1 time non singleton of Kohana_Config to get a list of drivers
         $config = new Kohana_Config(array('config_drivers' => array(), 'internal_cache' => FALSE));
         $core_config = $config->get('core');
         Kohana_Config::$instance = new Kohana_Config($core_config);
     }
     // Return the Kohana_Config driver requested
     return Kohana_Config::$instance;
 }