phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-developers] Re: [OpenSync] a way to make a language wrappe


From: Dave Hall
Subject: [Phpgroupware-developers] Re: [OpenSync] a way to make a language wrapper
Date: Sat, 24 Jul 2004 08:14:57 +1000

Hi Armin,

This seems like a nice solution.  

One thing it doesn't seem to cope well with is php.  AFAIK it is not
possible to do something like this for php.

A possible solution - PHP (and phpgroupware) supports xmlrpc, so it
would be possible to communicate php based applications via xmlrpc.  The
solution you have outlined would allow developers to write the php
xmlrpc plugin layer in whatever language they were most comfortable
with.  You could of course go straight to db, but that would mean
duplicate all of the application's logic in another language, which
seems to me to be a waste of time.

Cheers

Dave

On Sat, 2004-07-24 at 07:42, Armin Bauer wrote:
> Hi,
> 
> i looked more into detail how plugins could be written in other
> languages.
> 
> Here is how it could work (Phyton taken as example):
> 
> OpenSync gets a request to load a plugin. It detects that the plugin is
> not a shared library. It then loads the appropriate language wrapper.
> The language wrapper is installed seperatly of the the main opensync
> package, to avoid the depencies.
> 
> The language wrapper then initializes a python interpreter, takes the
> name of the script and calls the neccessary functions in this script:
> 
> Py_Initialize();
> //this initializes the interpreter
> 
> pName = PyString_FromString(scriptname); 
> pModule = PyImport_Import(pName);
> // this would load the script
> 
> pValue = PyObject_CallObject(pFunc, pArgs);
> //this would call a function in the script
> 
> for the complete code you can take a look at 
> http://docs.python.org/ext/embedding.html
> it is even possible to call c functions from the python script.
> So i think it meets all our requirements.
> 
> The same is possible for java.
> 
> Armin
> 
> _______________________________________________
> opensync mailing list
> address@hidden
> http://freedesktop.org/mailman/listinfo/opensync





reply via email to

[Prev in Thread] Current Thread [Next in Thread]