Hazaar\Cache\Backend
Session
Session cache backend class

The session cache backend class allows access to a PHP session using standard class access methods. It will automatically start a session if one is not already started. Sessions can be namespaced to prevent variable collisions.

Available config options:

  • lifetime - The lifetime to use for cached data. Default: 3600.
  • session - Any settings to set on the session instance.
Summary
MethodsPropertiesConstants
No constants
Properties
$namespace
$namespace
Static
$started
$started
$timeout
$timeout
$values
$values
$weight
$weight
Methods
Static
available()
available()
clear()
clear()

Clears all values from all applications.

This equates to a full session reset.

Use this wisely as it will affect other applications using the same session.
close()
close()
extend()
extend()
get()
get($key) : mixed
Return the value with key $key, optionally setting a default in the process.

If $default is supplied and no value for $key is currently set in the session then the default value will be set in the session and then returned.

has()
has($key) : bool
init()
init($namespace)

The session backend init method is responsible for maintaining a valid session. If a session has not already been started it will configure and start one automatically. You can specify a namespace for the session. The constructor will also maintain any timeouts for values as per the application configuration.

load()
load($key)
remove()
remove($key)
set()
set($key, $value, $timeout = null)
toArray()
toArray()
Powered by Scroly.io Generated: Friday, August 30th 2019 at 11:44am