Enable Discovery debug logging for production troubleshooting

- Add DISCOVERY_LOG_LEVEL=debug
- Add DISCOVERY_SHOW_PROGRESS=true
- Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -0,0 +1,77 @@
<?php
declare(strict_types=1);
require_once '/var/www/html/vendor/autoload.php';
use App\Framework\Cache\CacheInitializer;
use App\Framework\Core\PathProvider;
use App\Framework\DateTime\SystemClock;
use App\Framework\DateTime\SystemHighResolutionClock;
use App\Framework\DI\DefaultContainer;
use App\Framework\Discovery\Cache\DiscoveryCacheIdentifiers;
use App\Framework\Performance\EnhancedPerformanceCollector;
use App\Framework\Performance\MemoryMonitor;
echo "=== Debugging Cache Data Structure ===\n\n";
// Setup wie im Web-Container
$basePath = '/var/www/html';
$pathProvider = new PathProvider($basePath);
$clock = new SystemClock();
// Create cache
$highResClock = new SystemHighResolutionClock();
$memoryMonitor = new MemoryMonitor();
$performanceCollector = new EnhancedPerformanceCollector($clock, $highResClock, $memoryMonitor, false);
$container = new DefaultContainer();
$cacheInitializer = new CacheInitializer($performanceCollector, $container);
$cache = $cacheInitializer();
// Generate cache key for web context
$defaultPaths = [$pathProvider->getSourcePath()];
$cacheKey = DiscoveryCacheIdentifiers::fullDiscoveryKey($defaultPaths);
echo "Checking cache key: {$cacheKey->toString()}\n\n";
// Check cache
$cachedItem = $cache->get($cacheKey);
if ($cachedItem !== null && $cachedItem->value !== null) {
echo "✅ Cache hit!\n";
if (is_array($cachedItem->value)) {
echo "📊 Analyzing array structure...\n";
// Zeige die Struktur des Arrays
foreach ($cachedItem->value as $key => $value) {
echo "Key: {$key}\n";
echo " Type: " . gettype($value) . "\n";
if (is_array($value)) {
echo " Array keys: " . implode(', ', array_keys($value)) . "\n";
if ($key === 'routes' && isset($value['routes'])) {
echo " Routes count: " . count($value['routes']) . "\n";
if (! empty($value['routes'])) {
echo " First route keys: " . implode(', ', array_keys($value['routes'][0] ?? [])) . "\n";
}
}
if ($key === 'attributes' && isset($value['mappings'])) {
echo " Mappings count: " . count($value['mappings']) . "\n";
if (! empty($value['mappings'])) {
echo " Mapping types: " . implode(', ', array_keys($value['mappings'])) . "\n";
}
}
} elseif (is_object($value)) {
echo " Object class: " . get_class($value) . "\n";
}
echo "\n";
}
}
} else {
echo "❌ No cache found\n";
}
echo "Done.\n";