2 Commits

Author SHA1 Message Date
as2252258 b08fdb1801 eee 2026-07-03 14:25:26 +08:00
as2252258 a0b975003a eee 2026-06-28 20:20:20 +08:00
2 changed files with 7 additions and 11 deletions
+4 -4
View File
@@ -295,10 +295,10 @@ class Container implements ContainerInterface
} }
$isController = class_exists(\Kiri\Router\Base\Controller::class) && $reflect->isSubclassOf(\Kiri\Router\Base\Controller::class); $isController = class_exists(\Kiri\Router\Base\Controller::class) && $reflect->isSubclassOf(\Kiri\Router\Base\Controller::class);
$needsProxy = !$isController && class_exists(\Kiri\Router\Annotate\DeferRegistry::class) && \Kiri\Router\Annotate\DeferRegistry::hasAny($className); $needsProxy = !$isController && class_exists(\Kiri\Router\Defer\DeferRegistry::class) && \Kiri\Router\Defer\DeferRegistry::hasAny($className);
if ($needsProxy) { if ($needsProxy) {
$newInstance = \Kiri\Router\Annotate\DeferProxyGenerator::create($className, $construct); $newInstance = \Kiri\Router\Defer\DeferProxyGenerator::create($className, $construct);
} else { } else {
$newInstance = $reflect->newInstanceArgs($construct); $newInstance = $reflect->newInstanceArgs($construct);
} }
@@ -329,10 +329,10 @@ class Container implements ContainerInterface
$construct = $this->getMethodParams($handler); $construct = $this->getMethodParams($handler);
} }
$isController = class_exists(\Kiri\Router\Base\Controller::class) && $reflect->isSubclassOf(\Kiri\Router\Base\Controller::class); $isController = class_exists(\Kiri\Router\Base\Controller::class) && $reflect->isSubclassOf(\Kiri\Router\Base\Controller::class);
$needsProxy = !$isController && class_exists(\Kiri\Router\Annotate\DeferRegistry::class) && \Kiri\Router\Annotate\DeferRegistry::hasAny($reflect->getName()); $needsProxy = !$isController && class_exists(\Kiri\Router\Defer\DeferRegistry::class) && \Kiri\Router\Defer\DeferRegistry::hasAny($reflect->getName());
if ($needsProxy) { if ($needsProxy) {
$newInstance = \Kiri\Router\Annotate\DeferProxyGenerator::create($reflect->getName(), $construct); $newInstance = \Kiri\Router\Defer\DeferProxyGenerator::create($reflect->getName(), $construct);
} else { } else {
$newInstance = $reflect->newInstanceArgs($construct); $newInstance = $reflect->newInstanceArgs($construct);
} }
+3 -7
View File
@@ -79,11 +79,6 @@ class Scanner extends Component
} }
$this->syncLegacyState(); $this->syncLegacyState();
if ($this->config['cache_enabled']) {
$this->saveToCache($cacheFile);
}
return $this->changeSet; return $this->changeSet;
} }
@@ -118,6 +113,7 @@ class Scanner extends Component
} }
$this->syncLegacyState(); $this->syncLegacyState();
return $this->changeSet; return $this->changeSet;
} }
@@ -599,8 +595,8 @@ class Scanner extends Component
if (method_exists($this->container, 'forgetClass')) { if (method_exists($this->container, 'forgetClass')) {
$this->container->forgetClass($class); $this->container->forgetClass($class);
} }
if (class_exists(\Kiri\Router\Annotate\DeferRegistry::class)) { if (class_exists(\Kiri\Router\Defer\DeferRegistry::class)) {
\Kiri\Router\Annotate\DeferRegistry::removeClass($class); \Kiri\Router\Defer\DeferRegistry::removeClass($class);
} }
} }
} }