Ajax and Xaraya
- From: Brian Bain <xaraya (at) tefen.net>
- Date: Fri, 08 Dec 2006 07:07:51 -0800
alal wrote:
> Hi all
>
> I'm playing around with using some Ajax on site. I want the http request to
> query a php script that looks up some data in the xaraya database and
> returns it.
>
> I create an Ajax request object that sends a query to the server. The server
> script needs to load enough of Xaraya to access the database (and do some
> authentication checks) but I don't really want to load the whole of Xaraya
> each time I make a httprequest.
>
> So, what is the easiest way of getting enough of Xaraya to access the
> database?
>
> (I'll be more specific. I want to get a list of registered users, so I want
> to call Roles -> UserAPI -> getall (or getactive) ).
>
> TIA
> jalal
> _______________________________________________
> Xaraya_devel mailing list
> Xaraya_devel (at) xaraya.com
> http://xaraya.com/mailman/listinfo/xaraya_devel
>
I've been working with AJAX on Xaraya, but for my responses I've simply
created an AJAX theme (which outputs valid xml) and go through the
normal route, loading the entire core.
You have a good point though about the overhead, in the past I've crated
my own scripts that sat along side the index.php and contained the
following:
<?
xarCoreInit(XARCORE_SYSTEM_ADODB|XARCORE_SYSTEM_MODULES);
//The rest of your script
xarModAPIFunc(....);
etc...
?>
The xarCoreInit line tells the system to load the database (ADODB) and
module apis. (A list of available apis to load are in the
/includes/xarCore.php script.)
I'm not too familiar with the ws.php script that exists in the root
directory, but it was intended for "WebServices" which really should
include ajax requests I would think.
Brian
j
>
_______________________________________________
Xaraya_devel mailing list
Xaraya_devel (at) xaraya.com
http://xaraya.com/mailman/listinfo/xaraya_devel