QCubed - A PHP5 rapid development MVC framework.
Home  |  Updates

classQFileFormStateHandler

QFileFormStateHandler Class Reference

Inherits QBaseClass.

Collaboration diagram for QFileFormStateHandler:

List of all members.

Static Public Member Functions

Static Public Attributes


Detailed Description

This will store the formstate in a pre-specified directory on the file system. This offers significant speed advantage over PHP SESSION because EACH form state is saved in its own file, and only the form state that is needed for loading will be accessed (as opposed to with session, ALL the form states are loaded into memory every time).

The downside is that because it doesn't utilize PHP's session management subsystem, this class must take care of its own garbage collection/deleting of old/outdated formstate files.

Because the index is randomy generated and MD5-hashed, there is no benefit from encrypting it -- therefore, the QForm encryption preferences are ignored when using QFileFormStateHandler.


Member Function Documentation

static QFileFormStateHandler::DeleteFormStateForSession (  )  [static]

If PHP SESSION is enabled, then this method will delete all formstate files specifically for this SESSION user (and no one else). This can be used in lieu of or in addition to the standard interval-based garbage collection mechanism.

Also, for standard web applications with logins, it might be a good idea to call this method whenever the user logs out.

static QFileFormStateHandler::GarbageCollect (  )  [static]

This will delete all the formstate files that are older than $GarbageCollectDaysOld days old.

Referenced by Save().

static QFileFormStateHandler::Load ( strPostDataState  )  [static]

static QFileFormStateHandler::Save ( strFormState,
blnBackButtonFlag 
) [static]

References GarbageCollect().


Member Data Documentation

QFileFormStateHandler::$FileNamePrefix = 'qformstate_' [static]

QFileFormStateHandler::$GarbageCollectDaysOld = 2 [static]

QFileFormStateHandler::$GarbageCollectInterval = 200 [static]

QFileFormStateHandler::$StatePath = '/tmp' [static]


The documentation for this class was generated from the following file: