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:
2025-10-27 22:23:18 +01:00
parent e326e3d6c6
commit 70e45fb56e
56 changed files with 1519 additions and 355 deletions

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Framework\WebPush\Controllers;
use App\Framework\Attributes\Route;
use App\Framework\Config\Environment;
use App\Framework\Http\Method;
use App\Framework\Http\Request;
use App\Framework\Http\Session\Session;
@@ -26,6 +27,7 @@ final readonly class WebPushController
private SubscriptionRepository $subscriptionRepository,
private WebPushService $webPushService,
private Session $session,
private Environment $environment
) {
}
@@ -305,8 +307,7 @@ final readonly class WebPushController
#[Route(path: '/api/push/vapid-key', method: Method::GET)]
public function vapidKey(Request $request): JsonResult
{
// This should be injected from config
$publicKey = $_ENV['VAPID_PUBLIC_KEY'] ?? null;
$publicKey = $this->environment->getString('VAPID_PUBLIC_KEY');
if ($publicKey === null) {
return new JsonResult(

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Framework\WebPush;
use App\Framework\Cache\Cache;
use App\Framework\Config\Environment;
use App\Framework\DI\Container;
use App\Framework\DI\Initializer;
use App\Framework\WebPush\Console\VapidKeyCommands;
@@ -42,9 +43,11 @@ final readonly class WebPushInitializer
public function initWebPushService(): ?WebPushService
{
// Try to load VAPID keys from environment
$publicKey = $_ENV['VAPID_PUBLIC_KEY'] ?? null;
$privateKey = $_ENV['VAPID_PRIVATE_KEY'] ?? null;
$subject = $_ENV['VAPID_SUBJECT'] ?? 'mailto:admin@example.com';
$env = $this->container->get(Environment::class);
$publicKey = $env->getString('VAPID_PUBLIC_KEY');
$privateKey = $env->getString('VAPID_PRIVATE_KEY');
$subject = $env->getString('VAPID_SUBJECT', 'mailto:admin@example.com');
if ($publicKey !== null && $privateKey !== null) {
$vapidKeys = new VapidKeyPair($publicKey, $privateKey);