Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Jochem Maas
Micah Gersten schreef: You can rename the php executable and replace it with a shell script that logs what is run. true, but that still wouldn't get me the pipe, besides which one day someone will figure out that it's not the actual executable and either: 1. recompile and install php (shell sc

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Jochem Maas
David Otton schreef: 2008/8/29 Jochem Maas <[EMAIL PROTECTED]>: in what sense won't it work? the complete line is in the output of ps somewhere albeit after wildcard/shell expansion. With the pipe? I'd really like to see an example, beacuse I couldn't coax it out of ps, and it might be handy

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Jochem Maas
Robert Cummings schreef: On Fri, 2008-08-29 at 15:36 -0400, Robert Cummings wrote: On Fri, 2008-08-29 at 20:42 +0200, Jochem Maas wrote: Robert Cummings schreef: On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Robert Cummings
On Fri, 2008-08-29 at 15:36 -0400, Robert Cummings wrote: > On Fri, 2008-08-29 at 20:42 +0200, Jochem Maas wrote: > > Robert Cummings schreef: > > > On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: > > >> Micah Gersten schreef: > > >>> I suggest creating a shell wrapper for PHP that will write

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Robert Cummings
On Fri, 2008-08-29 at 20:42 +0200, Jochem Maas wrote: > Robert Cummings schreef: > > On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: > >> Micah Gersten schreef: > >>> I suggest creating a shell wrapper for PHP that will write the command > >>> to a file for you and then call PHP with the appr

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Micah Gersten
You can rename the php executable and replace it with a shell script that logs what is run. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jochem Maas wrote: > David Otton schreef: >> >> Quote the entire command as a string. Pass it to a shell script that >>

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread David Otton
2008/8/29 Jochem Maas <[EMAIL PROTECTED]>: > in what sense won't it work? the complete line is in the output of ps > somewhere > albeit after wildcard/shell expansion. With the pipe? I'd really like to see an example, beacuse I couldn't coax it out of ps, and it might be handy someday. > if life

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Jochem Maas
Stut schreef: On 29 Aug 2008, at 19:46, Jochem Maas wrote: David Otton schreef: 2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: 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 o

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Stut
On 29 Aug 2008, at 19:46, Jochem Maas wrote: David Otton schreef: 2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: 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 p

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Jochem Maas
David Otton schreef: 2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: 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

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread Jochem Maas
Robert Cummings schreef: On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you origi

Re: [PHP] grab the complete commandline used ...

2008-08-29 Thread David Otton
2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: > 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. :-) T

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Robert Cummings
On Fri, 2008-08-29 at 04:48 +0200, Jochem Maas wrote: > Micah Gersten schreef: > > I suggest creating a shell wrapper for PHP that will write the command > > to a file for you and then call PHP with the appropriate arguments. PHP > > won't even see most of the command that you originally posted. >

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Jochem Maas
Micah Gersten schreef: I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you originally posted. which wouldn't catch the pipe to grep now would it. nevermind, I

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Micah Gersten
I suggest creating a shell wrapper for PHP that will write the command to a file for you and then call PHP with the appropriate arguments. PHP won't even see most of the command that you originally posted. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Joch

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Jochem Maas
David Otton schreef: 2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: 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 .

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Jochem Maas
Robert Cummings schreef: On Thu, 2008-08-28 at 10:22 -0500, Micah Gersten wrote: Does this work? $command = implode(' ', $argv); no syntax errors, so in that sense it works. but it doesn't answer my question (check the body of the post as well as the subject and that might become clear). Onl

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread David Otton
2008/8/28 Jochem Maas <[EMAIL PROTECTED]>: > 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

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Robert Cummings
On Thu, 2008-08-28 at 10:22 -0500, Micah Gersten wrote: > Does this work? > $command = implode(' ', $argv); Only do it that way if it's for a log of general output. If you're going to punt any of those parts back to the OS in another command you'll need to properly escape them. Cheers, Rob. -- h

Re: [PHP] grab the complete commandline used ...

2008-08-28 Thread Micah Gersten
Does this work? $command = implode(' ', $argv); http://us2.php.net/manual/en/reserved.variables.argv.php Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jochem Maas wrote: > hiya, > > anyone know if it's possible to grab the entire commandline > that was us

[PHP] grab the complete commandline used ...

2008-08-28 Thread Jochem Maas
hiya, 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 [EMAIL PROTECTED] -f ./last.log | grep E