From: <php...@li...> - 2010-07-21 14:13:37
|
Hi, First off, if similar questions have been asked and answers provided previously on the mailing list I apologize for asking them again. I could not fine definite answers to some of these questions when thumbing through either examples, the source, or the mailing list archives. I'm building a tool, albeit somewhat as a science project and a convenience tool that integrates launching PHP processes from Ant. I actually am using it to launch Phing processes through Ant in Eclipse for my PHP development. I know that no matter what I do, performance will not be nearly as good as going straight to the PHP exe, but I'm still interested in pursuing this approach. Prior to looking at the PHP Java Bridge I have code that will launch PHP processes using Java's Runtime as an Ant task, however I was looking to see if: A) the PHP Java Bridge could be used so that I could clean up some of my code and re-use elements that have been developed to suit similar needs thus building on what is already out there. and B) to determine if the PHP Java Bridge (should it work, or at the very least its approach) is more efficient than what I was previously doing. I've run into a few snags though, so far as I can tell the PHP Java Bridge requires that the PHP executable be somewhere on the path as it is known by the OS through its environment variable(s) or on a path that the PJB has hard coded to look for it on (e.g. /usr/bin/php, or C:/Program Files/PHP). In addition I've found very little literature in the source code, examples, or on the mailing list that detail how a PHP process might be started with commandline arguments, and script arguments passed in. I have, however, been successful at launching a rather rudimentary example that effectively is "php-cgi.exe foo.php". 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 in, either by adding it to the common paths in Util.Process or by just searching on the path given? Even if this functionality isn't provided "out-of-the-box" so to speak, is there an class that is easily extensible that I could leverage to make it work in this manner (maybe a new ScriptEngine, Factory, Context?) 2. Does the PHP Java Bridge support setting command line arguments on the PHP executable (e.g. "-d foo=bar")? 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? 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? I was going a bit cross-eyed tracking the code where it gets executed and by whom. I didn't see any place where to set the path or arguments explicitly and I suspect I might want to tool around in the Context files, but have yet to get that far. Any help that someone would give would be really appreciated. Also, as an aside, I stumbled upon the LauncherWindows classes... and I'm not really sure what it is that they do. I mean, I can tell they are four parts of a binary file definition, but what binary? I'm curious. Thank you! (Note: I originally sent this before subscribing to the list and it got stuck in a "requires moderator approval" queue, so I resent it. Hopefully only one of the messages gets posted to the mailing list, if both do... I'm sorry!) Regards, Sean W. Quinn Email: sw...@gm... | Mobile: 978.413.9396 |