questions, questions, questions...

questions, questions, questions...

ashiersashiers Posts: 101Questions: 8Answers: 7
edited June 2013 in General
Hi Allan,

I have a few questions I'm looking to resolve:

1. Several of the parameters being moved back and forth from the client side to the server side are labelled "bRegex". I've run a search through your PHP code and didn't see those parameters being referenced anywhere. Is it being used at all? Is it intended for some future purpose?
2. In the JavaScript code I often see a property labelled "sDom". I see it being initialized with various Strings. I don't see it anywhere in your documentation. What is it doing? What do the Strings it is initialized with represent?
3. Now for the big one! On your site, as you practice with each example, when you've finished a session any changes made to the database are removed. Or rather, the database resorts to its original state. How did you manage that? Is there some sort of special setup with MySQL that one needs to do to accomplish this?

Alan

Replies

  • aaronwaaronw Posts: 89Questions: 3Answers: 4
    for sDOM parameters/example, look at:
    http://www.datatables.net/release-datatables/examples/basic_init/dom.html
    and
    http://www.datatables.net/usage/options#sDom

    bRegex is used as an option in the filter function - http://www.datatables.net/api#fnFilter - to let the 'search engine' know if this should be a regex search or not.
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    1. Regex:

    > Is it being used at all? Is it intended for some future purpose?

    No it isn't being used, and not likely to be in my own server-side processing script. It is there because its a feature of the filtering, but it is likely to be a massive performance drag on a database, so it isn't enabled. The list of script available for SSP is here: http://datatables.net/development/server-side/ . Hardly any use it, but it is possible if you want.

    2. sDom

    > I don't see it anywhere in your documentation

    As aaronw points out, it is in the standard documentation :-). Also you might want to use http://datatables.net/ref - a list of all parameters.

    3. database restore

    > On your site, as you practice with each example, when you've finished a session any changes made to the database are removed.

    its more simple than a session restore. Every two minute (or five, I forget off the top of my head) a cron job is run which nukes the old database and puts the new one in place.

    This is to try and ensure that the database data is fresh and there are no rude words left over from monkeys editing before someone sensible :-)

    Allan
  • ashiersashiers Posts: 101Questions: 8Answers: 7
    I'm not familiar with cron. I had t look it up on Wikipedia. Its a scheduler application on Unix based computers. So, that being the case, I suppose one can create a backup dump of the database and just have cron perform a backup operation on MySQL every five minutes. That sounds like what you're doing, is it?

    Alan
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Basically yes :-). It just runs a little shell script which does more or less that.

    Allan
  • yutoyuto Posts: 1Questions: 0Answers: 0
    Hi, ashuers

    If you without Cron knowledge, using webcron service like easycron.com is a good alternative.
This discussion has been closed.