[development] Bridging PHP to Java or C++?

Darrel O'Pry dopry at thing.net
Sat Dec 31 17:54:54 UTC 2005


One option to consider is making the ML code run external to drupal.
Maybe call php from the command line to invoke enough of drupal for node
loading to feed you ML algorithms, and write the results back to the
database... So you can setup a drupal module to configure your ML
algorithms and to deal with the data it writes back to the database for
use in the CMS.... 

It would basically be a a middleware module to interface with an
external app, plus the external app... might not be so joe-blow ISP
friendly, but I think people using machine learning with their drupal
site probably want a little more control over their application
environment than the typical shared hosting account provides.




On Wed, 2005-12-28 at 16:36 -0600, Mark Fredrickson wrote:
> to PHP (and specifically to Drupal)?
> > 
> > Writng a PHP extension is probably easier in C. Insofar, I have not seen
> > any Java extension.
> > 
> http://php-java-bridge.sourceforge.net/
> 
> And there is also a deprecated ext/java extension for PHP <= 4.3
> 
> These also have the advantage of _already_ being a PHP extension to use
> existing Java bytecode. Instead of a necessitating me to write an extension,
> I can just glue the bridge to the Weka toolkit in PHP.
> 
> > and you make Java mandatory on the server. That's not a good idea.
> > 
> What is more likely: a hosting service providing a JVM or providing a C/C++
> compiler? 
> 
> For what it is worth, my host (NearlyFreeSpeech.Net) has gcc but not javac
> (or at least I couldn't find it in 5 minutes of looking - I haven't asked
> tech support yet). I don't know if this typical.
> 
> > Very few if any module require any PHP extension which is not in the PHP
> > core. Some reuqire a few scripts that are in PEAR like simpletest, but
> > that's rare. But scripts are not extensions.
> > 
> 
> Well, until someone codes a ML library in PHP I do not see much of an
> option. Given the choice between producing a working (though difficult to
> install) module or spending a lot of effort on re-inventing the wheel, I'll
> choose the former.
> 
> :-)
> 
> -M
> 
> 



More information about the development mailing list