psr7-sessions / storageless-mezzio-integration
Storageless PSR-7 Session support for Mezzio
Installs: 12 086
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 4
Open Issues: 10
Requires
- php: ^7.4 || ~8.0.0 || ~8.1.0
- laminas/laminas-dependency-plugin: ^2.1
- lcobucci/clock: ^2.0
- mezzio/mezzio-session: ^1.4
- psr/http-message: ^1.0
- psr7-sessions/storageless: ^8.0
Requires (Dev)
- doctrine/coding-standard: ^9
- infection/infection: ^0.24
- maglnet/composer-require-checker: ^3.3
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.16.1
- squizlabs/php_codesniffer: ^3.6
- vimeo/psalm: ^4.9.3
- 1.0.x-dev
- dev-renovate/vimeo-psalm-5.x
- dev-renovate/psr-http-message-2.x
- dev-renovate/phpunit-phpunit-10.x
- dev-renovate/maglnet-composer-require-checker-4.x
- dev-renovate/lcobucci-clock-3.x
- dev-renovate/doctrine-coding-standard-12.x
- dev-renovate/php
- dev-renovate/all-minor-patch
- dev-renovate/lock-file-maintenance
- dev-dependabot/add-v2-config-file
This package is auto-updated.
Last update: 2023-06-13 07:29:31 UTC
README
This integration allows you to use storageless as an implementation for mezzio-session
Installation
composer require lcobucci/clock \ psr7-sessions/storageless \ psr7-sessions/storageless-mezzio-integration
Symmetric key
use Lcobucci\Clock\SystemClock; use Lcobucci\JWT\Signer\Key\InMemory; use Mezzio\Session\SessionMiddleware; use PSR7Sessions\Mezzio\Storageless\SessionPersistence; use PSR7Sessions\Storageless\Http\SessionMiddleware as PSR7SessionMiddleware; $app = \Mezzio\AppFactory::create(); $app->pipe(PSR7SessionMiddleware::fromSymmetricKeyDefaults( InMemory::plainText('OpcMuKmoxkhzW0Y1iESpjWwL/D3UBdDauJOe742BJ5Q='), 1200 )); $app->pipe(new SessionMiddleware(new SessionPersistence(new SystemClock())));
Asymmetric key
use Lcobucci\Clock\SystemClock; use Lcobucci\JWT\Signer\Key\InMemory; use Mezzio\Session\SessionMiddleware; use PSR7Sessions\Mezzio\Storageless\SessionPersistence; use PSR7Sessions\Storageless\Http\SessionMiddleware as PSR7SessionMiddleware; $app = \Mezzio\AppFactory::create(); $app->pipe(PSR7SessionMiddleware::fromSymmetricKeyDefaults( InMemory::file('/path/to/private_key.pem'), InMemory::file('/path/to/public_key.pem'), 1200 )); $app->pipe(new SessionMiddleware(new SessionPersistence(new SystemClock())));
Contributing
Please refer to the contributing notes.
License
This project is made public under the MIT LICENSE.