Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51761 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51362 invoked from network); 31 Mar 2011 10:07:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2011 10:07:12 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.177 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.177 mail-qy0-f177.google.com Received: from [209.85.216.177] ([209.85.216.177:43017] helo=mail-qy0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/84-16878-F42549D4 for ; Thu, 31 Mar 2011 05:07:12 -0500 Received: by qyl38 with SMTP id 38so1638103qyl.8 for ; Thu, 31 Mar 2011 03:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=wIM2cXGzCdJSZOMTAgDKFzphvGcMXccSrtj2dNn8UXY=; b=MrsGJM9towqZq2uhb6CrCXEvishKIkXWYGuenq3F35jjRGOArf82u7015gf5At7nlL THgxd5EjlJAzCW+F0BqPXSOG3Ope9tj3Gn5Y7ioanZ46rTTU7Rv0Y+jGVGyWFf27L2WZ INf+U7WkW/HmDudwq4rE6aJXboenN2WbiVpW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=i2/1sfFygofxJzJDiUOelfgb7uFO30AKhL1+0v+T+uHXeBD8LF7Ia7IPiHILnZSdT/ uYumacf+GhEpeBIw0J5iXZnqGszM8gTx/lw9VTRDNIBu0/rsxv4DIRabRJDIMbWfk3hp apNXheG8Kz8tZYe2vMSaZhIhO2DhWY8KHl0q0= Received: by 10.229.37.130 with SMTP id x2mr2028792qcd.147.1301566029213; Thu, 31 Mar 2011 03:07:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.40.147 with HTTP; Thu, 31 Mar 2011 03:06:49 -0700 (PDT) Reply-To: RQuadling@googlemail.com In-Reply-To: <4D9449F0.6070903@lerdorf.com> References: <4D9449F0.6070903@lerdorf.com> Date: Thu, 31 Mar 2011 11:06:49 +0100 Message-ID: To: Rasmus Lerdorf Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Determine the name of the PHP SAPI module. From: rquadling@gmail.com (Richard Quadling) On 31 March 2011 10:31, Rasmus Lerdorf wrote: > #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. >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DWORD len; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 char buf[MAX_PATH]; >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 len =3D GetModuleFileNa= me(NULL, buf, sizeof(buf)); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[len] =3D '\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. Thank you. --=20 Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY