O'Reilly logo

PHP 5 CMS Framework Development by Martin Brampton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Framework solution

Now let's develop some code that implements the ideas discussed in the first part of this chapter. It is built as two classes, one for the session itself and one for dealing with the storage of session data.

Building a session handler

Aliro deals with sessions using a singleton object to represent the current session. Another singleton object handles session data, and is described later. The session object is obtained from a very simple factory method that is located in aliroSession:

public static function getSession () {
return _ALIRO_IS_ADMIN ? aliroAdminSession::getInstance() : aliroUserSession::getInstance();
}

Different code is run depending on whether the CMS is entered through the administrator or the general ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required