- 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
61 lines
2.2 KiB
PHP
61 lines
2.2 KiB
PHP
<?php
|
|
|
|
require __DIR__ . '/vendor/autoload.php';
|
|
|
|
use App\Framework\Performance\EnhancedPerformanceCollector;
|
|
use App\Framework\DateTime\SystemClock;
|
|
use App\Framework\DateTime\SystemHighResolutionClock;
|
|
use App\Framework\Core\AppBootstrapper;
|
|
use App\Framework\Performance\MemoryMonitor;
|
|
|
|
echo "=== Discovery Bootstrap Debug ===\n";
|
|
|
|
try {
|
|
$basePath = __DIR__;
|
|
$clock = new SystemClock();
|
|
$highResClock = new SystemHighResolutionClock();
|
|
$memoryMonitor = new MemoryMonitor();
|
|
$collector = new EnhancedPerformanceCollector($clock, $highResClock, $memoryMonitor, enabled: true);
|
|
$bootstrapper = new AppBootstrapper($basePath, $collector, $memoryMonitor);
|
|
|
|
echo "1. Creating application via bootstrapper...\n";
|
|
$app = $bootstrapper->bootstrapWeb();
|
|
|
|
echo "2. Application created successfully\n";
|
|
|
|
// Get the container from the application
|
|
$container = $app->getContainer(); // Assuming this method exists
|
|
|
|
echo "3. Testing Request resolution...\n";
|
|
|
|
// Try to resolve Request interface
|
|
$request = $container->get('App\\Framework\\Http\\Request');
|
|
echo "4. ✅ SUCCESS: Request resolved as " . get_class($request) . "\n";
|
|
echo "5. Is HttpRequest instance: " . ($request instanceof \App\Framework\Http\HttpRequest ? 'YES' : 'NO') . "\n";
|
|
|
|
// Check discovery registry
|
|
echo "\n=== Discovery Registry Check ===\n";
|
|
$registry = $container->get('App\\Framework\\Discovery\\Results\\DiscoveryRegistry');
|
|
$initializers = $registry->getInitializersByClass();
|
|
echo "Total initializers: " . count($initializers) . "\n";
|
|
|
|
$requestFactoryFound = false;
|
|
foreach ($initializers as $class => $methods) {
|
|
if (str_contains($class, 'RequestFactory')) {
|
|
echo "Found RequestFactory: $class\n";
|
|
foreach ($methods as $method) {
|
|
echo " Method: $method\n";
|
|
}
|
|
$requestFactoryFound = true;
|
|
}
|
|
}
|
|
|
|
if (!$requestFactoryFound) {
|
|
echo "❌ RequestFactory not found in discovery registry!\n";
|
|
}
|
|
|
|
} catch (Throwable $e) {
|
|
echo "ERROR: " . $e->getMessage() . "\n";
|
|
echo "FILE: " . $e->getFile() . ":" . $e->getLine() . "\n";
|
|
echo "TRACE: " . $e->getTraceAsString() . "\n";
|
|
} |