From 558008ad0888118ae7927727dd8e43bd4b09d35d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 4 Jun 2021 18:33:42 +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 --- Database/ActiveRecord.php | 5 +++-- System/Cache/Redis.php | 6 +----- System/Channel.php | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index 6308b840..d1c02538 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -15,6 +15,7 @@ use Database\Traits\HasBase; use Exception; use ReflectionException; use Snowflake\Channel; +use Snowflake\Event; use Snowflake\Exception\NotFindClassException; use Snowflake\Snowflake; @@ -310,8 +311,8 @@ class ActiveRecord extends BaseActiveRecord } $data = array_merge($data, $this->runRelate()); -// $class = Snowflake::app()->getChannel(); -// $class->push($this, static::class); + $class = Snowflake::app()->getChannel(); + $class->push($this, static::class); return $data; } diff --git a/System/Cache/Redis.php b/System/Cache/Redis.php index 912bf93f..992f3549 100644 --- a/System/Cache/Redis.php +++ b/System/Cache/Redis.php @@ -70,11 +70,7 @@ class Redis extends Component if (method_exists($this, '____' . $name)) { $data = $this->{'____' . $name}(...$arguments); } else { - $client = $this->proxy(); - $data = $client->{$name}(...$arguments); - if ($client->getLastError() !== null) { - var_dump($client->getLastError()); - } + $data = $this->proxy()->{$name}(...$arguments); } return $data; } diff --git a/System/Channel.php b/System/Channel.php index a01a98ef..69deebba 100644 --- a/System/Channel.php +++ b/System/Channel.php @@ -79,7 +79,7 @@ class Channel extends Component if ($channel->isEmpty()) { return call_user_func($closure); } - return $channel->dequeue(); + return clone $channel->dequeue(); }