This commit is contained in:
2021-04-19 12:33:07 +08:00
parent 04bcce3a1d
commit dd86191928
+2 -4
View File
@@ -142,14 +142,14 @@ class Loader extends BaseObject
$this->_directory[rtrim($path->getRealPath(), '/')] = [];
} else {
$this->readFile($path, $namespace);
$array = explode('/', $path->getRealPath());
array_pop($array);
$directory = implode('/', $array);
$this->_directory[$directory][] = $path->getRealPath();
$this->readFile($path, $namespace);
}
}
}
@@ -227,12 +227,10 @@ class Loader extends BaseObject
{
try {
$path = '/' . trim($path, '/');
var_dump($path, $this->_directory);
if (!isset($this->_directory[$path])) {
return;
}
foreach ($this->_directory[$path] as $key => $_path) {
var_dump($key . '=>' . $path);
if (!str_contains($key, $path)) {
continue;
}