From 5b27d5c07e4425724c5e473f3dbbd65c0b446858 Mon Sep 17 00:00:00 2001 From: xl Date: Fri, 26 May 2023 11:16:45 +0800 Subject: [PATCH] qqq --- function.php | 4 +- kiri-engine/Config/ConfigProvider.php | 6 +-- kiri-engine/Redis/CacheInterface.php | 65 --------------------------- kiri-engine/Redis/Redis.php | 10 ++++- 4 files changed, 14 insertions(+), 71 deletions(-) delete mode 100644 kiri-engine/Redis/CacheInterface.php diff --git a/function.php b/function.php index 4e833c02..4ef634fd 100644 --- a/function.php +++ b/function.php @@ -931,9 +931,9 @@ if (!function_exists('config')) { /** * @param $key * @param null $default - * @return array|string|int|float|bool|null + * @return mixed */ - function config($key, $default = NULL): null|array|string|int|float|bool + function config($key, $default = NULL): mixed { return make(ConfigProvider::class)->get($key, $default); } diff --git a/kiri-engine/Config/ConfigProvider.php b/kiri-engine/Config/ConfigProvider.php index c621ecd0..53615b39 100644 --- a/kiri-engine/Config/ConfigProvider.php +++ b/kiri-engine/Config/ConfigProvider.php @@ -24,10 +24,10 @@ class ConfigProvider /** * @param string $key - * @param int|string|bool|array|null $default - * @return int|string|bool|array|null + * @param mixed $default + * @return mixed */ - public function get(string $key, int|string|bool|null|array $default = null): int|string|bool|null|array + public function get(string $key, mixed $default = null): mixed { $keys = explode('.', $key); diff --git a/kiri-engine/Redis/CacheInterface.php b/kiri-engine/Redis/CacheInterface.php deleted file mode 100644 index ef07d839..00000000 --- a/kiri-engine/Redis/CacheInterface.php +++ /dev/null @@ -1,65 +0,0 @@ - 1, 'max' => 100]; + /** + * 初始化 + */ + public function __construct() + { + Kiri::configure($this, \config('redis', [])); + } + /** * @return void * @throws Exception