refactor(logging, queue): replace RedisQueue with FileQueue for async logging

- Update `LoggerInitializer` to use `FileQueue` instead of `RedisQueue` for async logging, improving local file-based queuing.
- Remove unused `RedisQueue` and related Redis configurations.
- Modify `createQueue` to accept `PathProvider` for file path resolution.
- Revise `AGENTS.md` to add detailed AI agent usage and updated guidelines.
- Refactor `ComponentRegistryInitializer` to use explicit dependency injection for `__invoke` method, ensuring cleaner and more maintainable initialization logic.
This commit is contained in:
2025-11-03 20:09:32 +01:00
parent f8fb9b5a45
commit 8919da8a5c
3 changed files with 438 additions and 49 deletions

View File

@@ -17,19 +17,19 @@ final readonly class ComponentRegistryInitializer
{
public function __construct(
private Container $container,
private DiscoveryRegistry $discoveryRegistry
private DiscoveryRegistry $discoveryRegistry,
) {
}
#[Initializer]
public function __invoke(): ComponentRegistryInterface
public function __invoke(
LiveComponentRenderer $renderer,
ComponentCacheManager $cacheManager,
LiveComponentHandler $handler,
ComponentMetaDataCache $metadataCache,
NestedPerformanceTracker $performanceTracker
): ComponentRegistryInterface
{
$renderer = $this->container->get(LiveComponentRenderer::class);
$cacheManager = $this->container->get(ComponentCacheManager::class);
$handler = $this->container->get(LiveComponentHandler::class);
$metadataCache = $this->container->get(ComponentMetadataCache::class);
$performanceTracker = $this->container->get(NestedPerformanceTracker::class);
// DebugPanel is optional
$debugPanel = null;
@@ -39,7 +39,7 @@ final readonly class ComponentRegistryInitializer
// DebugPanel not available, that's okay
}
$registry = new ComponentRegistry(
return new ComponentRegistry(
container: $this->container,
discoveryRegistry: $this->discoveryRegistry,
renderer: $renderer,
@@ -49,10 +49,5 @@ final readonly class ComponentRegistryInitializer
performanceTracker: $performanceTracker,
debugPanel: $debugPanel
);
// Register as interface
$this->container->singleton(ComponentRegistryInterface::class, $registry);
return $registry;
}
}