|
|
|
File: C:/usr/local/lib/php/blueshoes-4.2/core/net/http/session/Bs_SessionFile.class.php
BlueShoes Application Framework - net/http/session
Bs_SessionFile
Bs_Object | +-- Bs_Session | +-- Bs_SessionFile
Session Class using flat files.
|
public class Bs_SessionFile extends Bs_Session
Session Class using flat files.
example usage:// Check for existing session otherwise create a new sessionif (isSet($GLOBALS['bsSession'])) {// Session exists$this->bsSession = &$GLOBALS['bsSession'];} else {// New session$GLOBALS['bsSession'] =& new Bs_SessionFile($this->_APP['path']['session'], $this->_APP['sess']['gc'], $this->_APP['sess']['ttl']);$this->bsSession = &$GLOBALS['bsSession'];$isOld = $this->bsSession->init($this->_APP['sess']['tech']);if (!$isOld) {//session does not exist yet, or old one could not be used.$this->bsSession->start('cookie');}bs_registerShutdownMethod(__LINE__, __FILE__, $this->bsSession, 'write');}dependencies: Bs_Session, Bs_File, Bs_Dir
| Authors | |
| Version | 4.0.$id$ |
| Copyright | blueshoes.org |
|
| |
|
|
|
Methods inherited from Bs_Object |
| isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean |
|
|
|
|
|
Fields inherited from Bs_Session |
| $sid |
|
Public Field Summary |
| string |
$filePrefixthe file prefix for the session file names. |
|
Private Field Summary |
| object [unknown] |
$_fileinstance of bs_file |
| string |
$_paththe path to the directory where the flat files are located. (may be a network path, right?) |
| unknown |
$this |
|
|
|
Public Method Details |
Bs_SessionFile |
|
public void Bs_SessionFile( [ string $path, string $gc, integer $ttl ] )
|
| |
Constructor.
|
| Parameter |
|
| string |
$path |
= >>NULL,<< |
|
if given then this path wil be used to store the session files. otherwise (empty) the session.save_path from the php.ini is used. |
|
|
| string |
$gc |
= >>NULL,<< |
|
the garbage collector, see $_gc |
|
|
| integer |
$ttl |
= >>30<< |
|
the time-to-live in minutes, see $_ttl |
|
| Returns |
void |
|
destroy |
|
public bool destroy( )
|
| |
kills the session and removes all stored data.
the file will be removed once write() gets called. see there.
Warning: documentation is missing.
|
| Returns |
bool TRUE on success, FALSE on (at least part) failure. |
|
read |
|
public bool read( )
|
| |
reads (loads) an existing session.
uses parent method.
|
| Returns |
bool true =success false=failure |
|
write |
|
public bool write( )
|
| |
writes an existing session to a file.
NOTE: this method is registered to register_shutdown_function() so don't exit()/die()here. also echo() and print() are of no use. rtfm.
|
| Returns |
bool true =success false=failure. also returns true if we don't have to write cause nothing has changed, or if session has been destroy()ed. |
| See Also |
$this |
|
gc |
|
public void gc( )
|
| |
Garbage collection
|
| Returns |
void |
|
|
Private Method Details |
_checkIntegrity |
|
private bool _checkIntegrity( string $sid )
|
| |
uses parent method.
Warning: documentation is missing.
|
| Parameter |
|
|
| Returns |
bool if it's ok, false if not. |
|
|
Public Field Details |
$filePrefix |
|
public string $filePrefix
>>'bs_sess_'<<
the file prefix for the session file names.
|
| See Also |
$_path |
|
|
Private Field Details |
$_file |
|
private object [unknown] $_file
>><<
instance of bs_file
|
|
$_path |
|
private string $_path
>><<
the path to the directory where the flat files are located. (may be a network path, right?)
it has to end with a slash ('c:/tmp/' not 'c:/tmp').for the file names, $_sid is used with the prefix $filePrefix.
|
| See Also |
$filePrefix |
|
$this |
|
private unknown $this
>><<
|
|
|
Private Constant Details |
BS_SESSIONFILE_VERSION
define( BS_SESSIONFILE_VERSION, >>4.0.$x$<< )
Case: default: case sensitive
|
|
|
|
|
|
| PHPDoc 1.0beta |