fix(Discovery): Add comprehensive debug logging for router initialization

- Add initializer count logging in DiscoveryServiceBootstrapper
- Add route structure analysis in RouterSetup
- Add request parameter logging in HttpRouter
- Update PHP production config for better OPcache handling
- Fix various config and error handling improvements
This commit is contained in:
2025-10-27 22:23:18 +01:00
parent e326e3d6c6
commit 70e45fb56e
56 changed files with 1519 additions and 355 deletions

View File

@@ -4,8 +4,7 @@ declare(strict_types=1);
namespace App\Framework\Context;
use App\Framework\Config\Environment;
use App\Framework\Config\EnvKey;
use App\Framework\Config\AppConfig;
use App\Framework\Http\ServerEnvironment;
final readonly class ExecutionContext
@@ -68,10 +67,8 @@ final readonly class ExecutionContext
], $this->metadata);
}
public static function detect(?Environment $environment = null): self
public static function detect(?AppConfig $appConfig = null): self
{
#$environment->get(EnvKey::APP_ENV);
// Debug logging
#error_log("ExecutionContext::detect() - SAPI: " . php_sapi_name());
#error_log("ExecutionContext::detect() - REQUEST_METHOD: " . ($_SERVER['REQUEST_METHOD'] ?? 'not set'));
@@ -80,7 +77,7 @@ final readonly class ExecutionContext
// Test Environment
if (defined('PHPUNIT_COMPOSER_INSTALL') ||
isset($_ENV['APP_ENV']) && $_ENV['APP_ENV'] === 'testing') {
($appConfig !== null && $appConfig->type->isTesting())) {
return new self(ContextType::TEST, ['detected_by' => 'phpunit_or_env']);
}