Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45912 invoked from network); 31 Mar 2011 09:31:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2011 09:31:37 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.212.173 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.212.173 mail-px0-f173.google.com Received: from [209.85.212.173] ([209.85.212.173:39686] helo=mail-px0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/F3-16878-7F9449D4 for ; Thu, 31 Mar 2011 04:31:37 -0500 Received: by pxi16 with SMTP id 16so561369pxi.18 for ; Thu, 31 Mar 2011 02:31:32 -0700 (PDT) Received: by 10.142.250.32 with SMTP id x32mr1186272wfh.57.1301563891819; Thu, 31 Mar 2011 02:31:31 -0700 (PDT) Received: from [192.168.200.140] (c-76-126-236-132.hsd1.ca.comcast.net [76.126.236.132]) by mx.google.com with ESMTPS id n4sm1279140wfl.2.2011.03.31.02.31.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 Mar 2011 02:31:30 -0700 (PDT) Message-ID: <4D9449F0.6070903@lerdorf.com> Date: Thu, 31 Mar 2011 02:31:28 -0700 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: RQuadling@googlemail.com CC: Richard Quadling , PHP internals References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Determine the name of the PHP SAPI module. From: rasmus@lerdorf.com (Rasmus Lerdorf) #include "SAPI.h" and then you will have the name in the global sapi_module struct: sapi_module.name -Rasmus On 03/31/2011 02:24 AM, Richard Quadling wrote: > Hi. > > From a CLI/CGI perspective, the following code returns the full path > of the php.exe file. > > DWORD len; > char buf[MAX_PATH]; > > len = GetModuleFileName(NULL, buf, sizeof(buf)); > buf[len] = '\0'; > > > If PHP is loaded as a module, how do you determine the filename of the > module. I'm guessing the above code would return Apache or IIS (if > using ISAPI), etc. > > Is there a global property available for this (or for the above code)? > > Richard. >