Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Session Class Reference
+ Inheritance diagram for Session:
+ Collaboration diagram for Session:

Public Member Functions

 __construct ($session_name=self::PARAMNAME, $sendCookie=true)
 
 set ($id="")
 
 setCookieSession ($id, $ttl=0)
 
 close ()
 
 closeAll ($uid=null)
 
 closeUsers ($uid=-1)
 
 open ($uid=Account::ANONYMOUS_ID)
 
 register ($k="", $v="")
 
 read ($k="", $d="")
 
 unregister ($k="")
 
 getUKey ($prefix= '')
 
 newId ()
 
 replaceGlobalParam ($paramName, $paramValue)
 
 setTTL ()
 
 getSessionTTL ($default=0, $ttlParamName= '')
 
 getSessionGcProbability ($default="0.01")
 
 touch ()
 
 deleteUserExpiredSessions ()
 
 deleteGuestExpiredSessions ()
 
 deleteMaxAgedSessions ()
 
 gcSessions ()
 
 setuid ($uid)
 
 sessionDirExistsAndIsWritable ()
 
 hasExpired ()
 
 removeSessionFile ($sessid=null)
 
 deleteUserSessionsExcept ($userId= '', $exceptSessionId= '')
 
- Public Member Functions inherited from DbObj
 __construct ($dbaccess= '', $id= '', $res= '', $dbid=0)
 
 Select ($id)
 
 getValues ()
 
 affectColumn ($fields, $reset=true)
 
 affect ($array, $more=false, $reset=true)
 
 isAffected ()
 
 Complete ()
 
 preInsert ()
 
 postInsert ()
 
 preUpdate ()
 
 postUpdate ()
 
 preDelete ()
 
 postDelete ()
 
 preSelect ($id)
 
 postSelect ($id)
 
 Add ($nopost=false, $nopre=false)
 
 modify ($nopost=false, $sfields="", $nopre=false)
 
 delete ($nopost=false)
 
 Adds (&$tcopy, $nopost=false)
 
 lw ($prop)
 
 CloseConnect ()
 
 Create ($nopost=false)
 
 postInit ()
 
 init_dbid ()
 
 exec_query ($sql, $lvl=0, $prepare=false)
 
 numrows ()
 
 fetch_array ($c, $type=PGSQL_ASSOC)
 
 update ()
 
 setError ($moreerr= '')
 
 autoUpdate ()
 
 savePoint ($point)
 
 lockPoint ($exclusiveLock, $exclusiveLockPrefix= '')
 
 setMasterLock ($useLock)
 
 rollbackPoint ($point)
 
 commitPoint ($point)
 

Static Public Member Functions

static getWebRootPath ($default=false)
 

Data Fields

const SESSION_CT_CLOSE = 2
 
const SESSION_CT_ARGS = 3
 
const SESSION_MIN_BYTE_LENGTH = 16
 
 $fields
 
 $id_fields
 
 $id
 
 $userid
 
 $name
 
 $last_seen
 
 $status
 
 $dbtable = "sessions"
 
 $sqlcreate
 
 $sessiondb
 
const PARAMNAME = 'dcpsession'
 
 $session_name = self::PARAMNAME
 
- Data Fields inherited from DbObj
 $dbid = - 1
 
 $dbaccess = ''
 
 $fields
 
 $dbtable = ''
 
 $id_fields
 
 $criterias = array()
 
 $sup_fields = array()
 
 $sup_where = array()
 
 $sup_tables = array()
 
 $fulltextfields = array()
 
 $order_by = ""
 
 $isset = false
 
 $msg_err = ''
 
 $err_code = ''
 
 $res = ''
 
 $debug = false
 
 $sqlcreate
 
 $sqlinit
 
 $log
 

Static Protected Member Functions

static getWebRootPath_Apache ()
 
static getWebRootPath_CoreUrlIndex ()
 

Additional Inherited Members

- Static Public Attributes inherited from DbObj
static $savepoint = array()
 
static $lockpoint = array()
 
static $sqlStrict = null
 
- Protected Member Functions inherited from DbObj
 tryCreate ()
 

Detailed Description

Definition at line 17 of file Class.Session.php.

Constructor & Destructor Documentation

__construct (   $session_name = self::PARAMNAME,
  $sendCookie = true 
)

Definition at line 51 of file Class.Session.php.

Member Function Documentation

close ( )

Closes session and removes all datas

Definition at line 219 of file Class.Session.php.

closeAll (   $uid = null)

Closes all session

Definition at line 237 of file Class.Session.php.

+ Here is the call graph for this function:

closeUsers (   $uid = - 1)

Closes all user's sessions

Definition at line 250 of file Class.Session.php.

+ Here is the call graph for this function:

deleteGuestExpiredSessions ( )

Definition at line 457 of file Class.Session.php.

+ Here is the call graph for this function:

deleteMaxAgedSessions ( )

Definition at line 466 of file Class.Session.php.

+ Here is the call graph for this function:

deleteUserExpiredSessions ( )

Definition at line 448 of file Class.Session.php.

+ Here is the call graph for this function:

deleteUserSessionsExcept (   $userId = '',
  $exceptSessionId = '' 
)

Delete all user's sessions except the current session.

Parameters
string$userIdThe user id (default is $this->userid)
string$exceptSessionIdThe session id to keep (default is $this->id)
Returns
string empty string on success, or the SQL error message

Definition at line 585 of file Class.Session.php.

+ Here is the call graph for this function:

gcSessions ( )

Definition at line 475 of file Class.Session.php.

+ Here is the call graph for this function:

getSessionGcProbability (   $default = "0.01")

Definition at line 436 of file Class.Session.php.

+ Here is the call graph for this function:

getSessionTTL (   $default = 0,
  $ttlParamName = '' 
)

Definition at line 424 of file Class.Session.php.

+ Here is the call graph for this function:

getUKey (   $prefix = '')

Get, or generate, a "cache busting" key

Parameters
string$prefix
Returns
string

Definition at line 349 of file Class.Session.php.

+ Here is the call graph for this function:

static getWebRootPath (   $default = false)
static

Try to autodetect « web root path » (i.e. the URL path as seen from the user stand point to reach the root of the Dynacase context).

Parameters
mixed$defaultThe default value to return is all auto-detection fails.
Returns
string|mixed Returns the « web root path » or the $default value if the path could not be detected with enough confidence

Definition at line 193 of file Class.Session.php.

static getWebRootPath_Apache ( )
staticprotected

Definition at line 108 of file Class.Session.php.

static getWebRootPath_CoreUrlIndex ( )
staticprotected

Definition at line 167 of file Class.Session.php.

+ Here is the call graph for this function:

hasExpired ( )

Definition at line 552 of file Class.Session.php.

+ Here is the call graph for this function:

newId ( )

Definition at line 361 of file Class.Session.php.

+ Here is the call graph for this function:

open (   $uid = Account::ANONYMOUS_ID)

Definition at line 258 of file Class.Session.php.

+ Here is the call graph for this function:

read (   $k = "",
  $d = "" 
)

Definition at line 303 of file Class.Session.php.

register (   $k = "",
  $v = "" 
)

Definition at line 281 of file Class.Session.php.

removeSessionFile (   $sessid = null)

Definition at line 566 of file Class.Session.php.

replaceGlobalParam (   $paramName,
  $paramValue 
)

replace value of global parameter in session cache

Parameters
string$paramName
string$paramValue
Returns
bool

Definition at line 395 of file Class.Session.php.

sessionDirExistsAndIsWritable ( )

Definition at line 532 of file Class.Session.php.

set (   $id = "")

Definition at line 62 of file Class.Session.php.

+ Here is the call graph for this function:

setCookieSession (   $id,
  $ttl = 0 
)

Definition at line 210 of file Class.Session.php.

setTTL ( )

Definition at line 414 of file Class.Session.php.

+ Here is the call graph for this function:

setuid (   $uid)

Definition at line 499 of file Class.Session.php.

+ Here is the call graph for this function:

touch ( )

Definition at line 441 of file Class.Session.php.

+ Here is the call graph for this function:

unregister (   $k = "")

Definition at line 330 of file Class.Session.php.

Field Documentation

$dbtable = "sessions"

Definition at line 38 of file Class.Session.php.

$fields
Initial value:
= array(
"id",
"userid",
"name",
"last_seen"
)

Definition at line 22 of file Class.Session.php.

$id

Definition at line 32 of file Class.Session.php.

$id_fields
Initial value:
= array(
"id"
)

Definition at line 29 of file Class.Session.php.

$last_seen

Definition at line 35 of file Class.Session.php.

$name

Definition at line 34 of file Class.Session.php.

$session_name = self::PARAMNAME

Definition at line 50 of file Class.Session.php.

$sessiondb

Definition at line 47 of file Class.Session.php.

$sqlcreate
Initial value:
= "create table sessions ( id text,
userid int,
name text not null,
last_seen timestamp not null DEFAULT now() );
create unique index sessions_idx on sessions(id);
create index sessions_idx_userid on sessions(userid);"

Definition at line 40 of file Class.Session.php.

$status

Definition at line 36 of file Class.Session.php.

$userid

Definition at line 33 of file Class.Session.php.

const PARAMNAME = 'dcpsession'

Definition at line 49 of file Class.Session.php.

const SESSION_CT_ARGS = 3

Definition at line 20 of file Class.Session.php.

const SESSION_CT_CLOSE = 2

Definition at line 19 of file Class.Session.php.

const SESSION_MIN_BYTE_LENGTH = 16

Definition at line 21 of file Class.Session.php.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen