改名
This commit is contained in:
+12
-2
@@ -211,7 +211,7 @@ class Loader extends BaseObject
|
|||||||
public function loadByDirectory(string $path, ?string $outPath = null)
|
public function loadByDirectory(string $path, ?string $outPath = null)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->each($path);
|
$this->each($path, $outPath);
|
||||||
} catch (Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
$this->addError($exception, 'throwable');
|
$this->addError($exception, 'throwable');
|
||||||
}
|
}
|
||||||
@@ -258,14 +258,24 @@ class Loader extends BaseObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $filePath
|
* @param string $filePath
|
||||||
|
* @param string|null $outPath
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
private function each(string $filePath): static
|
private function each(string $filePath, ?string $outPath): static
|
||||||
{
|
{
|
||||||
$tree = null;
|
$tree = null;
|
||||||
$directory = $this->splitDirectory($filePath);
|
$directory = $this->splitDirectory($filePath);
|
||||||
|
|
||||||
|
if (!empty($outPath)) {
|
||||||
|
$outPath = rtrim($outPath, '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
$_tmp = '';
|
||||||
foreach ($directory as $key => $value) {
|
foreach ($directory as $key => $value) {
|
||||||
|
$_tmp .= DIRECTORY_SEPARATOR . $value;
|
||||||
|
if (str_contains($_tmp, $outPath)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
$tree = $this->getTree($tree, $value);
|
$tree = $this->getTree($tree, $value);
|
||||||
}
|
}
|
||||||
if ($tree instanceof FileTree) {
|
if ($tree instanceof FileTree) {
|
||||||
|
|||||||
@@ -85,10 +85,10 @@ class OnWorkerStart extends Callback
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$time = microtime(true);
|
$time = microtime(true);
|
||||||
$annotation->runtime(directory('app'));
|
$annotation->runtime(CONTROLLER_PATH);
|
||||||
$this->debug('load controller time .' . (microtime(true) - $time));
|
$this->debug('load controller time .' . (microtime(true) - $time));
|
||||||
|
|
||||||
// $annotation->runtime(directory('app'), CONTROLLER_PATH);
|
$annotation->runtime(directory('app'), CONTROLLER_PATH);
|
||||||
|
|
||||||
name($server->worker_pid, 'Worker#' . $server->worker_id);
|
name($server->worker_pid, 'Worker#' . $server->worker_id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user