fRequest enhancements / Suggestions Anyone?

fRequest enhancements

Hi,
I just knew about this wonderful library. When i started to use it, I found some useful methods missing from fRequest class like isAjax() function which is used to determine if the request is made using AJAX request or not. The code for this function is simple:

function isAjax(){
    return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
}

Also, it will be better to add functions like getFromPost(), getFromUrl() [for get], getFromPut(),…etc. to get parameters from requests as it may be confusing to use the get() function only.

  • Message #545

    Yes, I am definitely planning on adding isAjax() to fRequest, it is just a matter of how much time I have and my priorities. The simpler something is to accomplish, the lower priority it is for me since it can easily be done the manual way.

    My intention with fRequest::get() is to provide a simple interface to safely get request data. If I provided four different methods I would be doing even less abstraction from the built-in superglobals and more just indirection. That, and it would be confusing for a developer to ever try to use the same field name for both a GET and POST parameter in the same request.

    • Message #550

      So, can I add isAjax() myself if you permit me. I mean add it to fRequest and submit it??

      • Message #564

        Yes, I can accept patches, you just need to sign and email me a contributor license agreement first. It is a legal document that says you are willing to license your code to other under the MIT license. It also helps to absolve myself or users of Flourish if you submit code that you don't have the legal right to license.

        • Message #573

          This exact enhancement was submitted in a ticket about 2 months ago: http://flourishlib.com/ticket/338.

          • Message #576

            Thanks for reminding me about that Alex.

            I definite have a bunch of little things I want to get done with Flourish, I've just been super busy with personal stuff and some freelance work. In addition, I reinstalled the server I was doing all of my development and testing on, so I need to get it all set up again so I can continue development. Hopefully I'll have all of the testing database servers set up today or tomorrow.

        • Message #574

          It is OK. I'd like to contribute in other parts of the project if I have sufficient time and experience.