Files
michaelschiemer/tests/debug/DebugInitializer.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

49 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Tests\Debug;
use App\Framework\DI\Container;
use App\Framework\DI\Initializer;
final readonly class DebugInitializer
{
public function __construct(
private Container $container
) {
}
#[Initializer]
public function debugTest(): void
{
echo "🎉 DEBUG: DebugInitializer wurde ausgeführt!\n";
echo "🎯 DEBUG: Container-Typ: " . get_class($this->container) . "\n";
// Log to a file to prove execution
file_put_contents(
__DIR__ . '/initializer-execution.log',
date('Y-m-d H:i:s') . " - DebugInitializer executed\n",
FILE_APPEND | LOCK_EX
);
}
#[Initializer]
public function debugService(): \stdClass
{
echo "🚀 DEBUG: Service-Initializer wurde aufgerufen!\n";
// Log to a file to prove execution
file_put_contents(
__DIR__ . '/initializer-execution.log',
date('Y-m-d H:i:s') . " - Service-Initializer executed\n",
FILE_APPEND | LOCK_EX
);
$service = new \stdClass();
$service->debug = 'Created by DebugInitializer';
return $service;
}
}