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
This commit is contained in:
2025-08-11 20:13:26 +02:00
parent 59fd3dd3b1
commit 55a330b223
3683 changed files with 2956207 additions and 16948 deletions

View File

@@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
namespace App\Framework\Database;
use App\Framework\Async\AsyncService;
use App\Framework\Database\Config\DatabaseConfig;
use App\Framework\DateTime\Timer;
use App\Framework\DI\Container;
use App\Framework\DI\Initializer;
final readonly class ConnectionInitializer
{
public function __construct(
private ?AsyncService $asyncService = null,
private bool $enableAsync = true
) {
}
#[Initializer]
public function __invoke(Container $container): ConnectionInterface
{
// Check if EntityManagerInitializer already registered a connection
if ($container->has(DatabaseManager::class)) {
$connection = $container->get(DatabaseManager::class)->getConnection();
} else {
$databaseConfig = $container->get(DatabaseConfig::class);
$timer = $container->get(Timer::class);
// Create a simple database manager for connection only with minimal dependencies
$databaseManager = new DatabaseManager(
config: $databaseConfig,
timer: $timer,
migrationsPath: 'database/migrations'
);
$connection = $databaseManager->getConnection();
}
// Automatically wrap with AsyncAwareConnection if AsyncService is available
if ($this->enableAsync && $this->asyncService !== null) {
return new AsyncAwareConnection($connection, $this->asyncService);
}
return $connection;
}
}