Skip to content

SessionContainer and SessionArrayWrapper

Compare
Choose a tag to compare
@g105b g105b released this 27 Feb 16:06
· 41 commits to master since this release
97b7932

One new class and an interface is provided in this release.

The SessionContainer interface defines extremely simple functionality: get, set, contains and remove functions. This interface is applied to the Session class and the contained SessionStore 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 the SessionContainer 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.