SessionArrayWrapper and SessionContainer #64
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One new class and an interface is provided here.
The
SessionContainer
interface defines extremely simple functionality: get, set, contains and remove functions. This interface is applied to theSession
class and the containedSessionStore
class.Why introduce such a simple interface? This is so that other PHP.Gt applications built using WebEngine will be able to be build in a way that their components become inter-operable with other projects that do not use the PHP.Gt/Session functionality.
This is why the
SessionArrayWrapper
class has been introduced, which too also implements theSessionContainer
interface. This class takes an array in the constructor and stores it internally by reference, which means projects that use the$_SESSION
superglobal can now make use of PHP.Gt features, and vice-versa.