bootstrapWeb(); $container = $app->getContainer(); try { // Get the discovery registry $discoveryRegistry = $container->resolve(DiscoveryRegistry::class); echo "=== Discovery Registry Analysis ===\n"; // Check total Route attributes discovered $routeCount = $discoveryRegistry->attributes->getCount(Route::class); echo "Total Route attributes found: $routeCount\n\n"; if ($routeCount > 0) { $routes = $discoveryRegistry->attributes->get(Route::class); echo "=== Route Details ===\n"; foreach ($routes as $index => $discoveredRoute) { $filePath = $discoveredRoute->filePath->normalized ?? 'unknown'; $className = $discoveredRoute->additionalData['class'] ?? 'unknown'; $method = $discoveredRoute->additionalData['method'] ?? 'unknown'; $path = $discoveredRoute->additionalData['path'] ?? 'unknown'; $httpMethod = $discoveredRoute->additionalData['http_method'] ?? 'unknown'; echo sprintf("Route %d:\n", $index + 1); echo " File: $filePath\n"; echo " Class: $className\n"; echo " Method: $method\n"; echo " Path: $path\n"; echo " HTTP Method: $httpMethod\n"; // Check if this is the ShowImage route if (str_contains($filePath, 'ShowImage.php')) { echo " *** THIS IS THE SHOWIMAGE ROUTE ***\n"; } echo "\n"; } // Search specifically for ShowImage $showImageRoutes = array_filter($routes, function ($route) { return str_contains($route->filePath->normalized ?? '', 'ShowImage.php'); }); echo "=== ShowImage Routes Found ===\n"; echo "Count: " . count($showImageRoutes) . "\n"; if (count($showImageRoutes) > 0) { foreach ($showImageRoutes as $route) { echo "Found ShowImage route:\n"; echo " Path: " . ($route->additionalData['path'] ?? 'unknown') . "\n"; echo " Method: " . ($route->additionalData['http_method'] ?? 'unknown') . "\n"; echo " Class: " . ($route->additionalData['class'] ?? 'unknown') . "\n"; } } else { echo "No ShowImage routes found in discovery!\n"; } } else { echo "No routes found in discovery registry!\n"; } } catch (Exception $e) { echo "Error during discovery analysis: " . $e->getMessage() . "\n"; echo "Stack trace:\n" . $e->getTraceAsString() . "\n"; }