Skip to content

classes_essentials_session_objectstore.class

Daniel Spors edited this page Dec 19, 2023 · 2 revisions

Classes in file essentials/session/objectstore.class.php

abstract class ObjectStore

ObjectStore class is used to store objects without blowing up the PHP session. When objects are serialized into the $_SESSION variable, PHP startup time increases dramatically once a fair number of objects is reached. To avoid this we use a special ObjectStore. In fact, we implemented different stores for different scenarios, all inherited from this base class.

Subclasses: APCStore, DbStore, FilesStore, RedisStore, SessionStore

Cleanup

INTERNAL Cleans things up

CreateId

INTERNAL Creates a unique object ID

Delete

Removes an object from the store.

Definition: public abstract function Delete($id)

Returns: void

Parameters:

  • string $id The object ID

Exists

Checks, if an object is stored.

Definition: public abstract function Exists($id)

Returns: bool true or false

Parameters:

  • string $id The object ID

GetStats

INTERNAL Used for performance testing

Migrate

Changes the session ID.

Definition: public abstract function Migrate($old_session_id, $new_session_id)

Returns: void

Parameters:

  • string $old_session_id The old session ID

  • string $new_session_id The new session ID

Restore

Loads an object from the store.

Definition: public abstract function Restore($id)

Returns: mixed The object or false

Parameters:

  • string $id The object ID

Store

Stores an object.

Definition: public abstract function Store($obj, $id)

Returns: void

Parameters:

  • mixed $obj Object to be stored

  • string $id Optional id

Update

Updates used objects.

Definition: public abstract function Update($keep_alive=false)

Returns: void

Parameters:

  • bool $keep_alive If true, updates the 'used' timestamps too

Clone this wiki locally