This commit is contained in:
as2252258@163.com
2021-07-27 03:36:21 +08:00
parent 1a0cc394f3
commit fae8c48fa7
+2 -3
View File
@@ -171,7 +171,7 @@ class Loader extends BaseObject
* @param string|array $outPath * @param string|array $outPath
* @throws Exception * @throws Exception
*/ */
public function loadByDirectory(string $path, string|array $outPath = '') public function loadByDirectory(string $path)
{ {
try { try {
$path = '/' . trim($path, '/'); $path = '/' . trim($path, '/');
@@ -179,10 +179,9 @@ class Loader extends BaseObject
$paths = []; $paths = [];
foreach (static::$_directory as $key => $_path) { foreach (static::$_directory as $key => $_path) {
$key = '/' . trim($key, '/'); $key = '/' . trim($key, '/');
if (!str_starts_with($key, $path) || in_array($key, $outPath)) { if (!str_starts_with($key, $path)) {
continue; continue;
} }
foreach ($_path as $item) { foreach ($_path as $item) {
$paths[] = $item; $paths[] = $item;
} }