Class QFileFormStateHandler
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.
This formstate handler is compatible with asynchronous ajax calls.
- QBaseClass
- QFileFormStateHandler
public static
|
#
DeleteFormStateForSession( )
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. |
public static
|
#
GarbageCollect( )
This will delete all the formstate files that are older than $GarbageCollectDaysOld days old. |
public static
|
|
public static
|
OverrideAttributes(),
__call(),
__get(),
__set()
|
public static
string
|
$StatePath
The PATH where the FormState files should be saved |
#
__FILE_FORM_STATE_HANDLER_PATH__
|
public static
string
|
$FileNamePrefix
The filename prefix to be used by all FormState files |
#
'qformstate_'
|
public static
integer
|
$GarbageCollectInterval
The interval of hits before the garbage collection should kick in to delete old FormState files, or 0 if it should never be run. The higher the number, the less often it runs (better aggregated-average performance, but requires more hard drive space). The lower the number, the more often it runs (slower aggregated-average performance, but requires less hard drive space). |
#
200
|
public static
integer
|
$GarbageCollectDaysOld
The minimum age (in days) a formstate file has to be in order to be considered old enough to be garbage collected. So if set to "1.5", then all formstate files older than 1.5 days will be deleted when the GC interval is kicked off. |
#
2
|