From e0b395490941be28b4ec8a491232f0534b84f2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Jun 2021 11:43:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Cache/Redis.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/System/Cache/Redis.php b/System/Cache/Redis.php index 992f3549..ecb8634e 100644 --- a/System/Cache/Redis.php +++ b/System/Cache/Redis.php @@ -20,6 +20,7 @@ use Snowflake\Snowflake; * Class Redis * @package Snowflake\Snowflake\Cache * @see \Redis + * */ class Redis extends Component { @@ -35,10 +36,10 @@ class Redis extends Component */ public function init() { - Event::on(Event::SYSTEM_RESOURCE_CLEAN, [$this, '____destroy']); - Event::on(Event::SYSTEM_RESOURCE_RELEASES, [$this, '____release']); - Event::on(Event::SERVER_WORKER_START, [$this, '____createPool']); - Event::on(Event::SERVER_TASK_START, [$this, '____createPool']); + Event::on(Event::SYSTEM_RESOURCE_CLEAN, [$this, 'destroy']); + Event::on(Event::SYSTEM_RESOURCE_RELEASES, [$this, 'release']); + Event::on(Event::SERVER_WORKER_START, [$this, 'createPool']); + Event::on(Event::SERVER_TASK_START, [$this, 'createPool']); } @@ -46,7 +47,7 @@ class Redis extends Component * @throws ConfigException * @throws Exception */ - public function ____createPool() + public function createPool() { $connections = Snowflake::app()->getRedisFromPool(); @@ -67,8 +68,8 @@ class Redis extends Component */ public function __call($name, $arguments): mixed { - if (method_exists($this, '____' . $name)) { - $data = $this->{'____' . $name}(...$arguments); + if (method_exists($this, $name)) { + $data = $this->{$name}(...$arguments); } else { $data = $this->proxy()->{$name}(...$arguments); } @@ -82,7 +83,7 @@ class Redis extends Component * @return bool|int * @throws Exception */ - public function ____lock($key, $timeout = 5): bool|int + public function lock($key, $timeout = 5): bool|int { $script = <<