QForm State

thread: 7 messages  |  last: a year ago  |  started: friday, april 4, 2008, 5:40 am pdt


#1  |  jragomes (S) Brazil
Friday, April 4, 2008, 5:40 AM PDT

Hi There,

I've been using Qcodo for almost an year now and I really like Qcodo.

I was visiting Prado Framework site and saw that they have changed the way to store the Form state, before, as Qcodo, they sent the Form state to the page, generating from 10k to 100k of additional information to the page. Now, seems that they are using database to store it.

What do you guys (specially Mike Ho) think about it?

I think this should be great for high traffic sites and would increase security, am I right?

What are the impacts of doing such a thing? As far as I can see, this shouldn't be very painful, since most of things would be the same.

#2  |  Gert van de Venis (zutphen, Netherlands) Netherlands (Holland, Europe)
Saturday, April 5, 2008, 1:14 AM PDT

As far as i know it is already in there... The files ar here: Qcodo\includes\qcodo\_core\qform_state_handlers. Not sure how to enable one or another, but let's find out... anyone?

#3  |  Gert van de Venis (zutphen, Netherlands) Netherlands (Holland, Europe)
Saturday, April 5, 2008, 1:33 AM PDT

Ok, Have a look at the QFormBase.Class.php file in the _core\qform folder. Somewhere at line 39 (i use version 0.3.43 dev) you'll find this line:
public static $FormStateHandler = 'QFormStateHandler';

So this should be overridable by every descendant of the QFormBase Class. AFAICS The possible options come from the three files in the ..\qform_state_handlers\.. folder (see previous post). These would be:
- QFormStateHandler (Default)
- QFileFormStateHandler
- QSessionFormStateHandler

As you can see, no database there... However if you have a look inside the three files mentioned above, it shouldn't be too hard to understand the principal and design your own formstatehandlers. Hope this helps. regards,

Gert

#4  |  jragomes (S) Brazil
Monday, April 7, 2008, 10:54 AM PDT

I see. This can be a solution, because we know that when we have a big form, the form state can increase the final page in at least 15K.

I am gonna write a State Handler using database. I think we can have some advantage over all other methods.

#5  |  Gert van de Venis (zutphen, Netherlands) Netherlands (Holland, Europe)
Monday, April 7, 2008, 10:59 AM PDT

Well, this seems like a good idea. If you need help, don't hesitate to post your problems here. I'd be glad to help (if i can ;).

#6  |  Carter Adams (Fayetteville, GA) United States of America
Monday, April 7, 2008, 11:18 AM PDT

jragomes/Gert

I'm really new to Qcodo (I've only installed, not coded anything yet), but unless I'm totally missing something, you need to look at:

http://examples.qcodo.com/examples/other/form_state.php

~Carter

#7  |  David B (Adelaide, SA) Australia
Wednesday, February 3, 2010, 9:52 PM PST

Excellent Carter thankyou! I have somehow missed this over ~3 years of use???

Many of our forms now use objects with blob fields, and it is not uncommon to get forms with a page size of 6 or 7MB. Hopefully this will help dramatically.



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.