Files
michaelschiemer/tests/debug/test-discovery-minimal.php
Michael Schiemer 55a330b223 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
2025-08-11 20:13:26 +02:00

51 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/../../vendor/autoload.php';
use App\Framework\Cache\GeneralCache;
use App\Framework\Core\PathProvider;
use App\Framework\DateTime\SystemClock;
use App\Framework\DI\DefaultContainer;
use App\Framework\Discovery\Factory\DiscoveryServiceFactory;
try {
echo "=== Minimal Discovery Test ===\n";
// Create minimal container
$container = new DefaultContainer();
$basePath = realpath(__DIR__ . '/../..');
$pathProvider = new PathProvider($basePath);
$clock = new SystemClock();
$cache = new GeneralCache(); // Use general cache for simplicity
echo "Base path: $basePath\n";
// Create factory
$factory = new DiscoveryServiceFactory($container, $pathProvider, $cache, $clock);
// Create discovery service with explicit paths
$discoveryService = $factory->createForDevelopment([$basePath . '/src']);
echo "Created DiscoveryService for development\n";
// Test discovery directly
echo "Starting discovery...\n";
$results = $discoveryService->discover();
echo "Discovery completed!\n";
echo "Attributes found: " . $results->attributes->count() . "\n";
echo "Routes found: " . $results->routes->count() . "\n";
echo "Interfaces found: " . $results->interfaces->count() . "\n";
if ($results->attributes->count() > 0) {
echo "Attribute types: " . implode(', ', $results->attributes->getAllTypes()) . "\n";
}
} catch (\Throwable $e) {
echo "ERROR: " . $e->getMessage() . "\n";
echo "File: " . $e->getFile() . ":" . $e->getLine() . "\n";
echo "Trace:\n" . $e->getTraceAsString() . "\n";
}