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:
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Config;
|
||||
|
||||
use App\Framework\Core\ValueObjects\Version;
|
||||
use App\Framework\DateTime\Timezone;
|
||||
|
||||
final readonly class AppConfig
|
||||
{
|
||||
public function __construct(
|
||||
public string $name = 'Framework App',
|
||||
public string $version = '1.0.0',
|
||||
public Version $version = new Version(1, 0, 0),
|
||||
public string $environment = 'production',
|
||||
public bool $debug = false,
|
||||
public Timezone $timezone = Timezone::EuropeBerlin,
|
||||
@@ -43,4 +44,9 @@ final readonly class AppConfig
|
||||
{
|
||||
return $this->debug || $this->type->isDebugEnabled();
|
||||
}
|
||||
|
||||
public function isDebug(): bool
|
||||
{
|
||||
return $this->isDebugEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ final readonly class EncryptedEnvLoader
|
||||
}
|
||||
|
||||
// Load environment-specific files
|
||||
$appEnv = $variables['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'development';
|
||||
// Priority: 1. Already loaded from .env file, 2. Default to development
|
||||
$appEnv = $variables['APP_ENV'] ?? 'development';
|
||||
$envSpecificFile = $baseDir->join(".env.{$appEnv}");
|
||||
if ($envSpecificFile->exists()) {
|
||||
$envSpecificVariables = $this->parseEnvFile($envSpecificFile);
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Framework\Config;
|
||||
|
||||
use App\Framework\Config\External\ExternalApiConfig;
|
||||
use App\Framework\Core\ValueObjects\Version;
|
||||
use App\Framework\Database\Config\DatabaseConfig;
|
||||
use App\Framework\Database\Config\DatabaseConfigInitializer;
|
||||
use App\Framework\DateTime\Timezone;
|
||||
@@ -51,10 +52,11 @@ final readonly class TypedConfigInitializer
|
||||
private function createAppConfig(): AppConfig
|
||||
{
|
||||
$environmentType = EnvironmentType::fromEnvironment($this->env);
|
||||
$versionString = $this->env->getString('APP_VERSION', '1.0.0');
|
||||
|
||||
return new AppConfig(
|
||||
name: $this->env->getString(EnvKey::APP_NAME, 'Framework App'),
|
||||
version: $this->env->getString('APP_VERSION', '1.0.0'),
|
||||
version: Version::fromString($versionString),
|
||||
environment: $this->env->getString(
|
||||
key: EnvKey::APP_ENV,
|
||||
default: 'production'
|
||||
|
||||
Reference in New Issue
Block a user