Show
Ignore:
Timestamp:
03/07/2008 06:00:29 PM (10 months ago)
Author:
PugFish
Message:

Changed Cache library to use config groups, works the same as Database

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Cache.php

    r2137 r2230  
    4747        public function __construct($config = array()) 
    4848        { 
     49                if (empty($config)) 
     50                { 
     51                        // Load the default group 
     52                        $config = Config::item('cache.default'); 
     53                } 
     54                elseif (is_string($config)) 
     55                { 
     56                        $name = $config; 
     57 
     58                        // Test the config group name 
     59                        if (($config = Config::item('cache.'.$config)) === NULL) 
     60                                throw new Kohana_Exception('cache.undefined_group', $name); 
     61                } 
     62 
    4963                // Load configuration 
    5064                $this->config = (array) $config + Config::item('cache');