Table des matières

Session_User

Description : Session gesture (design pattern Factory)
Php : 5.3
Category : Session
Package : Core
Author : Tavm@n <tavman@gmail.com>
License : http://creativecommons.org/licenses/by-nc/2.0/
Link : none
See : All
Version : I-Radian v2.0.alpha 1
Since : 2010/02/10


Haut de page

DEFAULT_SESSION_NAME = 'default'

Description : Define the default name of sessions.
Signature : const DEFAULT_SESSION_NAME = 'default'


Haut de page

getInstance

Description : Design pattern : Factory. Return an instance of SessionUser correspond of the session
Signature : public static function getInstance ($sSessionName=null)
Param : [$sSessionName=null] (String) : Session name
Return : Object SessionUser
Usage :


<?php
class AccueilAction extends Action
{
    public function 
doindex ($aParams=array())
    {
        
$oSession SessionUser::getInstance();
        
$oSession['id'] = 1;
    }
}

Haut de page

getName

Description : Session name accessor.
Signature : public function getName ()
Return : String Session name.
Usage :


<?php
class AccueilAction extends Action
{
    public function 
doindex ($aParams=array())
    {
        
$oSession SessionUser::getInstance();
        echo 
$oSession->getName();
    }
}

Haut de page

__wakeup

Description : Verify user IP when session start (for security).
Signature : public function __wakeup ()


Haut de page

__sleep

Description : List variables for save.
Signature : public function __sleep ()
Return : Array List of variables.