PHP Class CI_Session, TastyIgniter

Author: ExpressionEngine Dev Team
显示文件 Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$userdata Just a reference to $_SESSION, for BC purposes.

Protected Properties

Property Type Description
$_config
$_driver

Public Methods

Method Description
__construct ( array $params = [] ) : void Class constructor
__get ( string $key ) : mixed __get()
__isset ( string $key ) : boolean __isset()
__set ( string $key, mixed $value ) : void __set()
all_userdata ( ) : array All userdata (fetch)
flashdata ( string $key = NULL ) : mixed Flashdata (fetch)
get_flash_keys ( ) : array Get flash keys
get_temp_keys ( ) : array Get temp keys
get_userdata ( ) Get userdata reference
has_userdata ( string $key ) : boolean Has userdata
keep_flashdata ( mixed $key ) : void Keep flashdata
mark_as_flash ( mixed $key ) : boolean Mark as flash
mark_as_temp ( mixed $key, integer $ttl = 300 ) : boolean Mark as temp
sess_destroy ( ) : void Session destroy
sess_regenerate ( boolean $destroy = FALSE ) : void Session regenerate
set_flashdata ( mixed $data, mixed $value = NULL ) : void Set flashdata
set_tempdata ( mixed $data, mixed $value = NULL, integer $ttl = 300 ) : void Set tempdata
set_userdata ( mixed $data, mixed $value = NULL ) : void Set userdata
tempdata ( string $key = NULL ) : mixed Temp data (fetch)
unmark_flash ( mixed $key ) : void Unmark flash
unmark_temp ( mixed $key ) : void Unmark flash
unset_tempdata ( $key ) : void Unset tempdata
unset_userdata ( $key ) : void Unset userdata
userdata ( string $key = NULL ) : mixed Userdata (fetch)

Protected Methods

Method Description
_ci_init_vars ( ) : void Handle temporary variables
_ci_load_classes ( string $driver ) : string CI Load Classes
_configure ( &$params ) : void Configuration

Method Details

__construct() public method

Class constructor
public __construct ( array $params = [] ) : void
$params array Configuration parameters
return void

__get() public method

__get()
public __get ( string $key ) : mixed
$key string 'session_id' or a session data key
return mixed

__isset() public method

__isset()
public __isset ( string $key ) : boolean
$key string 'session_id' or a session data key
return boolean

__set() public method

__set()
public __set ( string $key, mixed $value ) : void
$key string Session data key
$value mixed Session data value
return void

_ci_init_vars() protected method

Clears old "flash" data, marks the new one for deletion and handles "temp" data deletion.
protected _ci_init_vars ( ) : void
return void

_ci_load_classes() protected method

An internal method to load all possible dependency and extension classes. It kind of emulates the CI_Driver library, but is self-sufficient.
protected _ci_load_classes ( string $driver ) : string
$driver string Driver name
return string Driver class name

_configure() protected method

Handle input parameters and configuration defaults
protected _configure ( &$params ) : void
return void

all_userdata() public method

Legacy CI_Session compatibility method
public all_userdata ( ) : array
return array $_SESSION, excluding flash data items

flashdata() public method

Legacy CI_Session compatibility method
public flashdata ( string $key = NULL ) : mixed
$key string Session data key
return mixed Session data value or NULL if not found

get_flash_keys() public method

Get flash keys
public get_flash_keys ( ) : array
return array

get_temp_keys() public method

Get temp keys
public get_temp_keys ( ) : array
return array

get_userdata() public method

Legacy CI_Session compatibility method
public get_userdata ( )

has_userdata() public method

Legacy CI_Session compatibility method
public has_userdata ( string $key ) : boolean
$key string Session data key
return boolean

keep_flashdata() public method

Legacy CI_Session compatibility method
public keep_flashdata ( mixed $key ) : void
$key mixed Session data key(s)
return void

mark_as_flash() public method

Mark as flash
public mark_as_flash ( mixed $key ) : boolean
$key mixed Session data key(s)
return boolean

mark_as_temp() public method

Mark as temp
public mark_as_temp ( mixed $key, integer $ttl = 300 ) : boolean
$key mixed Session data key(s)
$ttl integer Time-to-live in seconds
return boolean

sess_destroy() public method

Legacy CI_Session compatibility method
public sess_destroy ( ) : void
return void

sess_regenerate() public method

Legacy CI_Session compatibility method
public sess_regenerate ( boolean $destroy = FALSE ) : void
$destroy boolean Destroy old session data flag
return void

set_flashdata() public method

Legacy CI_Session compatibility method
public set_flashdata ( mixed $data, mixed $value = NULL ) : void
$data mixed Session data key or an associative array
$value mixed Value to store
return void

set_tempdata() public method

Legacy CI_Session compatibility method
public set_tempdata ( mixed $data, mixed $value = NULL, integer $ttl = 300 ) : void
$data mixed Session data key or an associative array of items
$value mixed Value to store
$ttl integer Time-to-live in seconds
return void

set_userdata() public method

Legacy CI_Session compatibility method
public set_userdata ( mixed $data, mixed $value = NULL ) : void
$data mixed Session data key or an associative array
$value mixed Value to store
return void

tempdata() public method

Legacy CI_Session compatibility method
public tempdata ( string $key = NULL ) : mixed
$key string Session data key
return mixed Session data value or NULL if not found

unmark_flash() public method

Unmark flash
public unmark_flash ( mixed $key ) : void
$key mixed Session data key(s)
return void

unmark_temp() public method

Unmark flash
public unmark_temp ( mixed $key ) : void
$key mixed Session data key(s)
return void

unset_tempdata() public method

Legacy CI_Session compatibility method
public unset_tempdata ( $key ) : void
return void

unset_userdata() public method

Legacy CI_Session compatibility method
public unset_userdata ( $key ) : void
return void

userdata() public method

Legacy CI_Session compatibility method
public userdata ( string $key = NULL ) : mixed
$key string Session data key
return mixed Session data value or NULL if not found

Property Details

$_config protected_oe property

protected $_config

$_driver protected_oe property

protected $_driver

$userdata public_oe property

Just a reference to $_SESSION, for BC purposes.
public $userdata