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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to