Re: Bug #54514
| From: | Derick Rethans | Date: | Wed, 07 Dec 2011 17:45:36 +0000 |
| Subject: | Re: Bug #54514 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56835@lists.php.net to get a copy of this message | ||
On Wed, 7 Dec 2011, Sebastian Bergmann wrote:
> Can somebody look into https://bugs.php.net/bug.php?id=54514
> please?
> This causes issues for CLI tools implemented in PHP that are invoked
> through Apache Ant, for instance, and need to know the PHP interpreter
> that is running them.
>
> See https://github.com/sebastianbergmann/phpunit/issues/432
> for an
> example of how this affects PHPUnit.
I've code to do this on Windows:
#if WIN32
PHP_FUNCTION(get_php_process)
{
char filename[1024];
GetModuleFileName(NULL, filename, 1024);
RETURN_STRING(filename, 1)
}
#endif
On linux, we currently do:
$pid = getmypid();
$process = "/proc/{$pid}/exe"
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug