Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b08fdb1801 | |||
| a0b975003a |
+4
-4
@@ -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
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user