/** * Statically initializes the global Cache adapter * * While the static global state is far from ideal, this provides pure compatibility * with AR's use of the cache implementation without a deep refactor or BC break * * @param CacheAdapterInterface $adapter The adapter to use for the cache * @param string $namespace An optional namespace to prefix all cache keys with * @param int $default_ttl The default expiry/TTL, in seconds, for each cache entry * @static * @access public * @return void */ public static function init(CacheAdapterInterface $adapter, $namespace = null, $default_ttl = null) { Cache::$adapter = $adapter; Cache::$options = [static::OPTION_KEY_NAMESPACE => (string) $namespace, static::OPTION_KEY_EXPIRE => (int) $default_ttl]; }