fix: resolve RedisCache array offset error and improve discovery diagnostics

- Fix RedisCache driver to handle MGET failures gracefully with fallback
- Add comprehensive discovery context comparison debug tools
- Identify root cause: WEB context discovery missing 166 items vs CLI
- WEB context missing RequestFactory class entirely (52 vs 69 commands)
- Improved exception handling with detailed binding diagnostics
This commit is contained in:
2025-09-12 20:05:18 +02:00
parent 8040d3e7a5
commit e30753ba0e
46990 changed files with 10789682 additions and 89639 deletions

View File

@@ -0,0 +1,62 @@
<?php
// Force production environment test by reading .env directly
declare(strict_types=1);
// Load environment from .env file (override container env)
$envFile = __DIR__ . '/../.env';
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
if (strpos($line, '#') === 0) continue;
if (strpos($line, '=') !== false) {
[$key, $value] = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
// Override environment
$_ENV[$key] = $value;
putenv("$key=$value");
}
}
}
header('Content-Type: application/json');
$tests = [
'environment' => [
'app_env_file' => $_ENV['APP_ENV'] ?? 'not-set',
'app_debug_file' => $_ENV['APP_DEBUG'] ?? 'not-set',
'app_env_server' => $_SERVER['APP_ENV'] ?? 'not-set',
'app_debug_server' => $_SERVER['APP_DEBUG'] ?? 'not-set',
'status' => ($_ENV['APP_ENV'] ?? '') === 'production' && ($_ENV['APP_DEBUG'] ?? '') === 'false' ? 'PASS' : 'FAIL'
],
'performance_debug' => [
'analytics_track_performance' => $_ENV['ANALYTICS_TRACK_PERFORMANCE'] ?? 'not-set',
'status' => (strpos($_ENV['ANALYTICS_TRACK_PERFORMANCE'] ?? '', 'false') !== false) ? 'PASS' : 'FAIL'
],
'xdebug' => [
'xdebug_mode' => $_ENV['XDEBUG_MODE'] ?? 'not-set',
'status' => ($_ENV['XDEBUG_MODE'] ?? '') === 'off' ? 'PASS' : 'FAIL'
],
'files' => [
'env_file_exists' => file_exists($envFile) ? 'PASS' : 'FAIL',
'env_backup_created' => glob(__DIR__ . '/../.env.backup.*') ? 'PASS' : 'FAIL'
]
];
// Calculate overall status
$overall_status = 'PASS';
foreach ($tests as $category => $test) {
if (isset($test['status']) && $test['status'] === 'FAIL') {
$overall_status = 'FAIL';
break;
}
}
echo json_encode([
'deployment_status' => $overall_status,
'timestamp' => date('Y-m-d H:i:s'),
'note' => 'Reading production config from .env file (container env vars need rebuild)',
'tests' => $tests
], JSON_PRETTY_PRINT);
?>