From 9ae3dc8f8a6d0718c68fe42d8c9ae04f80bd2be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 26 Apr 2021 12:04:27 +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 --- HttpServer/Route/Router.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index a0b66605..54507196 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -112,12 +112,7 @@ class Router extends HttpService implements RouterInterface if ($handler instanceof Closure) { $handler = Closure::bind($handler, new Controller()); } - - if ($this->useTree == ROUTER_TREE) { - return $this->tree($path, $handler, $method); - } else { - return $this->hash($path, $handler, $method); - } + return $this->hash($path, $handler, $method); } @@ -572,9 +567,9 @@ class Router extends HttpService implements RouterInterface */ public function find_path(Request $request): ?Node { - if ($this->useTree === ROUTER_TREE) { - return $this->Branch_search($request); - } +// if ($this->useTree === ROUTER_TREE) { +// return $this->Branch_search($request); +// } $method = $request->getMethod(); $uri = $request->headers->get('request_uri', '/');