mirror of
https://github.com/php/doc-es.git
synced 2026-04-25 08:08:27 +02:00
5b1dc40a56
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@78203 c90b9560-bf6c-de11-be94-00142212c4b1
77 lines
3.0 KiB
XML
77 lines
3.0 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- splitted from ./es/functions/exec.xml, last change in rev 1.1 -->
|
|
<!-- last change to 'exec' in en/ tree in rev 1.2 -->
|
|
<refentry id="function.exec">
|
|
<refnamediv>
|
|
<refname>exec</refname>
|
|
<refpurpose>Ejecuta un programa externo</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descripción</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>exec</methodname>
|
|
<methodparam><type>string</type><parameter>command</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>array</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>return_var</parameter></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
<function>exec</function> ejecuta la orden indicada en
|
|
<parameter>command</parameter>, sin embargo no produce ninguna
|
|
salida. Simplemente devuelve la última línea de la salida resultado
|
|
de la orden. Si necesita ejecutar una orden y obtener directamente
|
|
todos los datos devueltos por la orden sin ninguna interferencia,
|
|
use la función <function>PassThru</function>.
|
|
</para>
|
|
<para>
|
|
Si el parámetro <parameter>array</parameter> existe, entonces el
|
|
array especificado se rellenará con cada una de las líneas de la
|
|
salida producida por la orden. Notar que si el array ya contiene
|
|
algunos elementos, <function>exec</function> los añadirá al final del
|
|
array. Si no quiere que la función añada dichos elementos, haga un
|
|
<function>unset</function> sobre el array antes de pasárselo a
|
|
<function>exec</function>.</para>
|
|
<para>
|
|
Si el parámetro <parameter>return_var</parameter> existe a la vez
|
|
que el parámetro <parameter>array</parameter>, entonces el valor de
|
|
retorno de la orden ejecutada se guardará en dicha variable.
|
|
</para>
|
|
<para>
|
|
Destacar que si usted va a permitir que se pasen datos provenientes
|
|
de usuarios a esta función, entonces debería usar
|
|
<function>EscapeShellCmd</function> para asegurarse de que los
|
|
usuarios no pueden engañar al sistema para ejecutar instrucciones
|
|
arbitrarias.
|
|
</para>
|
|
|
|
<para>
|
|
Véase también <function>system</function>,
|
|
<function>PassThru</function>, <function>popen</function>,
|
|
<function>EscapeShellCmd</function>, y el <link
|
|
linkend="language.operators.execution">operador ` (apóstrofe
|
|
invertido)</link>.
|
|
</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:"../../../../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
|
|
-->
|