Files
michaelschiemer/tests/debug/test-showimage-discovery.php
Michael Schiemer 5050c7d73a docs: consolidate documentation into organized structure
- Move 12 markdown files from root to docs/ subdirectories
- Organize documentation by category:
  • docs/troubleshooting/ (1 file)  - Technical troubleshooting guides
  • docs/deployment/      (4 files) - Deployment and security documentation
  • docs/guides/          (3 files) - Feature-specific guides
  • docs/planning/        (4 files) - Planning and improvement proposals

Root directory cleanup:
- Reduced from 16 to 4 markdown files in root
- Only essential project files remain:
  • CLAUDE.md (AI instructions)
  • README.md (Main project readme)
  • CLEANUP_PLAN.md (Current cleanup plan)
  • SRC_STRUCTURE_IMPROVEMENTS.md (Structure improvements)

This improves:
 Documentation discoverability
 Logical organization by purpose
 Clean root directory
 Better maintainability
2025-10-05 11:05:04 +02:00

86 lines
3.3 KiB
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Framework\Core\AppBootstrapper;
use App\Framework\Attributes\Route;
use App\Framework\Discovery\Results\DiscoveryRegistry;
use App\Framework\Performance\EnhancedPerformanceCollector;
use App\Framework\DateTime\SystemClock;
use App\Framework\DateTime\SystemHighResolutionClock;
use App\Framework\Performance\MemoryMonitor;
// Bootstrap the application to get discovery results
$basePath = dirname(__DIR__, 2);
$clock = new SystemClock();
$highResClock = new SystemHighResolutionClock();
$memoryMonitor = new MemoryMonitor();
$collector = new EnhancedPerformanceCollector($clock, $highResClock, $memoryMonitor, enabled: true);
$bootstrapper = new AppBootstrapper($basePath, $collector, $memoryMonitor);
$app = $bootstrapper->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";
}