mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-24 08:52:09 +01:00
123 lines
3.4 KiB
XML
123 lines
3.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 8dd14a886c7e954cef181c374b6f05cc7149e643 Maintainer: dams Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.php-sapi-name" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>php_sapi_name</refname>
|
|
<refpurpose>Retourne le type d'interface utilisée entre le serveur web et PHP</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>string</type><type>false</type></type><methodname>php_sapi_name</methodname>
|
|
<void/>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Retourne une chaîne en minuscule qui décrit le type d'interface
|
|
(l'API, SAPI serveur) que PHP utilise. Par exemple, en PHP CLI,
|
|
cette chaîne sera "cli" tandis qu'avec Apache, elle pourra avoir
|
|
plusieurs valeurs différentes suivant le SAPI exact utilisé.
|
|
Les valeurs possibles sont listées ci-dessous.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Retourne le type de l'interface, sous la forme d'une
|
|
&string; en minuscule, &return.falseforfailure;.
|
|
</para>
|
|
<para>
|
|
Voici une liste non exhaustive des valeurs possibles :
|
|
<literal>apache</literal>,
|
|
<literal>apache2handler</literal>,
|
|
<literal>cgi</literal> (jusqu'en PHP 5.3),
|
|
<literal>cgi-fcgi</literal>, <literal>cli</literal>, <literal>cli-server</literal>,
|
|
<literal>embed</literal>, <literal>fpm-fcgi</literal>,
|
|
<literal>litespeed</literal>,
|
|
<literal>phpdbg</literal>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>php_sapi_name</function></title>
|
|
<para>
|
|
Cet exemple cherche la sous-chaîne <literal>cgi</literal>
|
|
car elle peut également valoir <literal>cgi-fcgi</literal>.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$sapi_type = php_sapi_name();
|
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
|
echo "Vous utilisez CGI PHP\n";
|
|
} else {
|
|
echo "Vous n'utilisez pas CGI PHP\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<title>Une approche alternative</title>
|
|
<para>
|
|
La constante PHP <constant>PHP_SAPI</constant> a une valeur
|
|
identique à <function>php_sapi_name</function>.
|
|
</para>
|
|
</note>
|
|
<tip>
|
|
<title>Un comportement inattendu</title>
|
|
<para>
|
|
Le <acronym>SAPI</acronym> défini ne doit pas être ambigu, car
|
|
par exemple, au lieu de <literal>apache</literal>, il peut être
|
|
défini à <literal>apache2handler</literal>.
|
|
</para>
|
|
</tip>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><link linkend="reserved.constants.core">PHP_SAPI</link></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|