diff --git a/library/think/Cache.php b/library/think/Cache.php index 7ae31aae..3bbd3e3a 100644 --- a/library/think/Cache.php +++ b/library/think/Cache.php @@ -58,13 +58,14 @@ class Cache /** * 自动初始化缓存 * @access public + * @param array $options 配置数组 * @return void */ - public static function init() + public static function init(array $options = []) { if (is_null(self::$handler)) { // 自动初始化缓存 - self::connect(Config::get('cache')); + self::connect($options ?: Config::get('cache')); } } diff --git a/library/think/cache/driver/File.php b/library/think/cache/driver/File.php index 97ee2bf6..1f4b91f8 100644 --- a/library/think/cache/driver/File.php +++ b/library/think/cache/driver/File.php @@ -17,11 +17,9 @@ namespace think\cache\driver; */ class File { - protected $options = [ 'expire' => 0, 'cache_subdir' => false, - 'path_level' => 1, 'prefix' => '', 'path' => CACHE_PATH, 'data_compress' => false,