Finally get the xdebug stuff working, save sessions after handling the responses, not sure why teh storage for the flash class is empty by the time twig renders.

This commit is contained in:
Dave Smith-Hayes 2024-12-02 22:11:12 -05:00
parent 7c9f5f6bf8
commit 0567bdd897
4 changed files with 14 additions and 8 deletions

View File

@ -28,6 +28,8 @@ class SessionMiddleware implements MiddlewareInterface
$this->sessionManager->start(); $this->sessionManager->start();
} }
return $handler->handle($request); $response = $handler->handle($request);
$this->sessionManager->save();
return $response;
} }
} }

View File

@ -3,6 +3,7 @@
namespace Slovocast; namespace Slovocast;
use League\Config\Configuration; use League\Config\Configuration;
use Odan\Session\Middleware\SessionStartMiddleware;
use Odan\Session\SessionInterface; use Odan\Session\SessionInterface;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
@ -37,7 +38,7 @@ class Middlewares
// Twig // Twig
$templateCache = false; $templateCache = false;
$twig = Twig::create(APP_TEMPLATES_DIR, [ $twig = Twig::create(APP_TEMPLATES_DIR, [
'cache' => $templateCache, 'cache' => $templateCache,
'debug' => true, 'debug' => true,
]); ]);
@ -54,6 +55,6 @@ class Middlewares
$app->add(TwigMiddleware::create($app, $twig)); $app->add(TwigMiddleware::create($app, $twig));
// Add the error handling middleware // Add the error handling middleware
$app->addErrorMiddleware(true, true, true); $app->addErrorMiddleware(true, true, true);
} }
} }

View File

@ -1,6 +1,5 @@
[xdebug] [xdebug]
zend_extension=xdebug xdebug.mode=debug
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes xdebug.start_with_request=yes
xdebug.idekey="slovocast" xdebug.discover_client_host=true
xdebug.client_host=host.docker.internal

View File

@ -8,6 +8,10 @@ services:
- mariadb - mariadb
links: links:
- mariadb - mariadb
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- "PHP_IDE_CONFIG=serverName=Slovocast"
cli: cli:
build: build:
context: . context: .
@ -29,7 +33,7 @@ services:
mariadb: mariadb:
image: mariadb:10.9 image: mariadb:10.9
environment: environment:
MARIADB_ROOT_PASSWORD: password MARIADB_ROOT_PASSWORD: password
MARIADB_DATABASE: slovocast MARIADB_DATABASE: slovocast
MARIADB_USER: slovocast MARIADB_USER: slovocast
MARIADB_PASSWORD: password MARIADB_PASSWORD: password