Source for file Session.class.php
Documentation is available at Session.class.php
* Gumbo Library Framework
* This library is being released under the terms of the New BSD License. A
* copy of the license is packaged with the software (LICENSE.txt). If no
* copy is found, a copy of the license template can be found at:
* http://www.opensource.org/licenses/bsd-license.php
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
* This class is a place holder for the Session instance the program uses. This
* is the common access class for the program. If the program switches from
* Session_Basic to Session_Encrypt, this class will hold the proper object. The
* program uses this class to access the active Session class. The basic Session
* class is used by default.
* Session::load (new Session_Basic ());
* Session::instance ()->method (); // uses Session_Basic instance
* Session::load (new Session_Encrypt ());
* // any method calls will use Session_Encrypt instance
* Session::instance ()->method (); // use Session_Encrypt
* @copyright Copyright (c) 2007, iBayou, Michael Luster
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
* @author Michael Luster <mluster79@yahoo.com>
* @link http://sourceforge.net/projects/phpgumbo
gumbo_load ("Interface_Singleton");
abstract class Gumbo_Session implements Gumbo_Interface_Singleton {
/** @var Gumbo_Interface_Session $_instance */
private static $_instance =
null;
* @return Gumbo_Interface_Session
if (self::$_instance ==
null) {
gumbo_load ("Session_Basic");
self::$_instance =
new Gumbo_Session_Basic ();
* Sets the Active Session Instance
* @param Gumbo_Interface_Session $sess
public static function load (Gumbo_Interface_Session $sess) {
self::$_instance =
$sess;