From: <php...@li...> - 2010-07-22 01:48:42
|
Hi Jost, Thanks for the quick reply. Also--if for some reason this creates a new thread... I'm REALLY sorry. I don't have a tendency to interact with a lot of SourceForge projects lately and I couldn't exactly figure out the proper way to reply to you response. I figured that if the mailman system were smart it'd pick up on the fact that I added the same subject, but prefix "Re:" to it and thread it in properly. Once again, sorry if I created a new thread on this by accident. =/ > why don't you simply use an Ant exec task. The build.xml shipped with > the JavaBridge source code uses this, too. There was some reason I wasn't doing this. But honestly--I can't remember now. Maybe it was just because I was being stubborn. Who knows. Obviously you point out a very simple and obvious solution for my woes. One which I should not ignore. Of course, now that I'm knee deep in the code I want to play. So at least I have a fall back solution. Thank you for pointing it out! >> So my questions are these: >> 1. Does the PHP Java Bridge support some means of identifying the location >> that it should search for an PHP executable... [/snip] > > You can use -Dphp.java.bridge.php_exec=/path/to/php-cgi.exe if php-cgi > is not in the PATH. Please see php.java.bridge.global.properties file > and our FAQ entry "How can I configure the bridge?" > >> 2. Does the PHP Java Bridge support setting command line arguments on the >> PHP executable (e.g. "-d foo=bar")? [/snip] > > Yes, please see PHP_EXEC_ARGS from the > php.java.bridge.global.properties file and our FAQ entry "How can I > configure the bridge?" I must have some how missed the FAQ entry on configuring the bridge. I'll double check that out. Thank you so much for pointing it out to me! >> 3. Does the PHP Java Bridge support setting script level arguments? Again, >> if it does not, is there any way to extend existing classes to add this >> functionality and if so what classes should I look at? > > What are script-level arguments? Do you mean JSR 223 bindings? Please > see the JSR 223 specification for details. What I mean by "script level arguments" (the term is probably incorrect) are those arguments that you pass in as parameters to the script being run. Sort of like the main()'s argc/argv arguments. For instance, the phing.php script takes a couple of arguments to determine what it should run (like Ant): -buildfile build.xml task. These are what I'm referring to as "script level" arguments. > (new ScriptEngineManager()).getEngineByName("php").eval("<?php exit(1+2);"); > > is just a glorified version of System.exec(...), as long as you don't > decorate the standard ScriptContext. So it isn't very useful for your > task. Thats very good to know. Thank you Jost for your prompt and very helpful reply! Off to go play in the code pit! Regards, Sean W. Quinn |