cvs: phpdoc-es / translation.xml /reference/errorfunc/functions debug-backtrace.xml debug-print-backtrace.xml /reference/exec/functions
proc-get-status.xml proc-open.xml
| From: | Leonardo Boshell | Date: | Mon, 10 Nov 2003 22:23:50 +0000 |
| Subject: | cvs: phpdoc-es / translation.xml /reference/errorfunc/functions debug-backtrace.xml debug-print-backtrace.xml /reference/exec/functions proc-get-status.xml proc-open.xml |
||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-398@lists.php.net to get a copy of this message | ||
lboshell Mon Nov 10 17:23:50 2003 EDT
Added files:
/phpdoc-es/reference/errorfunc/functions debug-backtrace.xml
debug-print-backtrace.xml
/phpdoc-es/reference/exec/functions proc-get-status.xml
proc-open.xml
Modified files:
/phpdoc-es translation.xml
Log:
Nuevos archivos de referencia de depuracion. Asignacion de nuevo trabajo
Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.81 phpdoc-es/translation.xml:1.82 --- phpdoc-es/translation.xml:1.81 Mon Nov 10 01:44:09 2003 +++ phpdoc-es/translation.xml Mon Nov 10 17:23:49 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.81 $ --> +<!-- $Revision: 1.82 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -44,9 +44,10 @@ <file name="reference/dio/functions/dio-tcsetattr.xml" person="javi" type="translation" date="09.11.2003"/> <file name="reference/dio/functions/dio-truncate.xml" person="javi" type="translation" date="09.11.2003"/> <file name="reference/dio/functions/dio-write.xml" person="javi" type="translation" date="09.11.2003"/> -<file name="reference/errorfunc/functions/debug-backtrace.xml" person="lboshell" type="translation" date="10.11.2003"/> -<file name="reference/errorfunc/functions/debug-print-backtrace.xml" person="lboshell" type="translation" date="10.11.2003"/> -<file name="reference/exec/functions/proc-get-status.xml" person="lboshell" type="translation" date="10.11.2003"/> -<file name="reference/exec/functions/proc-open.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/escapeshellarg.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/proc-close.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/proc-nice.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/proc-terminate.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/shell-exec.xml" person="lboshell" type="translation" date="10.11.2003"/> </work-in-progress> </translation> Index: phpdoc-es/reference/errorfunc/functions/debug-backtrace.xml +++ phpdoc-es/reference/errorfunc/functions/debug-backtrace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <refentry id="function.debug-backtrace"> <refnamediv> <refname>debug_backtrace</refname> <refpurpose> Genera un backtrace </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>array</type><methodname>debug_backtrace</methodname> <void/> </methodsynopsis> <para> <function>debug_backtrace</function> genera un backtrace PHP y devuelve esta información como un <type>array</type> asociativo. Los elementos posiblemente devueltos son referenciados en la siguiente tabla: </para> <para> <table> <title>Elementos posiblemente devueltos por <function>debug_backtrace</function></title> <tgroup cols="3"> <thead> <row> <entry>Nombre</entry> <entry>Tipo</entry> <entry>Descripción</entry> </row> </thead> <tbody> <row> <entry>function</entry> <entry><type>string</type></entry> <entry> El nombre de la función actual. Vea también <link linkend="language.constants.predefined">__FUNCTION__</link>. </entry> </row> <row> <entry>line</entry> <entry><type>integer</type></entry> <entry> El número de línea actual. Vea también <link linkend="language.constants.predefined">__LINE__</link>. </entry> </row> <row> <entry>file</entry> <entry><type>string</type></entry> <entry> El nombre del archivo actual. Vea también <link linkend="language.constants.predefined">__FILE__</link>. </entry> </row> <row> <entry>class</entry> <entry><type>string</type></entry> <entry> El nombre de la <link linkend="language.oop">clase</link> actual. Vea también <link linkend="language.constants.predefined">__CLASS__</link> </entry> </row> <row> <entry>type</entry> <entry><type>string</type></entry> <entry> El tipo de clase actual. </entry> </row> <row> <entry>args</entry> <entry><type>array</type></entry> <entry> Si se encuentra al interior de una función, contiene una lista de los argumentos de la función. Si se encuentra al interior de un archivo de inclusión, contiene una lista de los nombres de archivos incluídos. </entry> </row> </tbody> </tgroup> </table> </para> <para> El siguiente es un ejemplo sencillo. </para> <para> <example> <title> Ejemplo de <function>debug_backtrace</function> </title> <programlisting role="php"> <![CDATA[ // nombre de archivo: a.php <?php function prueba_a($cadena) { print "\nHola: $cadena"; var_dump(debug_backtrace()); } prueba_a('amigo'); ?> // nombre de archivo: b.php <?php include_once '/tmp/a.php'; ?> ]]> </programlisting> <para> Resultados de ejecutar /tmp/b.php: </para> <screen> <![CDATA[ Hola: amigo array(2) { [0]=> array(4) { ["file"] => string(10) "/tmp/a.php" ["line"] => int(10) ["function"] => string(8) "prueba_a" ["args"]=> array(1) { [0] => &string(5) "amigo" } } [1]=> array(4) { ["file"] => string(10) "/tmp/b.php" ["line"] => int(2) ["args"] => array(1) { [0] => string(10) "/tmp/a.php" } ["function"] => string(12) "include_once" } } ]]> </screen> </example> </para> <para> Vea también <function>trigger_error</function> y <function>debug_print_backtrace</function>. </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 --> Index: phpdoc-es/reference/errorfunc/functions/debug-print-backtrace.xml +++ phpdoc-es/reference/errorfunc/functions/debug-print-backtrace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: lboshell Status: ready --> <refentry id="function.debug-print-backtrace"> <refnamediv> <refname>debug_print_backtrace</refname> <refpurpose> Imprime un backtrace </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>void</type><methodname>debug_print_backtrace</methodname> <void/> </methodsynopsis> <para> <function>debug_print_backtrace</function> imprime un backtrace PHP. </para> &warn.undocumented.func; <para> Vea también <function>debug_backtrace</function>. </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 --> Index: phpdoc-es/reference/exec/functions/proc-get-status.xml +++ phpdoc-es/reference/exec/functions/proc-get-status.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <refentry id='function.proc-get-status'> <refnamediv> <refname>proc_get_status</refname> <refpurpose> Obtiene información sobre un proceso abierto por <function>proc_open</function> </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>array</type><methodname>proc_get_status</methodname> <methodparam><type>resource</type><parameter>proceso</parameter></methodparam> </methodsynopsis> <para> <function>proc_get_status</function> recupera información sobre un proceso abierto mediante el uso de <function>proc_open</function>. Los datos recolectados son devueltos en una matriz que contiene los siguientes elementos: </para> <informaltable> <tgroup cols="3"> <thead> <row><entry>elemento</entry><entry>tipo</entry><entry>descripción</entry></row> </thead> <tbody> <row> <entry>command</entry> <entry><type>string</type></entry> <entry>la cadena del comando que fue pasada a <function>proc_open</function></entry> </row> <row> <entry>pid</entry> <entry><type>int</type></entry> <entry>id del proceso</entry> </row> <row> <entry>running</entry> <entry><type>bool</type></entry> <entry> &true; si el proceso aun está siendo ejecutado, &false; si ha terminado </entry> </row> <row> <entry>signaled</entry> <entry><type>bool</type></entry> <entry> &true; si el proceso hijo ha sido terminado por una señal no atrapada. En windows, este valor siempre es &false;. </entry> </row> <row> <entry>stopped</entry> <entry><type>bool</type></entry> <entry> &true; si el proceso hijo fue detenido por una señal. En windows, este valor siempre es &false;. </entry> </row> <row> <entry>exitcode</entry> <entry><type>int</type></entry> <entry> el código de salida devuelto por el proceso (el cual tiene sentido únicamente si <literal>running</literal> es &false;) </entry> </row> <row> <entry>termsig</entry> <entry><type>int</type></entry> <entry> el número de la señal que causó que el proceso hijo finalizara su ejecución (sólo tiene sentido si <literal>signaled</literal> es &true;) </entry> </row> <row> <entry>stopsig</entry> <entry><type>int</type></entry> <entry> el número de la señal que causó que el proceso hijo detuviera su ejecución (sólo tiene sentido si <literal>stopped</literal> es &true;) </entry> </row> </tbody> </tgroup> </informaltable> <para> Vea también <function>proc_open</function>. </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 --> Index: phpdoc-es/reference/exec/functions/proc-open.xml +++ phpdoc-es/reference/exec/functions/proc-open.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/exec.xml, last change in rev 1.28 --> <refentry id='function.proc-open'> <refnamediv> <refname>proc_open</refname> <refpurpose> Ejecutar un comando y abrir apuntadores de archivo para entrada/salida </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>resource</type><methodname>proc_open</methodname> <methodparam><type>string</type><parameter>cmd</parameter></methodparam> <methodparam><type>array</type><parameter>espec_descriptor</parameter></methodparam> <methodparam><type>array</type><parameter>pipes</parameter></methodparam> </methodsynopsis> <para> <function>proc_open</function> es similar a <function>popen</function> pero provee un grado de control mucho mayor sobre la ejecución del programa. <parameter>cmd</parameter> es el comando a ser ejecutado por el intérprete de comandos. <parameter>espec_descriptor</parameter> es una matriz indexada en donde la clave representa el número de descriptor y el valor representa el modo como PHP pasará ese descriptor al proceso hijo. <parameter>pipes</parameter> será definido como una matriz indexada de apuntadores a archivo que corresponden a los puntos de comunicación con PHP de todo pipe que sea creado. El valor de retorno es un recurso que representa el proceso; usted debe liberarlo usando <function>proc_close</function> una vez haya terminado de usarlo. </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ <?php $espec_descriptor = array( 0 => array("pipe", "r"), // stdin es un pipe usado por el hijo para lectura 1 => array("pipe", "w"), // stdout es un pipe usado por el hijo para escritura 2 => array("file", "/tmp/error-output.txt", "a") // stderr es un archivo para escritura ); $proceso = proc_open("php", $espec_descriptor, $pipes); if (is_resource($proceso)) { // $pipes ahora luce de esta forma: // 0 => gestor de escritura conectado con la entrada estandar del hijo // 1 => gestor de lectura conectado con la salida estandar del hijo // Cualquier mensaje de salida de error sera adicionado a /tmp/error-output.txt fwrite($pipes[0], "<?php echo \"¡Hola mundo!\"; ?>"); fclose($pipes[0]); while(!feof($pipes[1])) { echo fgets($pipes[1], 1024); } fclose($pipes[1]); // Es importante que cierre todos los pipes antes de llamar // proc_close para evitar un bloqueo muerto $retval = proc_close($proceso); echo "el comando ha devuelto $retval\n"; } ?> ]]> </programlisting> </informalexample> </para> <para> Los números de descriptor de archivo en <parameter>espec_descriptor</parameter> no están limitados a 0, 1 y 2 - usted puede especificar cualquier número de descriptor de archivo válido y éste será pasado al proceso hijo. Esto le permite a su script interoperar con otros scripts que corran como "co-procesos". En particular, esto es útil para pasar contraseñas a programas como PGP, GPG y openssl en un modo más seguro. También es útil para la lectura de información de status entregada por aquellos programas en descriptores de archivo auxiliares. </para> <note> <para> Compatibilidad con windows: Los descriptores más allá de 2 (stderr) son entregados al proceso hijo como gestores heredables, pero ya que la arquitectura windows no asocia números de descriptor de archivo con gestores de bajo nivel, el proceso hijo no dispone (aun) de un medio para acceder a esos gestores. Stdin, stdout y stderr funcionan como es de esperar. </para> </note> <note> <para> Si sólo necesita un pipe de proceso uni-direccional (una-vía), use <function>popen</function> en su lugar, ya que es mucho más fácil de usar. </para> </note> <para> Vea también <function>stream_select</function>, <function>exec</function>, <function>system</function>, <function>passthru</function>, <function>popen</function>, <function>escapeshellcmd</function>, y el <link linkend="language.operators.execution">operador de comilla invertida</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 -->
Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.81 phpdoc-es/translation.xml:1.82 --- phpdoc-es/translation.xml:1.81 Mon Nov 10 01:44:09 2003 +++ phpdoc-es/translation.xml Mon Nov 10 17:23:49 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.81 $ --> +<!-- $Revision: 1.82 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -44,9 +44,10 @@ <file name="reference/dio/functions/dio-tcsetattr.xml" person="javi" type="translation" date="09.11.2003"/> <file name="reference/dio/functions/dio-truncate.xml" person="javi" type="translation" date="09.11.2003"/> <file name="reference/dio/functions/dio-write.xml" person="javi" type="translation" date="09.11.2003"/> -<file name="reference/errorfunc/functions/debug-backtrace.xml" person="lboshell" type="translation" date="10.11.2003"/> -<file name="reference/errorfunc/functions/debug-print-backtrace.xml" person="lboshell" type="translation" date="10.11.2003"/> -<file name="reference/exec/functions/proc-get-status.xml" person="lboshell" type="translation" date="10.11.2003"/> -<file name="reference/exec/functions/proc-open.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/escapeshellarg.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/proc-close.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/proc-nice.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/proc-terminate.xml" person="lboshell" type="translation" date="10.11.2003"/> +<file name="reference/exec/functions/shell-exec.xml" person="lboshell" type="translation" date="10.11.2003"/> </work-in-progress> </translation> Index: phpdoc-es/reference/errorfunc/functions/debug-backtrace.xml +++ phpdoc-es/reference/errorfunc/functions/debug-backtrace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <refentry id="function.debug-backtrace"> <refnamediv> <refname>debug_backtrace</refname> <refpurpose> Genera un backtrace </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>array</type><methodname>debug_backtrace</methodname> <void/> </methodsynopsis> <para> <function>debug_backtrace</function> genera un backtrace PHP y devuelve esta información como un <type>array</type> asociativo. Los elementos posiblemente devueltos son referenciados en la siguiente tabla: </para> <para> <table> <title>Elementos posiblemente devueltos por <function>debug_backtrace</function></title> <tgroup cols="3"> <thead> <row> <entry>Nombre</entry> <entry>Tipo</entry> <entry>Descripción</entry> </row> </thead> <tbody> <row> <entry>function</entry> <entry><type>string</type></entry> <entry> El nombre de la función actual. Vea también <link linkend="language.constants.predefined">__FUNCTION__</link>. </entry> </row> <row> <entry>line</entry> <entry><type>integer</type></entry> <entry> El número de línea actual. Vea también <link linkend="language.constants.predefined">__LINE__</link>. </entry> </row> <row> <entry>file</entry> <entry><type>string</type></entry> <entry> El nombre del archivo actual. Vea también <link linkend="language.constants.predefined">__FILE__</link>. </entry> </row> <row> <entry>class</entry> <entry><type>string</type></entry> <entry> El nombre de la <link linkend="language.oop">clase</link> actual. Vea también <link linkend="language.constants.predefined">__CLASS__</link> </entry> </row> <row> <entry>type</entry> <entry><type>string</type></entry> <entry> El tipo de clase actual. </entry> </row> <row> <entry>args</entry> <entry><type>array</type></entry> <entry> Si se encuentra al interior de una función, contiene una lista de los argumentos de la función. Si se encuentra al interior de un archivo de inclusión, contiene una lista de los nombres de archivos incluídos. </entry> </row> </tbody> </tgroup> </table> </para> <para> El siguiente es un ejemplo sencillo. </para> <para> <example> <title> Ejemplo de <function>debug_backtrace</function> </title> <programlisting role="php"> <![CDATA[ // nombre de archivo: a.php <?php function prueba_a($cadena) { print "\nHola: $cadena"; var_dump(debug_backtrace()); } prueba_a('amigo'); ?> // nombre de archivo: b.php <?php include_once '/tmp/a.php'; ?> ]]> </programlisting> <para> Resultados de ejecutar /tmp/b.php: </para> <screen> <![CDATA[ Hola: amigo array(2) { [0]=> array(4) { ["file"] => string(10) "/tmp/a.php" ["line"] => int(10) ["function"] => string(8) "prueba_a" ["args"]=> array(1) { [0] => &string(5) "amigo" } } [1]=> array(4) { ["file"] => string(10) "/tmp/b.php" ["line"] => int(2) ["args"] => array(1) { [0] => string(10) "/tmp/a.php" } ["function"] => string(12) "include_once" } } ]]> </screen> </example> </para> <para> Vea también <function>trigger_error</function> y <function>debug_print_backtrace</function>. </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 --> Index: phpdoc-es/reference/errorfunc/functions/debug-print-backtrace.xml +++ phpdoc-es/reference/errorfunc/functions/debug-print-backtrace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: lboshell Status: ready --> <refentry id="function.debug-print-backtrace"> <refnamediv> <refname>debug_print_backtrace</refname> <refpurpose> Imprime un backtrace </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>void</type><methodname>debug_print_backtrace</methodname> <void/> </methodsynopsis> <para> <function>debug_print_backtrace</function> imprime un backtrace PHP. </para> &warn.undocumented.func; <para> Vea también <function>debug_backtrace</function>. </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 --> Index: phpdoc-es/reference/exec/functions/proc-get-status.xml +++ phpdoc-es/reference/exec/functions/proc-get-status.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <refentry id='function.proc-get-status'> <refnamediv> <refname>proc_get_status</refname> <refpurpose> Obtiene información sobre un proceso abierto por <function>proc_open</function> </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>array</type><methodname>proc_get_status</methodname> <methodparam><type>resource</type><parameter>proceso</parameter></methodparam> </methodsynopsis> <para> <function>proc_get_status</function> recupera información sobre un proceso abierto mediante el uso de <function>proc_open</function>. Los datos recolectados son devueltos en una matriz que contiene los siguientes elementos: </para> <informaltable> <tgroup cols="3"> <thead> <row><entry>elemento</entry><entry>tipo</entry><entry>descripción</entry></row> </thead> <tbody> <row> <entry>command</entry> <entry><type>string</type></entry> <entry>la cadena del comando que fue pasada a <function>proc_open</function></entry> </row> <row> <entry>pid</entry> <entry><type>int</type></entry> <entry>id del proceso</entry> </row> <row> <entry>running</entry> <entry><type>bool</type></entry> <entry> &true; si el proceso aun está siendo ejecutado, &false; si ha terminado </entry> </row> <row> <entry>signaled</entry> <entry><type>bool</type></entry> <entry> &true; si el proceso hijo ha sido terminado por una señal no atrapada. En windows, este valor siempre es &false;. </entry> </row> <row> <entry>stopped</entry> <entry><type>bool</type></entry> <entry> &true; si el proceso hijo fue detenido por una señal. En windows, este valor siempre es &false;. </entry> </row> <row> <entry>exitcode</entry> <entry><type>int</type></entry> <entry> el código de salida devuelto por el proceso (el cual tiene sentido únicamente si <literal>running</literal> es &false;) </entry> </row> <row> <entry>termsig</entry> <entry><type>int</type></entry> <entry> el número de la señal que causó que el proceso hijo finalizara su ejecución (sólo tiene sentido si <literal>signaled</literal> es &true;) </entry> </row> <row> <entry>stopsig</entry> <entry><type>int</type></entry> <entry> el número de la señal que causó que el proceso hijo detuviera su ejecución (sólo tiene sentido si <literal>stopped</literal> es &true;) </entry> </row> </tbody> </tgroup> </informaltable> <para> Vea también <function>proc_open</function>. </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 --> Index: phpdoc-es/reference/exec/functions/proc-open.xml +++ phpdoc-es/reference/exec/functions/proc-open.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/exec.xml, last change in rev 1.28 --> <refentry id='function.proc-open'> <refnamediv> <refname>proc_open</refname> <refpurpose> Ejecutar un comando y abrir apuntadores de archivo para entrada/salida </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>resource</type><methodname>proc_open</methodname> <methodparam><type>string</type><parameter>cmd</parameter></methodparam> <methodparam><type>array</type><parameter>espec_descriptor</parameter></methodparam> <methodparam><type>array</type><parameter>pipes</parameter></methodparam> </methodsynopsis> <para> <function>proc_open</function> es similar a <function>popen</function> pero provee un grado de control mucho mayor sobre la ejecución del programa. <parameter>cmd</parameter> es el comando a ser ejecutado por el intérprete de comandos. <parameter>espec_descriptor</parameter> es una matriz indexada en donde la clave representa el número de descriptor y el valor representa el modo como PHP pasará ese descriptor al proceso hijo. <parameter>pipes</parameter> será definido como una matriz indexada de apuntadores a archivo que corresponden a los puntos de comunicación con PHP de todo pipe que sea creado. El valor de retorno es un recurso que representa el proceso; usted debe liberarlo usando <function>proc_close</function> una vez haya terminado de usarlo. </para> <para> <informalexample> <programlisting role="php"> <![CDATA[ <?php $espec_descriptor = array( 0 => array("pipe", "r"), // stdin es un pipe usado por el hijo para lectura 1 => array("pipe", "w"), // stdout es un pipe usado por el hijo para escritura 2 => array("file", "/tmp/error-output.txt", "a") // stderr es un archivo para escritura ); $proceso = proc_open("php", $espec_descriptor, $pipes); if (is_resource($proceso)) { // $pipes ahora luce de esta forma: // 0 => gestor de escritura conectado con la entrada estandar del hijo // 1 => gestor de lectura conectado con la salida estandar del hijo // Cualquier mensaje de salida de error sera adicionado a /tmp/error-output.txt fwrite($pipes[0], "<?php echo \"¡Hola mundo!\"; ?>"); fclose($pipes[0]); while(!feof($pipes[1])) { echo fgets($pipes[1], 1024); } fclose($pipes[1]); // Es importante que cierre todos los pipes antes de llamar // proc_close para evitar un bloqueo muerto $retval = proc_close($proceso); echo "el comando ha devuelto $retval\n"; } ?> ]]> </programlisting> </informalexample> </para> <para> Los números de descriptor de archivo en <parameter>espec_descriptor</parameter> no están limitados a 0, 1 y 2 - usted puede especificar cualquier número de descriptor de archivo válido y éste será pasado al proceso hijo. Esto le permite a su script interoperar con otros scripts que corran como "co-procesos". En particular, esto es útil para pasar contraseñas a programas como PGP, GPG y openssl en un modo más seguro. También es útil para la lectura de información de status entregada por aquellos programas en descriptores de archivo auxiliares. </para> <note> <para> Compatibilidad con windows: Los descriptores más allá de 2 (stderr) son entregados al proceso hijo como gestores heredables, pero ya que la arquitectura windows no asocia números de descriptor de archivo con gestores de bajo nivel, el proceso hijo no dispone (aun) de un medio para acceder a esos gestores. Stdin, stdout y stderr funcionan como es de esperar. </para> </note> <note> <para> Si sólo necesita un pipe de proceso uni-direccional (una-vía), use <function>popen</function> en su lugar, ya que es mucho más fácil de usar. </para> </note> <para> Vea también <function>stream_select</function>, <function>exec</function>, <function>system</function>, <function>passthru</function>, <function>popen</function>, <function>escapeshellcmd</function>, y el <link linkend="language.operators.execution">operador de comilla invertida</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 -->