eZPublish  4.4
lib Namespace Reference

File containing the eZMySQLCharset class. More...

Detailed Description

File containing the eZMySQLCharset class.

eZ Publish Session interface class

File containing session interface.

PHP session handler class Does not register it self as opposed to most other handler, as the point is to let PHP handle most things.

File containing PHP session handler.

DB session handler class.

File containing DB session handler.

Abstract session handler class to extend.

File containing abstract session handler.

Provides internationalization using XML (.ts) files.

File containing the eZTSTranslator class.

Version
4.4.0
Since
4.4
Version
4.4.0

CALLBACKS: destroy, gc, regenerate & cleanup functions MUST implement callbacks. Definition is documented in functions on this class, examples can be found in the handlers and examples of use can be sessin in ezsession.php class doc section.

Since
4.4
4.4

Session wrapper for session management, with support for handlers. Handler is defined by site.ini[Session] setting.

The session system has a hook system which allows external code to perform extra tasks before and after a certain action is executed. For instance to cleanup a table when sessions are removed. This can be used by adding a callback with the eZSession::addCallback function, first param is type and second is callback (called with call_user_func_array)

* function cleanupStuff( $db, $key, $escKey )
* {
* // Do cleanup here
* }
*
* eZSession::addCallback( 'destroy_pre', 'cleanupstuff');
* // Or if it was a class function:
* // eZSession::addCallback( 'destroy_pre', array('myClass', 'myCleanupStuff') );
*

When a specific session is destroyed in the database it will call the destroy_pre and destroy_post hooks. The signature of the function is function destroy( $db, $key, $escapedKey )

When a specific session is regenerated (login/logout) and kept it will call regenerate_pre and regenerate_post hooks. The signature of the function is function regenerate( $db, $escapedNewKey, $escapedOldKey, $escUserID )

When multiple sessions are expired (garbage collector) in the database it will call the gc_pre and gc_post hooks. The signature of the function is function gcollect( $db, $expiredTime )

When all sessions are removed from the database it will call the cleanup_pre and cleanup_post hooks. The signature of the function is function cleanup( $db )

Parameters
$dbThe database object used by the session manager.
$keyThe session key which are being worked on, see also $escapedKey
$escapedKeyThe same key as $key but is escaped correctly for the database. Use this to save a call to eZDBInterface::escapeString()
$expirationTimeAn integer specifying the timestamp of when the session will expire.
$expiredTimeSimilar to $expirationTime but is the time used to figure if a session is expired in the database. ie. all sessions with lower expiration times will be removed.