改名
This commit is contained in:
+18
-13
@@ -230,20 +230,25 @@ class Loader extends BaseObject
|
|||||||
public function loadByDirectory(string $path, string|array $outPath = '')
|
public function loadByDirectory(string $path, string|array $outPath = '')
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// $path = '/' . trim($path, '/');
|
$path = '/' . trim($path, '/');
|
||||||
// if (!isset($this->_directory[$path])) {
|
if (!isset($this->_directory[$path])) {
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
// foreach ($this->_directory as $key => $_path) {
|
if (empty($outPath)) {
|
||||||
// $key = '/' . trim($path, '/');
|
$outPath = [];
|
||||||
// if (!str_starts_with($key, $path)) {
|
} else if (is_string($outPath)) {
|
||||||
// continue;
|
$outPath = [$outPath];
|
||||||
// }
|
}
|
||||||
//// if (!empty($outPath) && in_array($key, $outPath)) continue;
|
foreach ($this->_directory as $key => $_path) {
|
||||||
// $this->execute($_path);
|
$key = '/' . trim($key, '/');
|
||||||
// }
|
if (!str_starts_with($key, $path)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (in_array($key, $outPath)) continue;
|
||||||
|
$this->execute($_path);
|
||||||
|
}
|
||||||
|
|
||||||
$this->each($path, $outPath);
|
// $this->each($path, $outPath);
|
||||||
} catch (Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
$this->addError($exception, 'throwable');
|
$this->addError($exception, 'throwable');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user