Re: grab the complete commandline used ...

From: Date: Fri, 29 Aug 2008 02:48:35 +0000
Subject: Re: grab the complete commandline used ...
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-278933@lists.php.net to get a copy of this message
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 don't think you ge what I was looking for, not worry I can hack together a 'solution' using exec() ... by grepping the output of ps.
Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jochem Maas wrote:
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).
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.
true, and yes it's for a log and no join(' ', $argv); doesn't cut it :-)
Cheers, Rob.


« previous php.general (#278933) next »