From 922c8da704cd739e48da273cca0c07d00de8384c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 29 Oct 2021 14:13:41 +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 --- src/RpcJsonp.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/RpcJsonp.php b/src/RpcJsonp.php index 631203f..4a9cc80 100644 --- a/src/RpcJsonp.php +++ b/src/RpcJsonp.php @@ -13,7 +13,6 @@ use Kiri\Events\EventProvider; use Kiri\Exception\ConfigException; use Kiri\Kiri; use Server\Events\OnStart; -use Server\ServerManager; use Server\SInterface\OnCloseInterface; use Server\SInterface\OnConnectInterface; use Server\SInterface\OnReceiveInterface; @@ -48,25 +47,7 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa { $this->eventProvider->on(OnStart::class, [$this, 'register']); - $this->annotation->read(APP_PATH . 'rpc', 'Rpc'); - - $data = $this->annotation->runtime(APP_PATH . 'rpc'); - - $di = Kiri::getDi(); - foreach ($data as $class) { - foreach (NoteManager::getTargetNote($class) as $value) { - $value->execute($class); - } - $methods = $di->getMethodAttribute($class); - foreach ($methods as $method => $attribute) { - if (empty($attribute)) { - continue; - } - foreach ($attribute as $item) { - $item->execute($class, $method); - } - } - } + scan_directory(APP_PATH . 'rpc', 'Rpc'); }