Class MachII_cache_PhpSession

Description

A simple cache container that stores to PHP's native session variables.

Using this cache system will result in the application being loaded and configured when a new session is started. It is not a shared object. One exists for each user and persistant data may not be shared through the application object. (Not that you should do that anyway.)

For best performance it is recommended that true shared cache be used.

Located in /MachII/cache/PhpSession.php (line 23)

MachII_framework_Cache
   |
   --MachII_cache_PhpSession
Method Summary
MachII_cache_PhpSession __construct (string $appName, [array $options = array()])
void clear ()
void createCache ()
mixed get (string $name)
void save (string $name, mixed $value)
Methods
Constructor __construct (line 31)
  • uses: MachII_util_Cache::__construct()
MachII_cache_PhpSession __construct (string $appName, [array $options = array()])
  • string $appName
  • array $options: an associative array of session options. (Not used at this time.)

Redefinition of:
MachII_framework_Cache::__construct()
Constructor
clear (line 72)

Unsets the array for the named application's session variable.

void clear ()

Redefinition of:
MachII_framework_Cache::clear()
Remove all items in application cache.
createCache (line 84)

Start a session.

Warning is suppressed if a session has already been started.

void createCache ()

Redefinition of:
MachII_framework_Cache::createCache()
Initialize the cache container.
get (line 57)

Unserialize objects and return the variable from the session.

mixed get (string $name)
  • string $name

Redefinition of:
MachII_framework_Cache::get()
Retrieve a variable.
save (line 46)

Serialize objects and set the session variable.

The value is serialized to "protect" the Mach-II application object. Otherwise the object would be auto-deserialized before its classes are loaded, since those are stored in the session also.

void save (string $name, mixed $value)
  • string $name
  • mixed $value

Redefinition of:
MachII_framework_Cache::save()
Store a variable.

Inherited Methods

Inherited From MachII_framework_Cache

MachII_framework_Cache::__construct()
MachII_framework_Cache::clear()
MachII_framework_Cache::createCache()
MachII_framework_Cache::get()
MachII_framework_Cache::getAppName()
MachII_framework_Cache::getCache()
MachII_framework_Cache::getOption()
MachII_framework_Cache::getOptions()
MachII_framework_Cache::save()
MachII_framework_Cache::setAppName()
MachII_framework_Cache::setCache()
MachII_framework_Cache::setOption()
MachII_framework_Cache::setOptions()

Documentation generated on Thu, 20 Jan 2005 10:47:36 -0800 by phpDocumentor 1.3.0RC3