Re: grab the complete commandline used ...
| From: | Jochem Maas | Date: | Thu, 28 Aug 2008 21:13:09 +0000 |
| Subject: | Re: grab the complete commandline used ... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-278920@lists.php.net to get a copy of this message | ||
David Otton schreef:
2008/8/28 Jochem Maas <jochem@iamjochem.com>:I have a feeling I'm out of luck - probably security issues that keep you from doing such a thing as well. I did have the idea of grabbing the PID and then grepping the output of ps via exec() ... that would do it, but I reckon it smells. :-)anyone know if it's possible to grab the entire commandline that was used to start up a php script on the CLI, an example of what I'm looking to grab from within the script (test.php in this example): "php -qC -ddisplay_errors=1 ./test.php -o -d -e jochem@iamjochem.com -f ./last.log | grep Exception" of course I know what the script name and arguments are but I'd rather like the whole enchilada (php binary and it's args + the pipe to grep). possible? bad idea? down boy?Not possible, I'm afraid. Certainly not portably. The command line is manipulated quite heavily before your script gets run. (eg shell wildcard expansions).
A quick Google suggests that it is possible under VMS, but I doubt that's much use to you.STW wasn't giving me any joy either, it's for linux only (although it would be nice if it worked on my Mac)