From 7c0a23c3aa5b49766db06299496dbcf7a6084f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 19 Apr 2021 11:57:10 +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 --- Annotation/Loader.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index 6335663e..c681f736 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -140,8 +140,6 @@ class Loader extends BaseObject $iterator = new DirectoryIterator($path->getRealPath()); $this->_scanDir($iterator, $namespace); - var_dump(__LINE__ . '->' . rtrim($path->getRealPath(), '/')); - $this->_directory[rtrim($path->getRealPath(), '/')] = []; } else { $this->readFile($path, $namespace); @@ -151,8 +149,6 @@ class Loader extends BaseObject $directory = implode('/', $array); - var_dump(__LINE__ . '->' . $directory); - $this->_directory[$directory][] = $directory; } } @@ -234,11 +230,12 @@ class Loader extends BaseObject if (!isset($this->_directory[$path])) { return; } - $this->execute($this->_directory[$path]); -// -// foreach ($this->_directory[$path] as $file) { -// } -// $this->each($path, $outPath); + foreach ($this->_directory[$path] as $key => $path) { + if (!str_starts_with($key, $path)) { + continue; + } + $this->execute($this->_directory[$path]); + } } catch (Throwable $exception) { $this->addError($exception, 'throwable'); }