cvs: phpdoc /en/reference/info/functions php-sapi-name.xml
| From: | Philip Olson | Date: | Mon, 29 Dec 2008 16:07:36 +0000 |
| Subject: | cvs: phpdoc /en/reference/info/functions php-sapi-name.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2867@lists.php.net to get a copy of this message | ||
philip Mon Dec 29 16:07:36 2008 UTC
Modified files:
/phpdoc/en/reference/info/functions php-sapi-name.xml
Log:
- Rewrote the docs
- Mentioned every [maybe] possible return value
- Explain tips/gotchas like apache may be apache/apache2handler/apache2filter
- More clearly refer to PHP_SAPI
- Clarify why the example checks the substring cgi
- Elude to cgi no longer being a value (cgi-fcgi is) as of 5.3
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/info/functions/php-sapi-name.xml?r1=1.12&r2=1.13&diff_format=u
Index: phpdoc/en/reference/info/functions/php-sapi-name.xml
diff -u phpdoc/en/reference/info/functions/php-sapi-name.xml:1.12
phpdoc/en/reference/info/functions/php-sapi-name.xml:1.13
--- phpdoc/en/reference/info/functions/php-sapi-name.xml:1.12 Wed Jun 20 22:24:48 2007
+++ phpdoc/en/reference/info/functions/php-sapi-name.xml Mon Dec 29 16:07:36 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.12 $ -->
+<!-- $Revision: 1.13 $ -->
<refentry xml:id="function.php-sapi-name" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>php_sapi_name</refname>
@@ -13,10 +13,11 @@
<void/>
</methodsynopsis>
<simpara>
- Returns a lowercase string which describes the type of interface between
- web server and PHP (Server API, SAPI). In CGI PHP, this string is "cgi",
- in <literal>mod_php</literal> for Apache, this string is "apache" and so
- on.
+ Returns a lowercase string that describes the type of interface
+ (the Server API, SAPI) that PHP is using. For example, in CLI PHP this
+ string will be "cli" whereas with Apache it may have several different
+ values depending on the exact SAPI used. Possible values are listed
+ below.
</simpara>
</refsect1>
@@ -25,6 +26,13 @@
<para>
Returns the interface type, as a lowercase string.
</para>
+ <para>
+ Although not exhaustive, the possible return values include
+ aolserver, apache, apache2filter, apache2handler, caudium,
+ cgi (until PHP 5.3), cgi-fcgi, cli, continuity, embed,
+ isapi, litespeed, milter, nsapi, phttpd, pi3web, roxen,
+ thttpd, tux, and webjames.
+ </para>
</refsect1>
<refsect1 role="examples">
@@ -32,6 +40,10 @@
<para>
<example>
<title><function>php_sapi_name</function> example</title>
+ <para>
+ This example checks for the substring <literal>cgi</literal>
+ because it may also be <literal>cgi-fcgi</literal>.
+ </para>
<programlisting role="php">
<![CDATA[
<?php
@@ -48,6 +60,25 @@
</para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <title>An alternative approach</title>
+ <para>
+ The PHP constant <constant>PHP_SAPI</constant> has the same value
+ as <function>php_sapi_name</function>.
+ </para>
+ </note>
+ <tip>
+ <title>A potential gotcha</title>
+ <para>
+ The defined <acronym>SAPI</acronym> may not be obvious, because for
+ example instead of <literal>apache</literal> it may be defined as
+ <literal>apache2handler</literal> or <literal>apache2filter</literal>.
+ </para>
+ </tip>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>