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();
}
return $handler->handle($request);
$response = $handler->handle($request);
$this->sessionManager->save();
return $response;
}
}

View File

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

View File

@ -1,6 +1,5 @@
[xdebug]
zend_extension=xdebug
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
xdebug.mode=debug
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
links:
- mariadb
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- "PHP_IDE_CONFIG=serverName=Slovocast"
cli:
build:
context: .
@ -29,7 +33,7 @@ services:
mariadb:
image: mariadb:10.9
environment:
MARIADB_ROOT_PASSWORD: password
MARIADB_ROOT_PASSWORD: password
MARIADB_DATABASE: slovocast
MARIADB_USER: slovocast
MARIADB_PASSWORD: password