Topic: Unique server file

Hi all,

I've implemented a unique-index-file-solution (mainly to get rid of the many exposed xajax files and functions) and it has been working pretty well.

It consists of a single file - index.xajax.php - with a main function - IndexXajax() - who are always registered/called and expect some arguments in order to decide to which controller/function send the requests. This way, I'm able to authenticate permission, do the common tasks, call the common javascript callback functions and handle errors  - even functional errors can be thrown on any script and handled, with a message to the user, seamlessly -  on the same script.

Now, all my tons of xajax functions are located on my controllers (protected from the web), secured, no-response-error-proof and I don't need even to instantiate xajax or define functions at the client side, as it's already done for every page at my built client side framework (who makes use of smarty).

Hence, i'm having a problem with the system's main config file - This is the first script called for every page, even non-ajax requests, and it handle every system errors, giving the user the appropriated feedback depending on the request made (www, xajax, web service, etc). The problem is that, as I don't have the xajax object instantiated and the $xajax->processRequest() function called at this point* (during the secure check at the config file), I'm not able to get the xajax parameters parsed, only the raw $_POST['xjxargs'].

My question is: what is the best way to parse the xjxargs array? I'm at version 0.5 and don't want to parse it manually to avoid problems with version updates.

If you need, I can send my code.

* if I catch an error at the config file on a xajax request, I let the execution continue and send the xajax response later, at the index.xajax.php file

Thanks and long live xajax!


Re: Unique server file

please help me to upload a file to server in xajax a example please thank you