mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +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: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.php-sapi-name" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>php_sapi_name</refname>
|
|
<refpurpose>Devuelve el tipo de interfaz utilizada entre el servidor web y 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>
|
|
Devuelve una cadena en minúsculas que describe el tipo de interfaz
|
|
(la API, SAPI del servidor) que PHP utiliza. Por ejemplo, en PHP CLI,
|
|
esta cadena será "cli" mientras que con Apache, puede tener
|
|
varios valores diferentes según el SAPI exacto utilizado.
|
|
Las posibles valores se listan a continuación.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
&no.function.parameters;
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el tipo de la interfaz, en forma de
|
|
&string; en minúsculas, &return.falseforfailure;.
|
|
</para>
|
|
<para>
|
|
A continuación se muestra una lista no exhaustiva de los posibles valores :
|
|
<literal>apache</literal>,
|
|
<literal>apache2handler</literal>,
|
|
<literal>cgi</literal> (hasta 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>Ejemplo con <function>php_sapi_name</function></title>
|
|
<para>
|
|
Este ejemplo busca la subcadena <literal>cgi</literal>
|
|
ya que también puede ser <literal>cgi-fcgi</literal>.
|
|
</para>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$sapi_type = php_sapi_name();
|
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
|
echo "Se utiliza CGI PHP\n";
|
|
} else {
|
|
echo "No se utiliza CGI PHP\n";
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<title>Un enfoque alternativo</title>
|
|
<para>
|
|
La constante PHP <constant>PHP_SAPI</constant> tiene un valor
|
|
idéntico a <function>php_sapi_name</function>.
|
|
</para>
|
|
</note>
|
|
<tip>
|
|
<title>Un comportamiento inesperado</title>
|
|
<para>
|
|
El <acronym>SAPI</acronym> definido no debe ser ambiguo, ya que
|
|
por ejemplo, en lugar de <literal>apache</literal>, puede ser
|
|
definido como <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
|
|
-->
|