doctrine / DoctrineModule

Doctrine Module for Laminas
http://www.doctrine-project.org/projects/doctrine-module.html
MIT License
398 stars 269 forks source link

Custom session storage parameters #712

Closed TomHAnderson closed 3 years ago

TomHAnderson commented 3 years ago

This is a cherry-pick of https://github.com/doctrine/DoctrineModule/pull/702 to 4.0.x

TomHAnderson commented 3 years ago

From @alichry

This PR allows specifying the session container name and member to use in the underlying Session Storage instead of using the default. In case one of the new options are set, the StorageFactory creates a local instance of the Session Storage. Otherwise, it will retrieve the default aliased Session Storage 'DoctrineModule\Authentication\Storage\Session'

The Session Storage instance wrapper (ObjectRepository) is still cached by service manager.

TomHAnderson commented 3 years ago

Beyond what @alichry submitted I created a unit test for their work.

TomHAnderson commented 3 years ago

Rebase to correct commit message for phpcs

alichry commented 3 years ago

Thank you for adding the required test case and considering this feature in the next release :)