fix(Discovery): Add comprehensive debug logging for router initialization
- Add initializer count logging in DiscoveryServiceBootstrapper - Add route structure analysis in RouterSetup - Add request parameter logging in HttpRouter - Update PHP production config for better OPcache handling - Fix various config and error handling improvements
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\View\Dom\Transformer;
|
||||
|
||||
use App\Framework\Config\AppConfig;
|
||||
use App\Framework\LiveComponents\Contracts\ComponentRegistryInterface;
|
||||
use App\Framework\LiveComponents\Performance\ComponentMetadataCacheInterface;
|
||||
use App\Framework\LiveComponents\ValueObjects\ComponentId;
|
||||
@@ -34,7 +35,8 @@ final class XComponentTransformer implements NodeVisitor, AstTransformer
|
||||
private readonly ComponentRegistryInterface $componentRegistry,
|
||||
private readonly StaticComponentRenderer $staticComponentRenderer,
|
||||
private readonly ComponentMetadataCacheInterface $metadataCache,
|
||||
private readonly HtmlParser $parser
|
||||
private readonly HtmlParser $parser,
|
||||
private readonly AppConfig $appConfig
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -391,7 +393,7 @@ final class XComponentTransformer implements NodeVisitor, AstTransformer
|
||||
*/
|
||||
private function handleTransformError(ElementNode $element, \Throwable $e): void
|
||||
{
|
||||
$isDebug = ($_ENV['APP_ENV'] ?? 'production') === 'development';
|
||||
$isDebug = $this->appConfig->isDebug();
|
||||
|
||||
if ($isDebug) {
|
||||
// Create error node in place of component
|
||||
|
||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Framework\View\Processors;
|
||||
|
||||
use App\Framework\Config\AppConfig;
|
||||
use App\Framework\Config\Environment;
|
||||
use App\Framework\DI\Container;
|
||||
use App\Framework\LiveComponents\ComponentRegistry;
|
||||
use App\Framework\LiveComponents\Contracts\LiveComponentContract;
|
||||
@@ -449,8 +450,13 @@ final class PlaceholderReplacer implements StringProcessor
|
||||
|
||||
return $appConfig->isDebug();
|
||||
} catch (\Throwable $e) {
|
||||
// Fallback zu Environment-Variable falls AppConfig nicht verfügbar
|
||||
return ($_ENV['APP_ENV'] ?? 'production') === 'development';
|
||||
// Fallback zu Environment falls AppConfig nicht verfügbar
|
||||
try {
|
||||
$env = $this->container->get(Environment::class);
|
||||
return $env->getString('APP_ENV', 'production') === 'development';
|
||||
} catch (\Throwable) {
|
||||
return false; // Safe fallback: production mode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\View\Processors;
|
||||
|
||||
use App\Framework\Config\AppConfig;
|
||||
use App\Framework\LiveComponents\Contracts\ComponentRegistryInterface;
|
||||
use App\Framework\LiveComponents\Performance\ComponentMetadataCacheInterface;
|
||||
use App\Framework\LiveComponents\ValueObjects\ComponentData;
|
||||
@@ -42,7 +43,8 @@ final readonly class XComponentProcessor implements DomProcessor
|
||||
public function __construct(
|
||||
private ComponentRegistryInterface $componentRegistry,
|
||||
private ComponentMetadataCacheInterface $metadataCache,
|
||||
private DomComponentService $componentService
|
||||
private DomComponentService $componentService,
|
||||
private AppConfig $appConfig
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -349,8 +351,8 @@ final readonly class XComponentProcessor implements DomProcessor
|
||||
HTMLElement $element,
|
||||
\Throwable $e
|
||||
): void {
|
||||
// Check if we're in debug mode (via environment or config)
|
||||
$isDebug = ($_ENV['APP_ENV'] ?? 'production') === 'development';
|
||||
// Check if we're in debug mode
|
||||
$isDebug = $this->appConfig->isDebug();
|
||||
|
||||
if ($isDebug) {
|
||||
// Show error message in place of component
|
||||
|
||||
Reference in New Issue
Block a user