Class QDbBackedFormStateHandler
This will store the formstate in a pre-specified table in the DB. This offers significant speed advantage over PHP SESSION because EACH form state is saved in its own row in the DB, 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 randomly generated and MD5-hashed, there is no benefit from encrypting it -- therefore, the QForm encryption preferences are ignored when using QFileFormStateHandler.
This handler can handle asynchronous calls.
- QBaseClass
- QDbBackedFormStateHandler
public static
|
|
public static
|
|
public static
string
|
|
public static
|
OverrideAttributes(),
__call(),
__get(),
__set()
|
public static
|
$intDbIndex
The database index in configuration.inc.php where the formstates have to be managed |
#
__DB_BACKED_FORM_STATE_HANDLER_DB_INDEX__
|
public static
|
$strTableName
The table name which will handle the formstates. It must have the following columns: 1. page_id: varchar(80) 2. save_time: integer 3. state_data: text 4. session_id: varchar(32) |
#
__DB_BACKED_FORM_STATE_HANDLER_TABLE_NAME__
|
public static
integer
|
$intGarbageCollectOnHitCount
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). |
#
20000
|
public static
integer
|
$intGarbageCollectDaysOld
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. Obviously, if the GC Interval is set to 0, then this GC Days Old value will be never used. |
#
2
|