- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
49 lines
1.2 KiB
PHP
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;
|
|
}
|
|
}
|