Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56835 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61433 invoked from network); 7 Dec 2011 17:45:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Dec 2011 17:45:42 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:57954] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/11-54298-446AFDE4 for ; Wed, 07 Dec 2011 12:45:41 -0500 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id C0F9510DBA7; Wed, 7 Dec 2011 17:45:37 +0000 (GMT) Date: Wed, 7 Dec 2011 09:45:36 -0800 (PST) X-X-Sender: derick@whisky.home.derickrethans.nl To: Sebastian Bergmann cc: internals@lists.php.net In-Reply-To: <4EDF1433.4050604@php.net> Message-ID: References: <4EDF1433.4050604@php.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Bug #54514 From: derick@php.net (Derick Rethans) 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