- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
78 lines
2.6 KiB
PHP
78 lines
2.6 KiB
PHP
<?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";
|