diff --git a/app/src/Middleware/SessionMiddleware.php b/app/src/Middleware/SessionMiddleware.php index 2bc1966..7f0d0fc 100644 --- a/app/src/Middleware/SessionMiddleware.php +++ b/app/src/Middleware/SessionMiddleware.php @@ -28,6 +28,8 @@ class SessionMiddleware implements MiddlewareInterface $this->sessionManager->start(); } - return $handler->handle($request); + $response = $handler->handle($request); + $this->sessionManager->save(); + return $response; } } diff --git a/app/src/Middlewares.php b/app/src/Middlewares.php index c8f1094..b52d30e 100644 --- a/app/src/Middlewares.php +++ b/app/src/Middlewares.php @@ -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); } } diff --git a/dev/php/config/xdebug.ini b/dev/php/config/xdebug.ini index f717568..2c69a97 100644 --- a/dev/php/config/xdebug.ini +++ b/dev/php/config/xdebug.ini @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index decdee0..c1fd63f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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