123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php namespace System;
- class Cache {
-
- private static $drivers = array();
-
- public static function driver($driver = null)
- {
- if ( ! array_key_exists($driver, static::$drivers))
- {
- if (is_null($driver))
- {
- $driver = Config::get('cache.driver');
- }
- static::$drivers[$driver] = Cache\Factory::make($driver);
- }
- return static::$drivers[$driver];
- }
-
- public static function __callStatic($method, $parameters)
- {
- return call_user_func_array(array(static::driver(), $method), $parameters);
- }
- }
|