Changeset 2137

Show
Ignore:
Timestamp:
02/22/2008 12:17:19 PM (11 months ago)
Author:
Shadowhand
Message:

Added Cache::instance()

Files:
1 modified

Legend:

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

    r1911 r2137  
    2424 
    2525        /** 
     26         * Returns a singleton instance of Cache. 
     27         * 
     28         * @param   array   configuration 
     29         * @return  object  Cache 
     30         */ 
     31        public static function instance($config = array()) 
     32        { 
     33                static $obj; 
     34 
     35                // Create the Cache instance 
     36                ($obj === NULL) and $obj = new Cache($config); 
     37 
     38                return $obj; 
     39        } 
     40 
     41        /** 
    2642         * Loads the configured driver and validates it. 
    2743         *