cvs: phpdoc-es / translation.xml /appendices filters.xml ini.xml migration5.xml /faq installation.xml mailinglist.xml migration5.xml misc.xml
using.xml /language oop.xml operators.xml types.xml
| From: | Leonardo Boshell | Date: | Tue, 01 Mar 2005 22:39:49 +0000 |
| Subject: | cvs: phpdoc-es / translation.xml /appendices filters.xml ini.xml migration5.xml /faq installation.xml mailinglist.xml migration5.xml misc.xml using.xml /language oop.xml operators.xml types.xml |
||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-769@lists.php.net to get a copy of this message | ||
lboshell Tue Mar 1 17:39:49 2005 EDT
Added files:
/phpdoc-es/faq migration5.xml
Modified files:
/phpdoc-es translation.xml
/phpdoc-es/appendices filters.xml ini.xml migration5.xml
/phpdoc-es/faq installation.xml mailinglist.xml misc.xml using.xml
/phpdoc-es/language oop.xml operators.xml types.xml
Log:
- Nuevo documento de la seccion FAQ (migration5.xml)
- Actualizaciones
http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.187&r2=1.188&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.187 phpdoc-es/translation.xml:1.188 --- phpdoc-es/translation.xml:1.187 Wed Feb 23 14:02:56 2005 +++ phpdoc-es/translation.xml Tue Mar 1 17:39:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.187 $ --> +<!-- $Revision: 1.188 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -86,9 +86,6 @@ <file name="faq/html.xml" person="webstudio" type="translation" date="11.05.2003"/> - <file name="faq/migration5.xml" person="lboshell" - type="translation" date="24.08.2004" /> - <file name="install/*" person="rafael" type="translation" date="31.08.2004"/> http://cvs.php.net/diff.php/phpdoc-es/appendices/filters.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/appendices/filters.xml diff -u phpdoc-es/appendices/filters.xml:1.2 phpdoc-es/appendices/filters.xml:1.3 --- phpdoc-es/appendices/filters.xml:1.2 Fri Feb 11 23:33:05 2005 +++ phpdoc-es/appendices/filters.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.13 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.14 Maintainer: lboshell Status: ready --> <appendix id="filters"> <title>Lista de Filtros Disponibles</title> <para> @@ -248,13 +248,14 @@ <title>Filtros de Compresión</title> <simpara> - Mientras que <xref linkend="wrappers.compression"/> ofrece una - forma de crear archivos compatibles con gzip y bz2 en el sistema de - archivos local, no ofrece un método de compresión - generalizado sobre secuencias de red, ni ofrece la forma de - comenzar con una secuencia no-comprimida y trasladarse a una - comprimida. Para esto, un filtro de compresión puede ser - aplicado sobre cualquier recurso de secuencia en cualquier momento. + Aunque las <link linkend="wrappers.compression">Envolturas de + Compresión</link> ofrecen una forma de crear archivos + compatibles con gzip y bz2 en el sistema de archivos local, no + ofrecen un método de compresión generalizado sobre + secuencias de red, ni ofrecen la forma de comenzar con una + secuencia no-comprimida y trasladarse a una comprimida. Para esto, + un filtro de compresión puede ser aplicado sobre cualquier + recurso de secuencia en cualquier momento. </simpara> <note> @@ -312,7 +313,7 @@ <simpara> Los filtros de compresión zlib.* están disponibles con PHP desde la versión <literal>5.1.0</literal> si el - soporte <xref linkend="ref.zlib"/> se encuentra + soporte de <link linkend="ref.zlib">zlib</link> se encuentra habilitado. También están disponibles como una característica portada de vuelta en la versión <literal>5.0.x</literal>, instalando el paquete <ulink @@ -421,7 +422,7 @@ <simpara> Las filtros de compresión bzip2.* se encuentran disponibles con PHP desde la versión <literal>5.1.0</literal> si el - soporte <xref linkend="ref.bzip2"/> se encuentra + soporte de <link linkend="ref.bzip2">bz2</link> se encuentra habilitado. También se encuentran disponibles como una característica portada hacia atrás en la versión <literal>5.0.x</literal>, instalando el paquete @@ -461,6 +462,124 @@ </example> </section> + <section id="filters.encryption"> + <title>Filtros de Encripción</title> + + <simpara> + <literal>mcrypt.*</literal> y <literal>mdecrypt.*</literal> ofrecen + encripción y desencripción simétrica usando + libmcrypt. Ambos conjuntos de filtros soportan los mismos + algoritmos disponibles a la <link + linkend="ref.mcrypt">extensión mcrypt</link> en la forma de + <literal>mcrypt.ciphername</literal>, en donde + <parameter>ciphername</parameter> es el nombre del cifrado que debe + ser pasado a <function>mcrypt_module_open</function>. Los + siguientes cinco parámetros se encuentran disponibles + también: + </simpara> + + <para> + <table> + <title>parámetros del filtro mcrypt</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Parámetro</entry> + <entry>¿Requerido?</entry> + <entry>Predeterminado</entry> + <entry>Ejemplos</entry> + </row> + </thead> + <tbody> + <row> + <entry>mode</entry> + <entry>Opcional</entry> + <entry>cbc</entry> + <entry>cbc, cfb, ecb, nofb, ofb, stream</entry> + </row> + <row> + <entry>algorithms_dir</entry> + <entry>Opcional</entry> + <entry>ini_get('mcrypt.algorithms_dir')</entry> + <entry>Ubicación de los módulos de los + algoritmos</entry> + </row> + <row> + <entry>modes_dir</entry> + <entry>Opcional</entry> + <entry>ini_get('mcrypt.modes_dir')</entry> + <entry>Ubicación de los módulos de los + modos</entry> + </row> + <row> + <entry>iv</entry> + <entry>Requerido</entry> + <entry>N/A</entry> + <entry>Usualmente 8, 16, o 32 bytes de datos binarios. Depende + del cifrado</entry> + </row> + <row> + <entry>key</entry> + <entry>Requerido</entry> + <entry>N/A</entry> + <entry>Usualmente 8, 16, o 32 bytes de datos binarios. Depende + del cifrado</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <example> + <title>Encripción de la salida usando 3DES</title> + <programlisting role="php"> +<![CDATA[ +<?php +$frase_secreta = 'Mi secreto'; + +/* Convertir una frase legible en una pareja iv/llave reproducible + */ +$iv = substr(md5('iv'.$frase_secreta, true), 0, 8); +$llave = substr(md5('contrasenya1'.$frase_secreta, true) . + md5('contrasenya2'.$frase_secreta, true), 0, 24); +$opciones = array('iv'=>$iv, 'key'=>$key); + +$da = fopen('archivo-secreto.enc', 'wb'); +stream_filter_append($da, 'mcrypt.tripledes', STREAM_FILTER_WRITE, $opciones); +fwrite($da, 'Datos muy muy muy secretos'); +fclose($da); +?> +]]> + </programlisting> + </example> + + <example> + <title>Lectura de un archivo encriptado</title> + <programlisting role="php"> +<![CDATA[ +<?php +$frase_secreta = 'Mi secreto'; + +/* Convertir una frase legible en una pareja iv/llave reproducible + */ +$iv = substr(md5('iv'.$frase_secreta, true), 0, 8); +$llave = substr(md5('contrasenya1'.$frase_secreta, true) . + md5('contrasenya2'.$frase_secreta, true), 0, 24); +$opciones = array('iv'=>$iv, 'key'=>$llave); + +$da = fopen('archivo-secreto.enc', 'rb'); +stream_filter_append($da, 'mdecrypt.tripledes', STREAM_FILTER_WRITE, $opciones); +$datos = rtrim(stream_get_contents($da)); +fclose($da); + +echo $datos; +?> +]]> + </programlisting> + </example> + + </section> + </appendix> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc-es/appendices/ini.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-es/appendices/ini.xml diff -u phpdoc-es/appendices/ini.xml:1.4 phpdoc-es/appendices/ini.xml:1.5 --- phpdoc-es/appendices/ini.xml:1.4 Fri Feb 11 23:33:05 2005 +++ phpdoc-es/appendices/ini.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.10 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.13 Maintainer: lboshell Status: ready --> <appendix id="ini"> <title>Directivas de &php.ini;</title> @@ -193,7 +193,7 @@ <entry>Disponible a partir de PHP 4.3.0.</entry> </row> <row> - <entry>auto_globals_jit</entry> + <entry><link linkend="ini.auto-globals-jit">auto_globals_jit</link></entry> <entry>"1"</entry> <entry>PHP_INI_PERDIR</entry> <entry>Disponible a partir de PHP 5.0.0.</entry> @@ -613,6 +613,12 @@ <entry>PHP_INI_SYSTEM en PHP <= 4.2.3. Disponible a partir de PHP 4.0.2.</entry> </row> <row> + <entry>http.allowed_methods</entry> + <entry>"OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT"</entry> + <entry>PHP_INI_ALL</entry> + <entry></entry> + </row> + <row> <entry>hyperwave.allow_persistent</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> @@ -2017,6 +2023,12 @@ <entry>Disponible a partir de PHP 4.3.0.</entry> </row> <row> + <entry>yaz.log_mask</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + <entry></entry> + </row> + <row> <entry>yaz.max_links</entry> <entry>"100"</entry> <entry>PHP_INI_ALL</entry> @@ -2067,22 +2079,27 @@ <entry>PHP_INI_USER</entry> <entry>1</entry> <entry>La entrada puede definirse en scripts de usuario</entry> + <entry></entry> </row> <row> <entry>PHP_INI_PERDIR</entry> <entry>2</entry> <entry>La entrada puede definirse en &php.ini;, &htaccess; o &httpd.conf;</entry> + <entry></entry> </row> <row> <entry>PHP_INI_SYSTEM</entry> <entry>4</entry> - <entry>La entrada puede definirse en &php.ini; o &httpd.conf;</entry> + <entry>La entrada puede definirse en &php.ini; o + &httpd.conf;</entry> + <entry></entry> </row> <row> <entry>PHP_INI_ALL</entry> <entry>7</entry> <entry>La entrada puede definirse en cualquier parte</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2108,12 +2125,13 @@ <para> <table> <title>Opciones Httpd</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -2121,6 +2139,7 @@ <entry>async_send</entry> <entry>"0"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2136,49 +2155,57 @@ <table> <title>Opciones del Lenguaje y Configuración Variada</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> <row> <entry>short_open_tag</entry> - <entry>On</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.0.0.</entry> </row> <row> <entry>asp_tags</entry> - <entry>Off</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>"0"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL in PHP <= 4.0.0.</entry> </row> <row> <entry>precision</entry> <entry>"14"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>y2k_compliance</entry> - <entry>Off</entry> + <entry>"1"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>allow_call_time_pass_reference</entry> - <entry>On</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.0.0.</entry> </row> <row> <entry>expose_php</entry> - <entry>On</entry> - <entry>PHP_INI_SYSTEM</entry> + <entry>"1"</entry> + <entry>sólo &php.ini;</entry> + <entry></entry> </row> <row> <entry>zend.ze1_compatibility_mode</entry> - <entry>Off</entry> + <entry>"0"</entry> <entry>PHP_INI_ALL</entry> + <entry>Disponible a partir de PHP 5.0.0.</entry> </row> </tbody> </tgroup> @@ -2335,6 +2362,11 @@ Habilita el modo de compatibilidad con el Motor Zend 1 (PHP 4). Afecta el modo de clonar, moldear y comparar objetos. </para> + <para> + Vea también la sección titulada <link + linkend="migration5">Migración de PHP 4 a PHP + 5</link>. + </para> </listitem> </varlistentry> </variablelist> @@ -2346,12 +2378,13 @@ <para> <table> <title>Límites de Recursos</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -2359,6 +2392,7 @@ <entry>memory_limit</entry> <entry>"8M"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2411,12 +2445,13 @@ <table> <title>Opciones de Configuración de Manejo de Datos</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -2429,71 +2464,87 @@ <entry>arg_separator.output</entry> <entry>"&"</entry> <entry>PHP_INI_ALL</entry> + <entry>Disponible desde PHP 4.0.5.</entry> </row> <row> <entry>arg_separator.input</entry> <entry>"&"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>Disponible desde PHP 4.0.5.</entry> </row> <row> <entry>variables_order</entry> <entry>"EGPCS"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>register_globals</entry> - <entry>"Off"</entry> - <entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry> + <entry>"0"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>register_argc_argv</entry> - <entry>"On"</entry> - <entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>register_long_arrays</entry> - <entry>"On"</entry> - <entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>Disponible desde PHP 5.0.0.</entry> </row> <row> <entry>post_max_size</entry> <entry>"8M"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_SYSTEM en PHP <= 4.2.3. Disponible desde PHP + 4.0.3.</entry> </row> <row> <entry>gpc_order</entry> <entry>"GPC"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>auto_prepend_file</entry> - <entry>""</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>NULL</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>auto_append_file</entry> - <entry>""</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>NULL</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>default_mimetype</entry> <entry>"text/html"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>default_charset</entry> - <entry>"iso-8859-1"</entry> + <entry>""</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>always_populate_raw_post_data</entry> <entry>"0"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3. Disponible desde PHP + 4.1.0.</entry> </row> <row> <entry>allow_webdav_methods</entry> <entry>"0"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2581,6 +2632,32 @@ </listitem> </varlistentry> + <varlistentry id="ini.auto-globals-jit"> + <term> + <parameter>auto_globals_jit</parameter> + <type>boolean</type> + </term> + <listitem> + <para> + Cuando es habilitado el parámetro, las variables + SERVER y ENV son creadas al usarse por primera vez ("Just In + Time", o justo a tiempo) en lugar de hacerlo cuando el script + inicia. Si estas variables no son usadas al interior del + script, esta directiva resultará en una ganancia en + rendimiento. + </para> + <para> + Las directivas de PHP <link + linkend="ini.register-globals">register_globals</link>, <link + linkend="ini.register-long-arrays">register_long_arrays</link>, + y <link + linkend="ini.register-argc-argv">register_argc_argv</link> + deben ser deshabilitadas para que esta directiva tenga + efecto. + </para> + </listitem> + </varlistentry> + <varlistentry id="ini.register-globals"> <term> <parameter>register_globals</parameter> @@ -2838,60 +2915,71 @@ <title>Rutas y Directorios</title> <para> <table> - <title>Opciones de Configuración de Rutas y Directorios</title> - <tgroup cols="3"> + <title>Opciones de Configuración de Rutas y + Directorios</title> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> <row> <entry>include_path</entry> - <entry>PHP_INCLUDE_PATH</entry> + <entry>".;/ruta/hacia/php/pear"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>doc_root</entry> - <entry>PHP_INCLUDE_PATH</entry> + <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>user_dir</entry> <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>extension_dir</entry> - <entry>PHP_EXTENSION_DIR</entry> + <entry>"/ruta/hacia/php"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.fix_pathinfo</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.force_redirect</entry> <entry>"1"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.redirect_status_env</entry> <entry>""</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>fastcgi.impersonate</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.rfc2616_headers</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -3126,12 +3214,13 @@ <table> <title>Opciones de Configuración de Carga de Archivos</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -3139,16 +3228,20 @@ <entry>file_uploads</entry> <entry>"1"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3. Disponible desde PHP + 4.0.3.</entry> </row> <row> <entry>upload_tmp_dir</entry> <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>upload_max_filesize</entry> <entry>"2M"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> </tbody> </tgroup> @@ -3216,12 +3309,13 @@ <para> <table> <title>Opciones Generales de Configuración SQL</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry></entry> </row> </thead> <tbody> @@ -3229,6 +3323,7 @@ <entry>sql.safe_mode</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> </tbody> </tgroup> http://cvs.php.net/diff.php/phpdoc-es/appendices/migration5.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/appendices/migration5.xml diff -u phpdoc-es/appendices/migration5.xml:1.1 phpdoc-es/appendices/migration5.xml:1.2 --- phpdoc-es/appendices/migration5.xml:1.1 Fri Feb 11 23:33:05 2005 +++ phpdoc-es/appendices/migration5.xml Tue Mar 1 17:39:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- EN-Revision: 1.39 Maintainer: lboshell Status: ready --> <appendix id="migration5"> <title>Migración desde PHP 4 a PHP 5</title> @@ -857,7 +857,7 @@ <note> <para> La extensión <link linkend="ref.tidy">Tidy</link> ha - modificado tambión su API por completo. + modificado también su API por completo. </para> </note> </section> http://cvs.php.net/diff.php/phpdoc-es/faq/installation.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc-es/faq/installation.xml diff -u phpdoc-es/faq/installation.xml:1.11 phpdoc-es/faq/installation.xml:1.12 --- phpdoc-es/faq/installation.xml:1.11 Wed Sep 15 10:23:50 2004 +++ phpdoc-es/faq/installation.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.39 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.42 Maintainer: lboshell Status: ready --> <chapter id="faq.installation"> <title>Instalación</title> <titleabbrev>Instalación</titleabbrev> @@ -25,77 +25,13 @@ <qandaentry id="faq.installation.apache2"> <question> <para> - ¿Porqué no debo usar Apache 2 en un entorno en + ¿Porqué no debo usar Apache 2 con un módulo + de multi-procesamiento (MPM) multi-hilos en un entorno en producción? </para> </question> <answer> <para> - La siguiente respuesta se encuentra basada en este extracto - modificado de un correo por Rasmus Lerdorf. - </para> - <para> - Apache 2 es una versión escrita desde ceros y una - completa modificación de arquitectura a partir de Apache - 1. No es como ir de PHP 3 a PHP4, o de PHP 4 a PHP 5. Hay - bastante código que es común, y ciertamente la - arquitectura base de PHP no ha cambiado a través de los - años. Asi que comparar Apache 1 y Apache 2 contra PHP 4 y - PHP 5 no tiene sentido. La arquitectura ha sido probada a lo - largo de los años y el código, aunque es un poco - inmanejable en algunas partes, es una entidad conocida. PHP fue - diseñado desde los primeros días contra aquella - arquitectura básica de Apache 1 y funciona extremadamente - bien cuando se usa con éste. - </para> - <para> - La característica más importante que atrae a la - gente a Apache 2 es el uso de hilos. En Windows, en donde la - mayoría de bibliotecas básicos son, y deben ser, - seguras con hilos, Apache 2 realmente tiene sentido y - sería bueno resolver los pequeños problemas en esa - plataforma. Sin embargo, en UNIX existen bastante bibliotecas - básicas en donde no se conoce su seguridad con hilos. Y - no se trata de extensiones PHP, se trata de bibliotecas de - terceros por debajo de los cientos de extensiones de PHP. Es - realmente difícil determinar si cierta biblioteca externa - es segura con hilos. Existen bastantes variables involucradas, - incluyendo el SO, la versión del SO, la biblioteca libc, - la versión de esa biblioteca e incluso, en algunas - plataformas, las banderas de compilación usadas para - generar las bibliotecas. Y para hacerlo aun más - divertido, rastrear un problema de seguridad con hilos se - encuentra bastante cerca a lo imposible. Cientos de personas - bien pueden declarar que Apache+PHP+cualquier/extensión - funciona perfectamente para ellos, pero quizás ellos - sólo reciben un millón de peticiones al - día. Luego llega otro usuario quien recibe 100 millones - de peticiones al día y usa una avanzada máquina - con doble-procesador y todo se arruina ya que de repente ahora - la oportunidad para alguna pequeña condición de - carrera se ha hecho mucho mayor debido a las velocidades - más rápidas de cpu, el segundo cpu y la mayor - frecuencia de las peticiones. Y el reporte del fallo que - recibimos de este usuario será algo similar a: - </para> - <blockquote> - <para> - A veces no funciona. La mayoría de veces funciona bien, - pero de repente de vez en cuando no. El error es diferente - cada vez y no tengo idea de cómo reproducirlo, - ¡pero arréglenlo de inmediato!!! - </para> - </blockquote> - - <para>¿Qué podemos hacer al respecto?</para> - <para> - Hay un número de razones técnicas (que pueden - resolverse) por las que Rasmus no piensa que Apache2+PHP sea una - buena idea en un entorno en producción, pero - dejándolas de lado, realmente todo converge a un simple - concepto: - </para> - <para> PHP es pegamento. Es el pegamento usado para construir interesantes aplicaciones web, uniendo docenas de bibliotecas externas y haciéndolas parecer una entidad coherente a @@ -114,15 +50,15 @@ sistema de PHP. </para> <para> - Usar la versión mpm anterior a la bifurcación - ocurrida en Apache 2 para evitar el uso de hilos es posible, y - sí, también funciona usar un mecanismo - independiente fastcgi para evitar los hilos, pero entonces se - estarían evitando características que definen al - servidor web. En este punto de desarrollo, Rasmus aun afirma que - se está mejor siguiendo con Apache 1 para servir - páginas PHP, con la nota de precaución de que - Apache 1 opera bastante mal en Windows. + Si siente que necesita usar un MPM multi-hilos, puede echarle un + vistazo a la configuración FastCGI, en donde PHP corre en + su propio espacio de memoria. + </para> + <para> + Y finalmente, note que esta advertencia contra el uso de un MPM + multi-hilos no tiene tanta fuerza en sistemas Windows, ya que la + mayoría de bibliotecas en esa platafarma tienden a ser + seguras en entornos multi-hilo. </para> </answer> </qandaentry> @@ -152,7 +88,7 @@ que desee. </para> <programlisting role="shell"> ---with-config-file-scan-dir=PATH +--with-config-file-scan-dir=PATH </programlisting> <para> En windows, la ruta predeterminada para el archivo &php.ini; es @@ -216,18 +152,18 @@ <para> Luego recuperar la URL que causa el problema con su navegador </para> - </listitem> + </listitem> <listitem> <para> > run -X -f /ruta/hacia/httpd.conf </para> - </listitem> + </listitem> <listitem> <para> Si está recibiendo un volcado de memoria, gdb debe informarle de ésto. </para> - </listitem> + </listitem> <listitem> <para> escriba: bt @@ -333,7 +269,7 @@ <itemizedlist> <listitem> <para> - Primero remueva mod_php3 : + Primero remueva mod_php3 : <programlisting role="shell"> rpm -e mod_php3 </programlisting> @@ -767,26 +703,59 @@ En Windows 98/Me necesita editar el archivo <filename>autoexec.bat</filename>: <itemizedlist> - <listitem><para> - Abre el Bloc de Notas (Inicio -> Ejecutar e ingrese - notepad) - </para></listitem> - <listitem><para> - Abra el archivo <filename>C:\autoexec.bat</filename> - </para></listitem> - <listitem><para> - Agrege una nueva línea al final del archivo: - <literal>set PHPRC C:\php</literal> (reemplace - <literal>C:\php</literal> con el directorio en donde se - encuentra &php.ini;) + <listitem><para> Abre el Bloc de Notas (Inicio -> Ejecutar e + ingrese notepad) </para></listitem> <listitem><para> Abra el + archivo <filename>C:\autoexec.bat</filename> + </para></listitem> <listitem><para> Agrege una nueva + línea al final del archivo: <literal>set + PHPRC=C:\php</literal> (reemplace <literal>C:\php</literal> + con el directorio en donde se encuentra &php.ini;). Por favor + note que la ruta no puede contener espacios. Por ejemplo si + tiene instalado PHP en <filename>C:\Archivos de + Programa\PHP</filename>, usted debería ingresar + <filename>C:\ARCHIV~1\PHP</filename> en su lugar. </para></listitem> <listitem><para> Guarde el archivo y reinicie su máquina </para></listitem> </itemizedlist> - </para> + </para> </answer> </qandaentry> + + <qandaentry id="faq.installation.apache.multiviews"> + <question> + <para> + ¿Es posible usar la negociación de contenido de + Apache (opción MultiViews) con PHP? + </para> + </question> + <answer> + <para> + Si los enlaces a archivos PHP incluyen la extensión, todo + trabaja perfectamente. Este FAQ es sólo para el caso en + el que los enlaces a archivos PHP no incluyen la + extensión y se desea usar la negociación de + contenido para elegir archivos PHP de una URL sin + extensión. En este caso reemplace la línea + <literal>AddType application/x-httpd-php .php</literal> con: + <programlisting role="apache-conf"> +<![CDATA[ +# PHP 4 +AddHandler php-script php +AddType text/html php + +# PHP 5 +AddHandler php5-script php +AddType text/html php +]]> + </programlisting> + Esta solución no funciona con Apache 1 ya que el + módulo PHP no atrapa <literal>php-script</literal>. + </para> + </answer> + </qandaentry> + </qandaset> </chapter> http://cvs.php.net/diff.php/phpdoc-es/faq/mailinglist.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/faq/mailinglist.xml diff -u phpdoc-es/faq/mailinglist.xml:1.3 phpdoc-es/faq/mailinglist.xml:1.4 --- phpdoc-es/faq/mailinglist.xml:1.3 Wed Feb 4 09:05:34 2004 +++ phpdoc-es/faq/mailinglist.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.16 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.17 Maintainer: lboshell Status: ready --> <chapter id="faq.mailinglist"> <title>Listas de correo</title> <titleabbrev>Listas de correo</titleabbrev> @@ -100,7 +100,7 @@ </para> </answer> </qandaentry> - + <qandaentry id="faq.mailinglist.question"> <question> <para>¿Qué puedo preguntar a la lista de http://cvs.php.net/diff.php/phpdoc-es/faq/misc.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/faq/misc.xml diff -u phpdoc-es/faq/misc.xml:1.3 phpdoc-es/faq/misc.xml:1.4 --- phpdoc-es/faq/misc.xml:1.3 Tue Aug 10 18:47:31 2004 +++ phpdoc-es/faq/misc.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.15 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.22 Maintainer: lboshell Status: ready --> <chapter id="faq.misc"> <title>Preguntas Varias</title> <titleabbrev>Preguntas Varias</titleabbrev> @@ -111,6 +111,90 @@ </answer> </qandaentry> + <qandaentry id="faq.misc.registerglobals"> + <question> + <para> + ¿Cómo manejo el parámetro + <literal>register_globals</literal>? + </para> + </question> + <answer> + <para> + Para información sobre las implicaciones de seguridad de + <literal>register_globals</literal>, lea el capítulo de + seguridad sobre el <link linkend="security.globals">Uso de + register_globals</link>. + </para> + <para> + Es recomendable usar <link + linkend="language.variables.superglobals">superglobales</link>, + en lugar de depender en la activación de + <literal>register_globals</literal>. + </para> + <para> + Si se encuentra en un servidor compartido con + <literal>register_globals</literal> desactivado y necesita usar + aplicaciones antiguas, que requieren que esta opción + esté activada, o se encuentra en algún servidor de + hospedaje en donde esta característica está + habilitada, pero quisiera eliminar los riesgos de seguridad, + puede que necesite emular el valor opuesto en PHP. Siempre es + buena idea preguntar primero si es posible cambiar la + opción de alguna forma en la configuración de PHP, + pero si no es posible, entonces puede usar estos segmentos de + compatibilidad. + </para> + <para> + <example> + <title>Emulación de Register Globals</title> + <para> + Esto emula el comportamiento de register_globals On. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +// Emular register_globals on +if (!ini_get('register_globals')) { + $superglobales = array($_SERVER, $_ENV, + $_FILES, $_COOKIE, $_POST, $_GET); + if (isset($_SESSION)) { + array_unshift($superglobales, $_SESSION); + } + foreach ($superglobales as $superglobal) { + extract($superglobal, EXTR_SKIP); + } + ini_set('register_globals', true); +} +?> +]]> + </programlisting> + <para> + Esto emula register_globals Off. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +// Emular register_globals off +if (ini_get('register_globals')) { + $superglobales = array($_SERVER, $_ENV, + $_FILES, $_COOKIE, $_POST, $_GET); + if (isset($_SESSION)) { + array_unshift($superglobales, $_SESSION); + } + foreach ($superglobales as $superglobal) { + foreach ($superglobal as $global => $valor) { + unset($GLOBALS[$global]); + } + } + ini_set('register_globals', false); +} +?> +]]> + </programlisting> + </example> + </para> + </answer> + </qandaentry> </qandaset> </chapter> http://cvs.php.net/diff.php/phpdoc-es/faq/using.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-es/faq/using.xml diff -u phpdoc-es/faq/using.xml:1.4 phpdoc-es/faq/using.xml:1.5 --- phpdoc-es/faq/using.xml:1.4 Tue Aug 10 18:47:31 2004 +++ phpdoc-es/faq/using.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.31 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.33 Maintainer: lboshell Status: ready --> <chapter id="faq.using"> <title>Uso de PHP</title> <titleabbrev>Uso de PHP</titleabbrev> @@ -265,6 +265,31 @@ </answer> </qandaentry> + <qandaentry id="faq.using.iis.sharing"> + <question> + <para> + Windows: No puedo acceder a archivos compartidos en otra + computadora usando IIS + </para> + </question> + <answer> + <para> + Necesita modificar el valor <literal>Go to Internet Information + Services</literal>. Ubique su archivo PHP y diríjase a + sus propiedades. Vaya a la pestaña <literal>Seguridad de + Archivo</literal>, <literal>Editar -< Acceso anónimo y + control de autenticación</literal>. + </para> + <para> + Puede solucionar el problema ya sea deshabilitando + <literal>Acceso Anónimo</literal> y dejando habilitado + <literal>Autenticación Integrada</literal>, o habilitando + <literal>Acceso Anónimo</literal> y editando el usuario + ya que éste puede no tener el acceso bien definido. + </para> + </answer> + </qandaentry> + <qandaentry id="faq.using.netscape"> <question> <para> @@ -389,9 +414,9 @@ <answer> <para> Existen algunas pocas alternativas escritas en PHP, como - <ulink url="&url.pdf.ros;">&url.pdf.ros;</ulink>, - <ulink url="&url.pdf.fpdf;">&url.pdf.fpdf;</ulink>, - <ulink url="&url.pdf.pdf4php;">&url.pdf.pdf4php;</ulink>, y + <ulink url="&url.pdf.ros;">&url.pdf.ros;</ulink>, + <ulink url="&url.pdf.fpdf;">&url.pdf.fpdf;</ulink>, + <ulink url="&url.pdf.pdf4php;">&url.pdf.pdf4php;</ulink>, y <ulink url="&url.pdf.phppdflib;">&url.pdf.phppdflib;</ulink>. También existe el módulo <ulink @@ -411,14 +436,13 @@ </question> <answer> <para> - Es importante darse cuenta de que la directiva PHP <link linkend="ini.register-globals">register_globals</link> también afecta a variables de servidor y de entorno. Cuando register_globals = off (el valor predeterminado es off a partir de PHP 4.2.0), <varname>$DOCUMENT_ROOT</varname> - no existirá. En su lugar, - use <varname>$_SERVER['DOCUMENT_ROOT']</varname>. Si + no existirá. En su lugar, use + <varname>$_SERVER['DOCUMENT_ROOT']</varname>. Si register_globals = on entonces las variables <varname>$DOCUMENT_ROOT</varname> y <varname>$GLOBALS['DOCUMENT_ROOT']</varname> existirán @@ -436,7 +460,7 @@ variables</link>. Es recomendable escribir código bajo el modelo register_globals = off. </para> - + ¬e.superglobals; </answer> @@ -455,8 +479,9 @@ </question> <answer> <para> - Las opciones disponibles son K (para Kilobytes) y M (para - Megabytes), las cuales son insensibles a mayúsculas y + Las opciones disponibles son K (para Kilobytes), M (para + Megabytes) y G (para Gigabytes; disponible desde PHP 5.1.0), las + cuales son insensibles a mayúsculas y minúsculas. Cualquier otro valor asume bytes. <literal>1M</literal> es igual a un Megabyte o <literal>1048576</literal> bytes. <literal>1K</literal> es igual http://cvs.php.net/diff.php/phpdoc-es/language/oop.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-es/language/oop.xml diff -u phpdoc-es/language/oop.xml:1.6 phpdoc-es/language/oop.xml:1.7 --- phpdoc-es/language/oop.xml:1.6 Thu Aug 19 17:13:10 2004 +++ phpdoc-es/language/oop.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.53 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.60 Maintainer: lboshell Status: ready --> <chapter id="language.oop"> <title>Clases y Objetos (PHP 4)</title> @@ -18,22 +18,25 @@ <?php class Carrito { var $items; // Items en nuestro carrito de compras - + // Agregar $num articulos de $artnr al carrito - + function agregar_item($artnr, $num) { $this->items[$artnr] += $num; } - + // Tomar $num articulos de $artnr del carrito - + function retirar_item($artnr, $num) { if ($this->items[$artnr] > $num) { $this->items[$artnr] -= $num; return true; + } elseif ($this->items[$artnr] == $num) { + unset($this->items[$artnr]); + return true; } else { return false; - } + } } } ?> @@ -41,7 +44,7 @@ </programlisting> </informalexample> </para> - + <para> Esto define una clase llamada Carrito que consiste de una matriz asociativa de artículos en el carrito y dos funciones para @@ -51,8 +54,11 @@ <warning> <simpara> <emphasis>NO</emphasis> es posible separar la definición - de una clase en varios archivos, o bloques PHP diferentes. Lo - siguiente no funciona: + de una clase en varios archivos. Asimismo <emphasis>NO</emphasis> + es posible separar la definición de una clase en bloques + PHP diferentes, a menos que la separación sea al interior + de una declaración de método. Lo siguiente no + funciona: </simpara> <para> <informalexample> @@ -71,13 +77,33 @@ </programlisting> </informalexample> </para> + <simpara> + Sin embargo, lo siguiente es permitido: + </simpara> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +class prueba { + function prueba() { + ?> + <?php + print 'Bien'; + } +} +?> +]]> + </programlisting> + </informalexample> + </para> </warning> <simpara> Las siguientes notas de precaución son válidas para PHP 4. </simpara> - + <caution> <simpara> El nombre <literal>stdClass</literal> es usado internamente por @@ -85,7 +111,7 @@ <literal>stdClass</literal> en PHP. </simpara> </caution> - + <caution> <simpara> Los nombres de función <literal>__sleep</literal> y @@ -96,7 +122,7 @@ información a continuación. </simpara> </caution> - + <caution> <simpara> PHP reserva todos los nombres de función que comienzan con @@ -214,7 +240,7 @@ // correcto, pero puede o no ser lo que se busca: // $carrito->$mivar se convierte en $carrito->items $mivar = 'items'; -$carrito->$mivar = array("10" => 1); +$carrito->$mivar = array("10" => 1); ?> ]]> </programlisting> @@ -242,13 +268,71 @@ <note> <para> + Usualmente, la pseudo-variable <varname>$this</varname> no es + definida si el método en el que se encuentra es llamado + estáticamente. Sin embargo, esta no es una regla estricta: + <varname>$this</varname> se define si un método es llamado + estáticamente desde el interior de otro objeto. En este + caso, el valor de <varname>$this</varname> es aquél del + objeto que hace la llamada. Esto se ilustra en el siguiente + ejemplo: + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +class A +{ + function foo() + { + if (isset($this)) { + echo '$this se define ('; + echo get_class($this); + echo ")\n"; + } else { + echo "\$this no se define.\n"; + } + } +} + +class B +{ + function bar() + { + A::foo(); + } +} + +$a = new A(); +$a->foo(); +A::foo(); +$b = new B(); +$b->bar(); +B::bar(); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +$this se define (a) +$this no se define. +$this se define (b) +$this no se define. +]]> + </screen> + </informalexample> + </para> + </note> + + <note> + <para> Existen algunas funciones interesantes que manejan clases y objetos. Puede que quiera echar un vistazo a las <link linkend="ref.classobj">Funciones de Clase/Objeto</link>. </para> </note> </sect1> - + <sect1 id="keyword.extends"> <title><literal>extends</literal></title> @@ -295,7 +379,7 @@ del carrito. Aun es posible usar las funciones normales de un carrito sobre los carritos con nombre: </para> - + <informalexample> <programlisting role="php"> <![CDATA[ @@ -333,7 +417,7 @@ </sect1> <sect1 id="language.oop.constructor"> - <title><literal>Constructores</literal></title> + <title>Constructores</title> <caution> <simpara> @@ -352,7 +436,7 @@ el mismo nombre que la clase en donde es definida - la diferencia es sutil, pero crucial (vea más adelante). </para> - + <informalexample> <programlisting role="php"> <![CDATA[ @@ -495,7 +579,7 @@ le importa si la función está siendo definida en la clase B, o si ha sido heredada. </para> - + <para> Esto se corrige en PHP 4 modificando la regla a: 'Un constructor es una función del mismo nombre de la clase en la que se @@ -504,7 +588,7 @@ base hubiera sido llamado, imprimiendo 'Soy el constructor de A.<br />'. </para> - + <caution> <simpara> Ni PHP 3 o PHP 4 llaman constructores de la clase base @@ -514,7 +598,7 @@ apropiado. </simpara> </caution> - + <note> <simpara> No hay destructores en PHP 3 o PHP 4. Puede usar @@ -522,7 +606,7 @@ emular la mayoría de efectos de los destructores. </simpara> </note> - + <para> Los destructores son funciones que son llamadas automáticamente cuando un objeto es destruido, ya sea con @@ -532,7 +616,9 @@ </sect1> <sect1 id="keyword.paamayim-nekudotayim"><!-- :-) --> - <title><literal>::</literal></title> + <title>Operador de Resolución de Contexto + (<literal>::</literal>)</title> + <caution> <simpara> @@ -943,8 +1029,8 @@ ?> ]]> </programlisting> - </informalexample> - </para> + </informalexample> + </para> <para> Otro ejemplo final, intente entenderlo. <informalexample> @@ -996,9 +1082,7 @@ ?> ]]> </programlisting> - <para> - Este ejemplo producirá la salida: - </para> + &example.outputs; <screen> <![CDATA[ clase A: 10 @@ -1080,9 +1164,9 @@ ?> ]]> </programlisting> - </example> - Veremos: + &example.outputs; <screen> +<![CDATA[ Comparar instancias creadas con los mismos parámetros o1 == o2 : TRUE o1 != o2 : FALSE @@ -1100,7 +1184,9 @@ o1 != o2 : TRUE o1 === o2 : FALSE o1 !== o2 : TRUE - </screen> +]]> + </screen> + </example> Que es la salida que podemos esperar dadas las reglas de comparación descritas anteriormente. Solo las instancias con los mismos valores para sus atributos y de la misma clase son @@ -1149,9 +1235,9 @@ ?> ]]> </programlisting> - </example> - Cosa que entrega la salida esperada: + &example.outputs; <screen> +<![CDATA[ Objetos compuestos u(o,p) y v(q,p) o1 == o2 : TRUE o1 != o2 : FALSE @@ -1163,11 +1249,13 @@ o1 != o2 : TRUE o1 === o2 : FALSE o1 !== o2 : TRUE - </screen> +]]> + </screen> + </example> </para> </sect1> </chapter> - + <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/diff.php/phpdoc-es/language/operators.xml?r1=1.15&r2=1.16&ty=u Index: phpdoc-es/language/operators.xml diff -u phpdoc-es/language/operators.xml:1.15 phpdoc-es/language/operators.xml:1.16 --- phpdoc-es/language/operators.xml:1.15 Mon Aug 23 00:48:06 2004 +++ phpdoc-es/language/operators.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> -<!-- EN-Revision: 1.80 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.16 $ --> +<!-- EN-Revision: 1.84 Maintainer: lboshell Status: ready --> <chapter id="language.operators"> <title>Operadores</title> <simpara> @@ -30,7 +30,7 @@ ejecución. Rodear las expresiones ternarias con paréntesis es una muy buena idea. </para> - + <sect1 id="language.operators.precedence"> <title>Precedencia de Operadores</title> <para> @@ -59,90 +59,163 @@ <row> <entry>Asociatividad</entry> <entry>Operadores</entry> + <entry>Información Adicional</entry> </row> </thead> <tbody> <row> <entry>no-asociativo</entry> <entry>new</entry> + <entry><link + linkend="language.oop5.basic.new">new</link></entry> </row> <row> <entry>derecha</entry> <entry>[</entry> + <entry><function>array</function></entry> </row> <row> <entry>no-asociativos</entry> <entry>++ --</entry> + <entry> + <link + linkend="language.operators.increment">incremento/decremento</link> + </entry> </row> <row> <entry>no-asociativos</entry> <entry>! ~ - (int) (float) (string) (array) (object) @</entry> + <entry> + <link linkend="language.types">tipos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>* / %</entry> + <entry> + <link + linkend="language.operators.arithmetic">aritmética</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>+ - .</entry> + <entry> + <link + linkend="language.operators.arithmetic">aritmética</link>&listendand; + <link linkend="language.operators.string">cadena</link> + </entry> </row> <row> <entry>izquierda</entry> <entry><< >></entry> + <entry> + <link linkend="language.operators.bitwise">manejo de bits</link> + </entry> </row> <row> <entry>no-asociativos</entry> <entry>< <= > >=</entry> + <entry> + <link + linkend="language.operators.comparison">comparación</link> + </entry> </row> <row> <entry>no-asociativos</entry> <entry>== != === !==</entry> + <entry> + <link + linkend="language.operators.comparison">comparación</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>&</entry> + <entry> + <link linkend="language.operators.bitwise">manejo de + bits</link>&listendand; <link + linkend="language.references">referencias</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>^</entry> + <entry> + <link linkend="language.operators.bitwise">manejo de + bits</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>|</entry> + <entry> + <link linkend="language.operators.bitwise">manejo de + bits</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>&&</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>||</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>? :</entry> + <entry> + <link + linkend="language.operators.comparison.ternary">ternario</link> + </entry> </row> <row> <entry>derecha</entry> <entry> = += -= *= /= .= %= &= |= ^= <<= >>= </entry> + <entry> + <link + linkend="language.operators.assignment">asignación</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>and</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>xor</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>or</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>,</entry> + <entry>varios usos</entry> </row> </tbody> </tgroup> @@ -517,10 +590,22 @@ </programlisting> </informalexample> </para> + <para> - Otro operador condicional es el operador "?:" (o ternario). - <informalexample> - <programlisting role="php"> + Vea también <function>strcasecmp</function>, + <function>strcmp</function>, + <link linkend="language.operators.array">Operadores de + matriz</link>, y la sección del manual sobre + <link linkend="language.types">Tipos</link>. + </para> + + <sect2 id="language.operators.comparison.ternary"> + <title>Operador Ternario</title> + <para> + Otro operador condicional es el operador "?:" (o ternario). + <example> + <title>Asignación de un valor predeterminado</title> + <programlisting role="php"> <![CDATA[ <?php // Ejemplo de uso de: el Operador Ternario @@ -532,23 +617,20 @@ } else { $accion = $_POST['accion']; } + ?> ]]> - </programlisting> - </informalexample> - La expresión <literal>(expr1) ? (expr2) : (expr3)</literal> - evalúa a <replaceable>expr2</replaceable> si - <replaceable>expr1</replaceable> evalúa a &true;, y - <replaceable>expr3</replaceable> si - <replaceable>expr1</replaceable> evalúa a &false;. - </para> - <para> - Vea también <function>strcasecmp</function>, - <function>strcmp</function>, - <link linkend="language.operators.array">Operadores de - matriz</link>, y la sección del manual sobre - <link linkend="language.types">Tipos</link>. - </para> + </programlisting> + </example> + La expresión <literal>(expr1) ? (expr2) : + (expr3)</literal> evalúa a + <replaceable>expr2</replaceable> si + <replaceable>expr1</replaceable> evalúa a &true;, y + <replaceable>expr3</replaceable> si + <replaceable>expr1</replaceable> evalúa a &false;. + </para> + </sect2> + </sect1> <sect1 id="language.operators.errorcontrol"> @@ -753,21 +835,19 @@ $i = 'W'; for($n=0; $n<6; $n++) echo ++$i . "\n"; - -/* - Produce una salida similar a la siguiente: - +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ X Y Z AA AB AC - -*/ -?> ]]> - </programlisting> + </screen> </example> </para> <para> @@ -865,7 +945,7 @@ <link linkend="ref.strings">funciones de Cadenas</link>. </para> </sect1> - + <sect1 id="language.operators.array"> <title>Operadores de Matrices</title> <table> @@ -887,13 +967,14 @@ <row> <entry>$a == $b</entry> <entry>Igualdad</entry> - <entry>&true; si $a y $b tienen los mismos elementos.</entry> + <entry>&true; si $a y $b tienen las mismas parejas + llave/valor.</entry> </row> <row> <entry>$a === $b</entry> <entry>Identidad</entry> - <entry>&true; si $a y $b tienen los mismos elementos en el - mismo orden.</entry> + <entry>&true; si $a y $b tienen las mismas parejas llave/valor + en el mismo orden y de los mismos tipos.</entry> </row> <row> <entry>$a != $b</entry> http://cvs.php.net/diff.php/phpdoc-es/language/types.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc-es/language/types.xml diff -u phpdoc-es/language/types.xml:1.10 phpdoc-es/language/types.xml:1.11 --- phpdoc-es/language/types.xml:1.10 Thu Aug 19 17:13:10 2004 +++ phpdoc-es/language/types.xml Tue Mar 1 17:39:48 2005 @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- EN-Revision: 1.140 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.11 $ --> +<!-- EN-Revision: 1.150 Maintainer: lboshell Status: ready --> <chapter id="language.types"> <title>Tipos</title> <sect1 id="language.types.intro"> <title>Introducción</title> - + <simpara> PHP soporta ocho tipos primitivos. </simpara> - + <para> Cuatro tipos escalares: <itemizedlist> @@ -80,19 +80,19 @@ <listitem> <simpara> - <link linkend="language.types.mixed">mixed</link> + <type>mixed</type> </simpara> </listitem> <listitem> <simpara> - <link linkend="language.types.number">number</link> + <type>number</type> </simpara> </listitem> <listitem> <simpara> - <link linkend="language.types.mixed">callback</link> + <type>callback</type> </simpara> </listitem> @@ -101,7 +101,7 @@ "double". Considere al tipo double como el mismo que float, los dos nombres existen solo por razones históricas. </para> - + <simpara> El tipo de una variable usualmente no es declarado por el programador; en cambio, es decidido en tiempo de @@ -247,7 +247,7 @@ linkend="language.types.type-juggling">Manipulación de Tipos</link>. </simpara> - + <para> Cuando se realizan conversiones a <type>boolean</type>, los siguientes valores son considerados &false;: @@ -278,7 +278,7 @@ </listitem> <listitem> <simpara>un <link linkend="language.types.object">object</link> - con cero variables miembro</simpara> + con cero variables miembro (sólo en PHP 4)</simpara> </listitem> <listitem> <simpara>el tipo especial <link @@ -558,7 +558,7 @@ </sect3> </sect2> </sect1> - + <sect1 id="language.types.float"> <title>Números de punto flotante</title> <para> @@ -569,8 +569,8 @@ <programlisting role="php"> <![CDATA[ <?php -$a = 1.234; -$b = 1.2e3; +$a = 1.234; +$b = 1.2e3; $c = 7E-10; ?> ]]> @@ -579,9 +579,11 @@ Formalmente: <informalexample> <programlisting role="php"> +<![CDATA[ LNUM [0-9]+ DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) EXPONENT_DNUM ( ({LNUM} | {DNUM}) [eE][+-]? {LNUM}) +]]> </programlisting> </informalexample> El tamaño de un flotante depende de la plataforma, aunque @@ -589,7 +591,7 @@ una precisión de aproximadamente 14 dígitos decimales (lo que es un valor de 64 bits en formato IEEE). </para> - + <warning id="warn.float-precision"> <title>Precisión del punto flotante</title> <para> @@ -625,7 +627,7 @@ <sect2 id="language.types.float.casting"> <title>Conversión a flotante</title> - + <para> Para más información sobre cuándo y cómo son convertidas las cadenas a flotantes, vea la @@ -635,7 +637,9 @@ conversión es la misma que si el valor hubiese sido convertido a entero y luego a flotante. Vea la sección <link linkend="language.types.integer.casting">Conversión - a entero</link> para más información. + a entero</link> para más información. A partir de + PHP 5, una noticia es generada si intenta convertir un objeto a + flotante. </para> </sect2> </sect1> @@ -1182,10 +1186,10 @@ caracter</link>. </simpara> </sect2> - + <sect2 id="language.types.string.casting"> <title>Conversión a cadena</title> - + <para> Es posible convertir un valor a una cadena usando el moldeamiento <literal>(string)</literal>, o la función @@ -1230,7 +1234,8 @@ variables miembro de un <type>object</type> para efectos de depuración, lea los parágrafos siguientes. Si quiere conocer el nombre de clase del cual un objeto dado es - instancia, use <function>get_class</function>. + instancia, use <function>get_class</function>. A partir de PHP 5, + el método __toString() es usado si resulta aplicable. </para> <para> Los recursos son siempre convertidos a cadenas con la estructura @@ -1465,7 +1470,7 @@ type</literal>. </para> </sect3> - + <sect3 id="language.types.array.syntax.modifying"> <title>Creación/modificación con sintaxis de corchetes cuadrados</title> @@ -1568,11 +1573,10 @@ $matriz[] = 7; print_r($matriz); ?> -]]> +]]> </programlisting> - <para> - El anterior ejemplo produciría la siguiente salida: - <screen> + &example.outputs; + <screen> <![CDATA[ Array ( @@ -1595,14 +1599,13 @@ [1] => 7 ) ]]> - </screen> - </para> - </informalexample> + </screen> + </informalexample> </note> </sect3> </sect2><!-- end syntax --> - + <sect2 id="language.types.array.useful-funcs"> <title>Funciones útiles</title> <para> @@ -1636,9 +1639,9 @@ ]]> </programlisting> </informalexample> - - </para> - </note> + + </para> + </note> <para> La estructura de control <link linkend="control-structures.foreach">foreach</link> existe @@ -1646,7 +1649,7 @@ manera fácil de recorrer una matriz. </para> </sect2> - + <sect2 id="language.types.array.donts"> <title>Recomendaciones sobre matrices y cosas a evitar</title> @@ -1715,9 +1718,8 @@ ]]> </programlisting> </informalexample> - <para> - La salida del anterior fragmento es: - <screen> + &example.outputs; + <screen> <![CDATA[ Revisando 0: Notice: Undefined index: $i in /path/to/script.html on line 9 @@ -1734,9 +1736,8 @@ Notice: Undefined index: $i in /path/to/script.html on line 11 Mal: Bien: 2 -]]> - </screen> - </para> +]]> + </screen> </note> <para> Más ejemplos para demostrar este hecho: @@ -1902,7 +1903,7 @@ de la matriz. Las claves son los nombres de las variables miembro. </para> - + <para> Si convierte un valor &null; a matriz, obtiene una matriz vacía. @@ -1955,7 +1956,7 @@ </programlisting> </informalexample> </para> - + <example> <title>Uso de array()</title> <programlisting role="php"> @@ -1967,7 +1968,7 @@ 'idioma => 'ingles', 'etiquetas_cortas' => true ); - + // claves estrictamente numericas $matriz = array( 7, 8, @@ -1986,9 +1987,9 @@ '02' => 77, // clave = '02' 0 => 12 // el valor 10 sera reemplazado por 12 ); - + // matriz vacia -$vacio = array(); +$vacio = array(); ?> ]]> <!-- TODO example of @@ -2013,9 +2014,7 @@ ?> ]]> </programlisting> - <para> - Esto producirá la salida: - </para> + &example.outputs; <screen> <![CDATA[ ¿Le gusta el rojo? @@ -2025,14 +2024,14 @@ ]]> </screen> </example> - + <para> Note que actualmente no es posible cambiar los valores de la matriz directamente en un ciclo de ese tipo. <!-- Should be made possible, if you write: foreach ( $colors as &$color ) - + See bug#3074 --> Una solución parcial es la siguiente: @@ -2052,9 +2051,7 @@ ?> ]]> </programlisting> - <para> - Esto genera la salida: - </para> + &example.outputs; <screen> <![CDATA[ Array @@ -2080,18 +2077,16 @@ ?> ]]> </programlisting> - <para> - Esto imprime: - </para> + &example.outputs; <screen> <![CDATA[ -Array +Array ( [1] => 'Enero' [2] => 'Febrero' [3] => 'Marzo' ) -]]> +]]> </screen> </example> </para> @@ -2179,7 +2174,7 @@ $matriz2 = $matriz1; $matriz2[] = 4; // $matriz2 cambia, // $matriz1 sigue siendo array(2, 3) - + $matriz3 = &$matriz1; $matriz3[] = 4; // ahora $matriz1 y $matriz3 son iguales ?> @@ -2225,10 +2220,10 @@ Objetos</link>. </simpara> </sect2> - + <sect2 id="language.types.object.casting"> <title>Conversión a objeto</title> - + <para> Si un objeto es convertido a un objeto, éste no es modificado. Si un valor de cualquier otro tipo es convertido a @@ -2249,12 +2244,12 @@ </informalexample> </para> </sect2> - + </sect1> <sect1 id="language.types.resource"> <title>Recurso</title> - + <para> Un recurso es una variable especial, que contiene una referencia a un recurso externo. Los recursos son creados y usados por @@ -2262,16 +2257,20 @@ linkend="resource">apéndice</link> para un listado de todas estas funciones y los tipos de recurso correspondientes. </para> - + <note> <simpara> El tipo recurso fue introducido en PHP 4 </simpara> </note> + <para> + Vea también <function>get_resource_type</function>. + </para> + <sect2 id="language.types.resource.casting"> <title>Conversión a un recurso</title> - + <para> Dado que los tipos de recurso contienen gestores especiales a archivos abiertos, conexiones con bases de datos, áreas de @@ -2282,7 +2281,7 @@ <sect2 id="language.types.resource.self-destruct"> <title>Liberación de recursos</title> - + <para> Gracias al sistema de conteo de referencias introducido con el Motor Zend de PHP 4, se detecta automáticamente cuando un @@ -2301,13 +2300,13 @@ </simpara> </note> </para> - + </sect2> </sect1> - + <sect1 id="language.types.null"> <title>NULL</title> - + <para> El valor especial &null; representa que una variable no tiene valor. &null; es el único valor posible del tipo @@ -2315,7 +2314,7 @@ </para> <note> <simpara> - El tipo null se introdujo en PHP 4 + El tipo null se introdujo en PHP 4. </simpara> </note> <para> @@ -2338,7 +2337,7 @@ </listitem> </itemizedlist> </para> - + <sect2 id="language.types.null.syntax"> <title>Sintaxis</title> <para> @@ -2348,7 +2347,7 @@ <programlisting role="php"> <![CDATA[ <?php -$var = NULL; +$var = NULL; ?> ]]> </programlisting> @@ -2360,7 +2359,7 @@ </para> </sect2> </sect1> - + <sect1 id="language.pseudo-types"> <title>Pseudo-tipos usados en esta documentación</title> @@ -2376,7 +2375,7 @@ aceptará cadenas y matrices. </para> </sect2> - + <sect2 id="language.types.number"> <title>number</title> <para> @@ -2425,33 +2424,35 @@ </title> <programlisting role="php"> <![CDATA[ -<?php +<?php -// ejemplo simple de una llamada de retorno +// Una llamada de retorno de ejemplo function mi_llamada_de_retorno() { echo '¡Hola mundo!'; } -call_user_func('mi_llamada_de_retorno'); -// ejemplos de un método como llamada de retorno +// Un método como llamada de retorno de ejemplo class MiClase { function miMetodoDeRetorno() { echo '¡Hola Mundo!'; } } -// llamada de metodo estatico de clase sin instanciar un objeto +// Tipo 1: Llamada de retorno simple +call_user_func('mi_llamada_de_retorno'); + +// Tipo 2: Llamada de metodo estatico de clase call_user_func(array('MiClase', 'miMetodoDeRetorno')); -// llamada a un metodo de objeto +// Tipo 3: Llamada a un metodo de objeto $obj = new MiClase(); call_user_func(array(&$obj, 'miMetodoDeRetorno')); ?> ]]> </programlisting> </example> - </para> - + </para> + </sect2> </sect1> @@ -2657,7 +2658,7 @@ </informalexample> </para> </note> - + <para> Puede que no sea obvio qué sucede exactamente cuando se moldea entre ciertos tipos. Para más información, http://cvs.php.net/co.php/phpdoc-es/faq/migration5.xml?r=1.1&p=1 Index: phpdoc-es/faq/migration5.xml +++ phpdoc-es/faq/migration5.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> <chapter id="faq.migration5"> <title>Migración desde PHP 4 a PHP 5</title> <titleabbrev>Migración desde PHP 4 a PHP 5</titleabbrev> <para> Esta sección del faq le ayudará con la migración de PHP 4 a PHP 5. </para> <qandaset> <qandaentry id="faq.migration5.php45"> <question> <para> Migración desde PHP 4 a PHP 5 </para> </question> <answer> <para> Aunque PHP 5 ofrece varias características nuevas, está diseñado para ser tan compatible con versiones anteriores de PHP como es posible, y con muy poca funcionalidad afectada en el proceso. </para> <para> Asegúrese de leer el <link linkend="migration5">apéndice de migración de PHP 5</link> apropiado de este manual, ya que contiene más información sobre el tema de la migración a PHP 5. </para> </answer> </qandaentry> <qandaentry id="faq.migration5.mysql"> <question> <para> ¿Funciona MySQL en PHP 5? Parece haber desaparecido. </para> </question> <answer> <para> <link linkend="ref.mysql">MySQL</link> es soportado, el único cambio es que el soporte MySQL no se habilita <emphasis>por defecto</emphasis> en PHP 5. Esto básicamente quiere decir que PHP no incluye la opción <option role="configure">--with-mysql</option> en la línea <link linkend="configuration">configure</link>, así que tendrá que usarla manualmente cuando compile PHP. Los usuarios de windows deben editar &php.ini; y habilitar el recurso DLL <filename>php_mysql.dll</filename>, ya que en PHP 4 tal DLL no existía, simplemente estaba incorporado en los binarios de Windows de PHP. </para> <para> Asimismo, las bibliotecas de cliente MySQL no son incorporadas con PHP. Este tema se cubre con más detalle en <link linkend="faq.databases.mysql.php5">el siguiente FAQ</link>, y asegúrese de leer la <link linkend="ref.mysql">sección de MySQL</link> para más detalles sobre la instalación de MySQL. Una línea configure de ejemplo sería <option role="configure">--with-mysql=/usr</option> mientras que los usuarios de Windows necesitará el archivo <filename>libmySQL.dll</filename> disponible en el sistema. </para> </answer> </qandaentry> <qandaentry id="faq.migration5.oop"> <question> <para> He escuchado que PHP 5 tiene un modelo de Programación Orientada a Objetos completamente nuevo, ¿funcionará my código OO? ¿Dónde puedo encontrar información sobre estas nuevas características de programación OO? </para> </question> <answer> <para> El principal cambio en PHP 5 afecta el modelo OO ya que PHP 5 ahora usa el <emphasis>Motor Zend 2.0</emphasis>. La directiva <link linkend="ini.zend.ze1-compatibility-mode">zend.ze1_compatibility_mode</link> habilita la compatibilidad con el Motor Zend 1.0 (PHP 4). </para> <para> El nuevo modelo de programación orientada a objetos se documenta en las secciones de <link linkend="language.oop5">referencia OO del lenguaje</link> y el <link linkend="migration5.oop">apéndice de migración OO</link>. </para> </answer> </qandaentry> <qandaentry id="faq.migration5.changes"> <question> <para> Y bien, aparte del nuevo modelo OO, ¿qué más ha cambiado en PHP 5? También, ¿existe una versión específica a PHP 5 del manual de PHP? </para> </question> <answer> <para> Pocos cambios adicionales existen, vea el <link linkend="migration5">apéndice de migración a PHP 5</link> para más detalles. No habrá una versión específica a PHP 5 del manual, ya que la mayoría del lenguaje PHP permanece igual. </para> </answer> </qandaentry> </qandaset> </chapter> <!-- 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 -->
http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.187&r2=1.188&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.187 phpdoc-es/translation.xml:1.188 --- phpdoc-es/translation.xml:1.187 Wed Feb 23 14:02:56 2005 +++ phpdoc-es/translation.xml Tue Mar 1 17:39:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.187 $ --> +<!-- $Revision: 1.188 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -86,9 +86,6 @@ <file name="faq/html.xml" person="webstudio" type="translation" date="11.05.2003"/> - <file name="faq/migration5.xml" person="lboshell" - type="translation" date="24.08.2004" /> - <file name="install/*" person="rafael" type="translation" date="31.08.2004"/> http://cvs.php.net/diff.php/phpdoc-es/appendices/filters.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/appendices/filters.xml diff -u phpdoc-es/appendices/filters.xml:1.2 phpdoc-es/appendices/filters.xml:1.3 --- phpdoc-es/appendices/filters.xml:1.2 Fri Feb 11 23:33:05 2005 +++ phpdoc-es/appendices/filters.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.13 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.14 Maintainer: lboshell Status: ready --> <appendix id="filters"> <title>Lista de Filtros Disponibles</title> <para> @@ -248,13 +248,14 @@ <title>Filtros de Compresión</title> <simpara> - Mientras que <xref linkend="wrappers.compression"/> ofrece una - forma de crear archivos compatibles con gzip y bz2 en el sistema de - archivos local, no ofrece un método de compresión - generalizado sobre secuencias de red, ni ofrece la forma de - comenzar con una secuencia no-comprimida y trasladarse a una - comprimida. Para esto, un filtro de compresión puede ser - aplicado sobre cualquier recurso de secuencia en cualquier momento. + Aunque las <link linkend="wrappers.compression">Envolturas de + Compresión</link> ofrecen una forma de crear archivos + compatibles con gzip y bz2 en el sistema de archivos local, no + ofrecen un método de compresión generalizado sobre + secuencias de red, ni ofrecen la forma de comenzar con una + secuencia no-comprimida y trasladarse a una comprimida. Para esto, + un filtro de compresión puede ser aplicado sobre cualquier + recurso de secuencia en cualquier momento. </simpara> <note> @@ -312,7 +313,7 @@ <simpara> Los filtros de compresión zlib.* están disponibles con PHP desde la versión <literal>5.1.0</literal> si el - soporte <xref linkend="ref.zlib"/> se encuentra + soporte de <link linkend="ref.zlib">zlib</link> se encuentra habilitado. También están disponibles como una característica portada de vuelta en la versión <literal>5.0.x</literal>, instalando el paquete <ulink @@ -421,7 +422,7 @@ <simpara> Las filtros de compresión bzip2.* se encuentran disponibles con PHP desde la versión <literal>5.1.0</literal> si el - soporte <xref linkend="ref.bzip2"/> se encuentra + soporte de <link linkend="ref.bzip2">bz2</link> se encuentra habilitado. También se encuentran disponibles como una característica portada hacia atrás en la versión <literal>5.0.x</literal>, instalando el paquete @@ -461,6 +462,124 @@ </example> </section> + <section id="filters.encryption"> + <title>Filtros de Encripción</title> + + <simpara> + <literal>mcrypt.*</literal> y <literal>mdecrypt.*</literal> ofrecen + encripción y desencripción simétrica usando + libmcrypt. Ambos conjuntos de filtros soportan los mismos + algoritmos disponibles a la <link + linkend="ref.mcrypt">extensión mcrypt</link> en la forma de + <literal>mcrypt.ciphername</literal>, en donde + <parameter>ciphername</parameter> es el nombre del cifrado que debe + ser pasado a <function>mcrypt_module_open</function>. Los + siguientes cinco parámetros se encuentran disponibles + también: + </simpara> + + <para> + <table> + <title>parámetros del filtro mcrypt</title> + <tgroup cols="4"> + <thead> + <row> + <entry>Parámetro</entry> + <entry>¿Requerido?</entry> + <entry>Predeterminado</entry> + <entry>Ejemplos</entry> + </row> + </thead> + <tbody> + <row> + <entry>mode</entry> + <entry>Opcional</entry> + <entry>cbc</entry> + <entry>cbc, cfb, ecb, nofb, ofb, stream</entry> + </row> + <row> + <entry>algorithms_dir</entry> + <entry>Opcional</entry> + <entry>ini_get('mcrypt.algorithms_dir')</entry> + <entry>Ubicación de los módulos de los + algoritmos</entry> + </row> + <row> + <entry>modes_dir</entry> + <entry>Opcional</entry> + <entry>ini_get('mcrypt.modes_dir')</entry> + <entry>Ubicación de los módulos de los + modos</entry> + </row> + <row> + <entry>iv</entry> + <entry>Requerido</entry> + <entry>N/A</entry> + <entry>Usualmente 8, 16, o 32 bytes de datos binarios. Depende + del cifrado</entry> + </row> + <row> + <entry>key</entry> + <entry>Requerido</entry> + <entry>N/A</entry> + <entry>Usualmente 8, 16, o 32 bytes de datos binarios. Depende + del cifrado</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <example> + <title>Encripción de la salida usando 3DES</title> + <programlisting role="php"> +<![CDATA[ +<?php +$frase_secreta = 'Mi secreto'; + +/* Convertir una frase legible en una pareja iv/llave reproducible + */ +$iv = substr(md5('iv'.$frase_secreta, true), 0, 8); +$llave = substr(md5('contrasenya1'.$frase_secreta, true) . + md5('contrasenya2'.$frase_secreta, true), 0, 24); +$opciones = array('iv'=>$iv, 'key'=>$key); + +$da = fopen('archivo-secreto.enc', 'wb'); +stream_filter_append($da, 'mcrypt.tripledes', STREAM_FILTER_WRITE, $opciones); +fwrite($da, 'Datos muy muy muy secretos'); +fclose($da); +?> +]]> + </programlisting> + </example> + + <example> + <title>Lectura de un archivo encriptado</title> + <programlisting role="php"> +<![CDATA[ +<?php +$frase_secreta = 'Mi secreto'; + +/* Convertir una frase legible en una pareja iv/llave reproducible + */ +$iv = substr(md5('iv'.$frase_secreta, true), 0, 8); +$llave = substr(md5('contrasenya1'.$frase_secreta, true) . + md5('contrasenya2'.$frase_secreta, true), 0, 24); +$opciones = array('iv'=>$iv, 'key'=>$llave); + +$da = fopen('archivo-secreto.enc', 'rb'); +stream_filter_append($da, 'mdecrypt.tripledes', STREAM_FILTER_WRITE, $opciones); +$datos = rtrim(stream_get_contents($da)); +fclose($da); + +echo $datos; +?> +]]> + </programlisting> + </example> + + </section> + </appendix> <!-- Keep this comment at the end of the file http://cvs.php.net/diff.php/phpdoc-es/appendices/ini.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-es/appendices/ini.xml diff -u phpdoc-es/appendices/ini.xml:1.4 phpdoc-es/appendices/ini.xml:1.5 --- phpdoc-es/appendices/ini.xml:1.4 Fri Feb 11 23:33:05 2005 +++ phpdoc-es/appendices/ini.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.10 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.13 Maintainer: lboshell Status: ready --> <appendix id="ini"> <title>Directivas de &php.ini;</title> @@ -193,7 +193,7 @@ <entry>Disponible a partir de PHP 4.3.0.</entry> </row> <row> - <entry>auto_globals_jit</entry> + <entry><link linkend="ini.auto-globals-jit">auto_globals_jit</link></entry> <entry>"1"</entry> <entry>PHP_INI_PERDIR</entry> <entry>Disponible a partir de PHP 5.0.0.</entry> @@ -613,6 +613,12 @@ <entry>PHP_INI_SYSTEM en PHP <= 4.2.3. Disponible a partir de PHP 4.0.2.</entry> </row> <row> + <entry>http.allowed_methods</entry> + <entry>"OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT"</entry> + <entry>PHP_INI_ALL</entry> + <entry></entry> + </row> + <row> <entry>hyperwave.allow_persistent</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> @@ -2017,6 +2023,12 @@ <entry>Disponible a partir de PHP 4.3.0.</entry> </row> <row> + <entry>yaz.log_mask</entry> + <entry>NULL</entry> + <entry>PHP_INI_ALL</entry> + <entry></entry> + </row> + <row> <entry>yaz.max_links</entry> <entry>"100"</entry> <entry>PHP_INI_ALL</entry> @@ -2067,22 +2079,27 @@ <entry>PHP_INI_USER</entry> <entry>1</entry> <entry>La entrada puede definirse en scripts de usuario</entry> + <entry></entry> </row> <row> <entry>PHP_INI_PERDIR</entry> <entry>2</entry> <entry>La entrada puede definirse en &php.ini;, &htaccess; o &httpd.conf;</entry> + <entry></entry> </row> <row> <entry>PHP_INI_SYSTEM</entry> <entry>4</entry> - <entry>La entrada puede definirse en &php.ini; o &httpd.conf;</entry> + <entry>La entrada puede definirse en &php.ini; o + &httpd.conf;</entry> + <entry></entry> </row> <row> <entry>PHP_INI_ALL</entry> <entry>7</entry> <entry>La entrada puede definirse en cualquier parte</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2108,12 +2125,13 @@ <para> <table> <title>Opciones Httpd</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -2121,6 +2139,7 @@ <entry>async_send</entry> <entry>"0"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2136,49 +2155,57 @@ <table> <title>Opciones del Lenguaje y Configuración Variada</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> <row> <entry>short_open_tag</entry> - <entry>On</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.0.0.</entry> </row> <row> <entry>asp_tags</entry> - <entry>Off</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>"0"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL in PHP <= 4.0.0.</entry> </row> <row> <entry>precision</entry> <entry>"14"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>y2k_compliance</entry> - <entry>Off</entry> + <entry>"1"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>allow_call_time_pass_reference</entry> - <entry>On</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.0.0.</entry> </row> <row> <entry>expose_php</entry> - <entry>On</entry> - <entry>PHP_INI_SYSTEM</entry> + <entry>"1"</entry> + <entry>sólo &php.ini;</entry> + <entry></entry> </row> <row> <entry>zend.ze1_compatibility_mode</entry> - <entry>Off</entry> + <entry>"0"</entry> <entry>PHP_INI_ALL</entry> + <entry>Disponible a partir de PHP 5.0.0.</entry> </row> </tbody> </tgroup> @@ -2335,6 +2362,11 @@ Habilita el modo de compatibilidad con el Motor Zend 1 (PHP 4). Afecta el modo de clonar, moldear y comparar objetos. </para> + <para> + Vea también la sección titulada <link + linkend="migration5">Migración de PHP 4 a PHP + 5</link>. + </para> </listitem> </varlistentry> </variablelist> @@ -2346,12 +2378,13 @@ <para> <table> <title>Límites de Recursos</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -2359,6 +2392,7 @@ <entry>memory_limit</entry> <entry>"8M"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2411,12 +2445,13 @@ <table> <title>Opciones de Configuración de Manejo de Datos</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -2429,71 +2464,87 @@ <entry>arg_separator.output</entry> <entry>"&"</entry> <entry>PHP_INI_ALL</entry> + <entry>Disponible desde PHP 4.0.5.</entry> </row> <row> <entry>arg_separator.input</entry> <entry>"&"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>Disponible desde PHP 4.0.5.</entry> </row> <row> <entry>variables_order</entry> <entry>"EGPCS"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>register_globals</entry> - <entry>"Off"</entry> - <entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry> + <entry>"0"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>register_argc_argv</entry> - <entry>"On"</entry> - <entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>register_long_arrays</entry> - <entry>"On"</entry> - <entry>PHP_INI_PERDIR|PHP_INI_SYSTEM</entry> + <entry>"1"</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>Disponible desde PHP 5.0.0.</entry> </row> <row> <entry>post_max_size</entry> <entry>"8M"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_SYSTEM en PHP <= 4.2.3. Disponible desde PHP + 4.0.3.</entry> </row> <row> <entry>gpc_order</entry> <entry>"GPC"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>auto_prepend_file</entry> - <entry>""</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>NULL</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>auto_append_file</entry> - <entry>""</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>NULL</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> <row> <entry>default_mimetype</entry> <entry>"text/html"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>default_charset</entry> - <entry>"iso-8859-1"</entry> + <entry>""</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>always_populate_raw_post_data</entry> <entry>"0"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3. Disponible desde PHP + 4.1.0.</entry> </row> <row> <entry>allow_webdav_methods</entry> <entry>"0"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -2581,6 +2632,32 @@ </listitem> </varlistentry> + <varlistentry id="ini.auto-globals-jit"> + <term> + <parameter>auto_globals_jit</parameter> + <type>boolean</type> + </term> + <listitem> + <para> + Cuando es habilitado el parámetro, las variables + SERVER y ENV son creadas al usarse por primera vez ("Just In + Time", o justo a tiempo) en lugar de hacerlo cuando el script + inicia. Si estas variables no son usadas al interior del + script, esta directiva resultará en una ganancia en + rendimiento. + </para> + <para> + Las directivas de PHP <link + linkend="ini.register-globals">register_globals</link>, <link + linkend="ini.register-long-arrays">register_long_arrays</link>, + y <link + linkend="ini.register-argc-argv">register_argc_argv</link> + deben ser deshabilitadas para que esta directiva tenga + efecto. + </para> + </listitem> + </varlistentry> + <varlistentry id="ini.register-globals"> <term> <parameter>register_globals</parameter> @@ -2838,60 +2915,71 @@ <title>Rutas y Directorios</title> <para> <table> - <title>Opciones de Configuración de Rutas y Directorios</title> - <tgroup cols="3"> + <title>Opciones de Configuración de Rutas y + Directorios</title> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> <row> <entry>include_path</entry> - <entry>PHP_INCLUDE_PATH</entry> + <entry>".;/ruta/hacia/php/pear"</entry> <entry>PHP_INI_ALL</entry> + <entry></entry> </row> <row> <entry>doc_root</entry> - <entry>PHP_INCLUDE_PATH</entry> + <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>user_dir</entry> <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>extension_dir</entry> - <entry>PHP_EXTENSION_DIR</entry> + <entry>"/ruta/hacia/php"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.fix_pathinfo</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.force_redirect</entry> <entry>"1"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.redirect_status_env</entry> <entry>""</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>fastcgi.impersonate</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>cgi.rfc2616_headers</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> </tbody> </tgroup> @@ -3126,12 +3214,13 @@ <table> <title>Opciones de Configuración de Carga de Archivos</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry>Cambios</entry> </row> </thead> <tbody> @@ -3139,16 +3228,20 @@ <entry>file_uploads</entry> <entry>"1"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3. Disponible desde PHP + 4.0.3.</entry> </row> <row> <entry>upload_tmp_dir</entry> <entry>NULL</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> <row> <entry>upload_max_filesize</entry> <entry>"2M"</entry> - <entry>PHP_INI_SYSTEM|PHP_INI_PERDIR</entry> + <entry>PHP_INI_PERDIR</entry> + <entry>PHP_INI_ALL en PHP <= 4.2.3.</entry> </row> </tbody> </tgroup> @@ -3216,12 +3309,13 @@ <para> <table> <title>Opciones Generales de Configuración SQL</title> - <tgroup cols="3"> + <tgroup cols="4"> <thead> <row> <entry>Nombre</entry> <entry>Predeterminado</entry> <entry>Modificable</entry> + <entry></entry> </row> </thead> <tbody> @@ -3229,6 +3323,7 @@ <entry>sql.safe_mode</entry> <entry>"0"</entry> <entry>PHP_INI_SYSTEM</entry> + <entry></entry> </row> </tbody> </tgroup> http://cvs.php.net/diff.php/phpdoc-es/appendices/migration5.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/appendices/migration5.xml diff -u phpdoc-es/appendices/migration5.xml:1.1 phpdoc-es/appendices/migration5.xml:1.2 --- phpdoc-es/appendices/migration5.xml:1.1 Fri Feb 11 23:33:05 2005 +++ phpdoc-es/appendices/migration5.xml Tue Mar 1 17:39:48 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- EN-Revision: 1.39 Maintainer: lboshell Status: ready --> <appendix id="migration5"> <title>Migración desde PHP 4 a PHP 5</title> @@ -857,7 +857,7 @@ <note> <para> La extensión <link linkend="ref.tidy">Tidy</link> ha - modificado tambión su API por completo. + modificado también su API por completo. </para> </note> </section> http://cvs.php.net/diff.php/phpdoc-es/faq/installation.xml?r1=1.11&r2=1.12&ty=u Index: phpdoc-es/faq/installation.xml diff -u phpdoc-es/faq/installation.xml:1.11 phpdoc-es/faq/installation.xml:1.12 --- phpdoc-es/faq/installation.xml:1.11 Wed Sep 15 10:23:50 2004 +++ phpdoc-es/faq/installation.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.11 $ --> -<!-- EN-Revision: 1.39 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.12 $ --> +<!-- EN-Revision: 1.42 Maintainer: lboshell Status: ready --> <chapter id="faq.installation"> <title>Instalación</title> <titleabbrev>Instalación</titleabbrev> @@ -25,77 +25,13 @@ <qandaentry id="faq.installation.apache2"> <question> <para> - ¿Porqué no debo usar Apache 2 en un entorno en + ¿Porqué no debo usar Apache 2 con un módulo + de multi-procesamiento (MPM) multi-hilos en un entorno en producción? </para> </question> <answer> <para> - La siguiente respuesta se encuentra basada en este extracto - modificado de un correo por Rasmus Lerdorf. - </para> - <para> - Apache 2 es una versión escrita desde ceros y una - completa modificación de arquitectura a partir de Apache - 1. No es como ir de PHP 3 a PHP4, o de PHP 4 a PHP 5. Hay - bastante código que es común, y ciertamente la - arquitectura base de PHP no ha cambiado a través de los - años. Asi que comparar Apache 1 y Apache 2 contra PHP 4 y - PHP 5 no tiene sentido. La arquitectura ha sido probada a lo - largo de los años y el código, aunque es un poco - inmanejable en algunas partes, es una entidad conocida. PHP fue - diseñado desde los primeros días contra aquella - arquitectura básica de Apache 1 y funciona extremadamente - bien cuando se usa con éste. - </para> - <para> - La característica más importante que atrae a la - gente a Apache 2 es el uso de hilos. En Windows, en donde la - mayoría de bibliotecas básicos son, y deben ser, - seguras con hilos, Apache 2 realmente tiene sentido y - sería bueno resolver los pequeños problemas en esa - plataforma. Sin embargo, en UNIX existen bastante bibliotecas - básicas en donde no se conoce su seguridad con hilos. Y - no se trata de extensiones PHP, se trata de bibliotecas de - terceros por debajo de los cientos de extensiones de PHP. Es - realmente difícil determinar si cierta biblioteca externa - es segura con hilos. Existen bastantes variables involucradas, - incluyendo el SO, la versión del SO, la biblioteca libc, - la versión de esa biblioteca e incluso, en algunas - plataformas, las banderas de compilación usadas para - generar las bibliotecas. Y para hacerlo aun más - divertido, rastrear un problema de seguridad con hilos se - encuentra bastante cerca a lo imposible. Cientos de personas - bien pueden declarar que Apache+PHP+cualquier/extensión - funciona perfectamente para ellos, pero quizás ellos - sólo reciben un millón de peticiones al - día. Luego llega otro usuario quien recibe 100 millones - de peticiones al día y usa una avanzada máquina - con doble-procesador y todo se arruina ya que de repente ahora - la oportunidad para alguna pequeña condición de - carrera se ha hecho mucho mayor debido a las velocidades - más rápidas de cpu, el segundo cpu y la mayor - frecuencia de las peticiones. Y el reporte del fallo que - recibimos de este usuario será algo similar a: - </para> - <blockquote> - <para> - A veces no funciona. La mayoría de veces funciona bien, - pero de repente de vez en cuando no. El error es diferente - cada vez y no tengo idea de cómo reproducirlo, - ¡pero arréglenlo de inmediato!!! - </para> - </blockquote> - - <para>¿Qué podemos hacer al respecto?</para> - <para> - Hay un número de razones técnicas (que pueden - resolverse) por las que Rasmus no piensa que Apache2+PHP sea una - buena idea en un entorno en producción, pero - dejándolas de lado, realmente todo converge a un simple - concepto: - </para> - <para> PHP es pegamento. Es el pegamento usado para construir interesantes aplicaciones web, uniendo docenas de bibliotecas externas y haciéndolas parecer una entidad coherente a @@ -114,15 +50,15 @@ sistema de PHP. </para> <para> - Usar la versión mpm anterior a la bifurcación - ocurrida en Apache 2 para evitar el uso de hilos es posible, y - sí, también funciona usar un mecanismo - independiente fastcgi para evitar los hilos, pero entonces se - estarían evitando características que definen al - servidor web. En este punto de desarrollo, Rasmus aun afirma que - se está mejor siguiendo con Apache 1 para servir - páginas PHP, con la nota de precaución de que - Apache 1 opera bastante mal en Windows. + Si siente que necesita usar un MPM multi-hilos, puede echarle un + vistazo a la configuración FastCGI, en donde PHP corre en + su propio espacio de memoria. + </para> + <para> + Y finalmente, note que esta advertencia contra el uso de un MPM + multi-hilos no tiene tanta fuerza en sistemas Windows, ya que la + mayoría de bibliotecas en esa platafarma tienden a ser + seguras en entornos multi-hilo. </para> </answer> </qandaentry> @@ -152,7 +88,7 @@ que desee. </para> <programlisting role="shell"> ---with-config-file-scan-dir=PATH +--with-config-file-scan-dir=PATH </programlisting> <para> En windows, la ruta predeterminada para el archivo &php.ini; es @@ -216,18 +152,18 @@ <para> Luego recuperar la URL que causa el problema con su navegador </para> - </listitem> + </listitem> <listitem> <para> > run -X -f /ruta/hacia/httpd.conf </para> - </listitem> + </listitem> <listitem> <para> Si está recibiendo un volcado de memoria, gdb debe informarle de ésto. </para> - </listitem> + </listitem> <listitem> <para> escriba: bt @@ -333,7 +269,7 @@ <itemizedlist> <listitem> <para> - Primero remueva mod_php3 : + Primero remueva mod_php3 : <programlisting role="shell"> rpm -e mod_php3 </programlisting> @@ -767,26 +703,59 @@ En Windows 98/Me necesita editar el archivo <filename>autoexec.bat</filename>: <itemizedlist> - <listitem><para> - Abre el Bloc de Notas (Inicio -> Ejecutar e ingrese - notepad) - </para></listitem> - <listitem><para> - Abra el archivo <filename>C:\autoexec.bat</filename> - </para></listitem> - <listitem><para> - Agrege una nueva línea al final del archivo: - <literal>set PHPRC C:\php</literal> (reemplace - <literal>C:\php</literal> con el directorio en donde se - encuentra &php.ini;) + <listitem><para> Abre el Bloc de Notas (Inicio -> Ejecutar e + ingrese notepad) </para></listitem> <listitem><para> Abra el + archivo <filename>C:\autoexec.bat</filename> + </para></listitem> <listitem><para> Agrege una nueva + línea al final del archivo: <literal>set + PHPRC=C:\php</literal> (reemplace <literal>C:\php</literal> + con el directorio en donde se encuentra &php.ini;). Por favor + note que la ruta no puede contener espacios. Por ejemplo si + tiene instalado PHP en <filename>C:\Archivos de + Programa\PHP</filename>, usted debería ingresar + <filename>C:\ARCHIV~1\PHP</filename> en su lugar. </para></listitem> <listitem><para> Guarde el archivo y reinicie su máquina </para></listitem> </itemizedlist> - </para> + </para> </answer> </qandaentry> + + <qandaentry id="faq.installation.apache.multiviews"> + <question> + <para> + ¿Es posible usar la negociación de contenido de + Apache (opción MultiViews) con PHP? + </para> + </question> + <answer> + <para> + Si los enlaces a archivos PHP incluyen la extensión, todo + trabaja perfectamente. Este FAQ es sólo para el caso en + el que los enlaces a archivos PHP no incluyen la + extensión y se desea usar la negociación de + contenido para elegir archivos PHP de una URL sin + extensión. En este caso reemplace la línea + <literal>AddType application/x-httpd-php .php</literal> con: + <programlisting role="apache-conf"> +<![CDATA[ +# PHP 4 +AddHandler php-script php +AddType text/html php + +# PHP 5 +AddHandler php5-script php +AddType text/html php +]]> + </programlisting> + Esta solución no funciona con Apache 1 ya que el + módulo PHP no atrapa <literal>php-script</literal>. + </para> + </answer> + </qandaentry> + </qandaset> </chapter> http://cvs.php.net/diff.php/phpdoc-es/faq/mailinglist.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/faq/mailinglist.xml diff -u phpdoc-es/faq/mailinglist.xml:1.3 phpdoc-es/faq/mailinglist.xml:1.4 --- phpdoc-es/faq/mailinglist.xml:1.3 Wed Feb 4 09:05:34 2004 +++ phpdoc-es/faq/mailinglist.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.16 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.17 Maintainer: lboshell Status: ready --> <chapter id="faq.mailinglist"> <title>Listas de correo</title> <titleabbrev>Listas de correo</titleabbrev> @@ -100,7 +100,7 @@ </para> </answer> </qandaentry> - + <qandaentry id="faq.mailinglist.question"> <question> <para>¿Qué puedo preguntar a la lista de http://cvs.php.net/diff.php/phpdoc-es/faq/misc.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/faq/misc.xml diff -u phpdoc-es/faq/misc.xml:1.3 phpdoc-es/faq/misc.xml:1.4 --- phpdoc-es/faq/misc.xml:1.3 Tue Aug 10 18:47:31 2004 +++ phpdoc-es/faq/misc.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.15 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.22 Maintainer: lboshell Status: ready --> <chapter id="faq.misc"> <title>Preguntas Varias</title> <titleabbrev>Preguntas Varias</titleabbrev> @@ -111,6 +111,90 @@ </answer> </qandaentry> + <qandaentry id="faq.misc.registerglobals"> + <question> + <para> + ¿Cómo manejo el parámetro + <literal>register_globals</literal>? + </para> + </question> + <answer> + <para> + Para información sobre las implicaciones de seguridad de + <literal>register_globals</literal>, lea el capítulo de + seguridad sobre el <link linkend="security.globals">Uso de + register_globals</link>. + </para> + <para> + Es recomendable usar <link + linkend="language.variables.superglobals">superglobales</link>, + en lugar de depender en la activación de + <literal>register_globals</literal>. + </para> + <para> + Si se encuentra en un servidor compartido con + <literal>register_globals</literal> desactivado y necesita usar + aplicaciones antiguas, que requieren que esta opción + esté activada, o se encuentra en algún servidor de + hospedaje en donde esta característica está + habilitada, pero quisiera eliminar los riesgos de seguridad, + puede que necesite emular el valor opuesto en PHP. Siempre es + buena idea preguntar primero si es posible cambiar la + opción de alguna forma en la configuración de PHP, + pero si no es posible, entonces puede usar estos segmentos de + compatibilidad. + </para> + <para> + <example> + <title>Emulación de Register Globals</title> + <para> + Esto emula el comportamiento de register_globals On. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +// Emular register_globals on +if (!ini_get('register_globals')) { + $superglobales = array($_SERVER, $_ENV, + $_FILES, $_COOKIE, $_POST, $_GET); + if (isset($_SESSION)) { + array_unshift($superglobales, $_SESSION); + } + foreach ($superglobales as $superglobal) { + extract($superglobal, EXTR_SKIP); + } + ini_set('register_globals', true); +} +?> +]]> + </programlisting> + <para> + Esto emula register_globals Off. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +// Emular register_globals off +if (ini_get('register_globals')) { + $superglobales = array($_SERVER, $_ENV, + $_FILES, $_COOKIE, $_POST, $_GET); + if (isset($_SESSION)) { + array_unshift($superglobales, $_SESSION); + } + foreach ($superglobales as $superglobal) { + foreach ($superglobal as $global => $valor) { + unset($GLOBALS[$global]); + } + } + ini_set('register_globals', false); +} +?> +]]> + </programlisting> + </example> + </para> + </answer> + </qandaentry> </qandaset> </chapter> http://cvs.php.net/diff.php/phpdoc-es/faq/using.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-es/faq/using.xml diff -u phpdoc-es/faq/using.xml:1.4 phpdoc-es/faq/using.xml:1.5 --- phpdoc-es/faq/using.xml:1.4 Tue Aug 10 18:47:31 2004 +++ phpdoc-es/faq/using.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.31 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.33 Maintainer: lboshell Status: ready --> <chapter id="faq.using"> <title>Uso de PHP</title> <titleabbrev>Uso de PHP</titleabbrev> @@ -265,6 +265,31 @@ </answer> </qandaentry> + <qandaentry id="faq.using.iis.sharing"> + <question> + <para> + Windows: No puedo acceder a archivos compartidos en otra + computadora usando IIS + </para> + </question> + <answer> + <para> + Necesita modificar el valor <literal>Go to Internet Information + Services</literal>. Ubique su archivo PHP y diríjase a + sus propiedades. Vaya a la pestaña <literal>Seguridad de + Archivo</literal>, <literal>Editar -< Acceso anónimo y + control de autenticación</literal>. + </para> + <para> + Puede solucionar el problema ya sea deshabilitando + <literal>Acceso Anónimo</literal> y dejando habilitado + <literal>Autenticación Integrada</literal>, o habilitando + <literal>Acceso Anónimo</literal> y editando el usuario + ya que éste puede no tener el acceso bien definido. + </para> + </answer> + </qandaentry> + <qandaentry id="faq.using.netscape"> <question> <para> @@ -389,9 +414,9 @@ <answer> <para> Existen algunas pocas alternativas escritas en PHP, como - <ulink url="&url.pdf.ros;">&url.pdf.ros;</ulink>, - <ulink url="&url.pdf.fpdf;">&url.pdf.fpdf;</ulink>, - <ulink url="&url.pdf.pdf4php;">&url.pdf.pdf4php;</ulink>, y + <ulink url="&url.pdf.ros;">&url.pdf.ros;</ulink>, + <ulink url="&url.pdf.fpdf;">&url.pdf.fpdf;</ulink>, + <ulink url="&url.pdf.pdf4php;">&url.pdf.pdf4php;</ulink>, y <ulink url="&url.pdf.phppdflib;">&url.pdf.phppdflib;</ulink>. También existe el módulo <ulink @@ -411,14 +436,13 @@ </question> <answer> <para> - Es importante darse cuenta de que la directiva PHP <link linkend="ini.register-globals">register_globals</link> también afecta a variables de servidor y de entorno. Cuando register_globals = off (el valor predeterminado es off a partir de PHP 4.2.0), <varname>$DOCUMENT_ROOT</varname> - no existirá. En su lugar, - use <varname>$_SERVER['DOCUMENT_ROOT']</varname>. Si + no existirá. En su lugar, use + <varname>$_SERVER['DOCUMENT_ROOT']</varname>. Si register_globals = on entonces las variables <varname>$DOCUMENT_ROOT</varname> y <varname>$GLOBALS['DOCUMENT_ROOT']</varname> existirán @@ -436,7 +460,7 @@ variables</link>. Es recomendable escribir código bajo el modelo register_globals = off. </para> - + ¬e.superglobals; </answer> @@ -455,8 +479,9 @@ </question> <answer> <para> - Las opciones disponibles son K (para Kilobytes) y M (para - Megabytes), las cuales son insensibles a mayúsculas y + Las opciones disponibles son K (para Kilobytes), M (para + Megabytes) y G (para Gigabytes; disponible desde PHP 5.1.0), las + cuales son insensibles a mayúsculas y minúsculas. Cualquier otro valor asume bytes. <literal>1M</literal> es igual a un Megabyte o <literal>1048576</literal> bytes. <literal>1K</literal> es igual http://cvs.php.net/diff.php/phpdoc-es/language/oop.xml?r1=1.6&r2=1.7&ty=u Index: phpdoc-es/language/oop.xml diff -u phpdoc-es/language/oop.xml:1.6 phpdoc-es/language/oop.xml:1.7 --- phpdoc-es/language/oop.xml:1.6 Thu Aug 19 17:13:10 2004 +++ phpdoc-es/language/oop.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> -<!-- EN-Revision: 1.53 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.7 $ --> +<!-- EN-Revision: 1.60 Maintainer: lboshell Status: ready --> <chapter id="language.oop"> <title>Clases y Objetos (PHP 4)</title> @@ -18,22 +18,25 @@ <?php class Carrito { var $items; // Items en nuestro carrito de compras - + // Agregar $num articulos de $artnr al carrito - + function agregar_item($artnr, $num) { $this->items[$artnr] += $num; } - + // Tomar $num articulos de $artnr del carrito - + function retirar_item($artnr, $num) { if ($this->items[$artnr] > $num) { $this->items[$artnr] -= $num; return true; + } elseif ($this->items[$artnr] == $num) { + unset($this->items[$artnr]); + return true; } else { return false; - } + } } } ?> @@ -41,7 +44,7 @@ </programlisting> </informalexample> </para> - + <para> Esto define una clase llamada Carrito que consiste de una matriz asociativa de artículos en el carrito y dos funciones para @@ -51,8 +54,11 @@ <warning> <simpara> <emphasis>NO</emphasis> es posible separar la definición - de una clase en varios archivos, o bloques PHP diferentes. Lo - siguiente no funciona: + de una clase en varios archivos. Asimismo <emphasis>NO</emphasis> + es posible separar la definición de una clase en bloques + PHP diferentes, a menos que la separación sea al interior + de una declaración de método. Lo siguiente no + funciona: </simpara> <para> <informalexample> @@ -71,13 +77,33 @@ </programlisting> </informalexample> </para> + <simpara> + Sin embargo, lo siguiente es permitido: + </simpara> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +class prueba { + function prueba() { + ?> + <?php + print 'Bien'; + } +} +?> +]]> + </programlisting> + </informalexample> + </para> </warning> <simpara> Las siguientes notas de precaución son válidas para PHP 4. </simpara> - + <caution> <simpara> El nombre <literal>stdClass</literal> es usado internamente por @@ -85,7 +111,7 @@ <literal>stdClass</literal> en PHP. </simpara> </caution> - + <caution> <simpara> Los nombres de función <literal>__sleep</literal> y @@ -96,7 +122,7 @@ información a continuación. </simpara> </caution> - + <caution> <simpara> PHP reserva todos los nombres de función que comienzan con @@ -214,7 +240,7 @@ // correcto, pero puede o no ser lo que se busca: // $carrito->$mivar se convierte en $carrito->items $mivar = 'items'; -$carrito->$mivar = array("10" => 1); +$carrito->$mivar = array("10" => 1); ?> ]]> </programlisting> @@ -242,13 +268,71 @@ <note> <para> + Usualmente, la pseudo-variable <varname>$this</varname> no es + definida si el método en el que se encuentra es llamado + estáticamente. Sin embargo, esta no es una regla estricta: + <varname>$this</varname> se define si un método es llamado + estáticamente desde el interior de otro objeto. En este + caso, el valor de <varname>$this</varname> es aquél del + objeto que hace la llamada. Esto se ilustra en el siguiente + ejemplo: + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +class A +{ + function foo() + { + if (isset($this)) { + echo '$this se define ('; + echo get_class($this); + echo ")\n"; + } else { + echo "\$this no se define.\n"; + } + } +} + +class B +{ + function bar() + { + A::foo(); + } +} + +$a = new A(); +$a->foo(); +A::foo(); +$b = new B(); +$b->bar(); +B::bar(); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +$this se define (a) +$this no se define. +$this se define (b) +$this no se define. +]]> + </screen> + </informalexample> + </para> + </note> + + <note> + <para> Existen algunas funciones interesantes que manejan clases y objetos. Puede que quiera echar un vistazo a las <link linkend="ref.classobj">Funciones de Clase/Objeto</link>. </para> </note> </sect1> - + <sect1 id="keyword.extends"> <title><literal>extends</literal></title> @@ -295,7 +379,7 @@ del carrito. Aun es posible usar las funciones normales de un carrito sobre los carritos con nombre: </para> - + <informalexample> <programlisting role="php"> <![CDATA[ @@ -333,7 +417,7 @@ </sect1> <sect1 id="language.oop.constructor"> - <title><literal>Constructores</literal></title> + <title>Constructores</title> <caution> <simpara> @@ -352,7 +436,7 @@ el mismo nombre que la clase en donde es definida - la diferencia es sutil, pero crucial (vea más adelante). </para> - + <informalexample> <programlisting role="php"> <![CDATA[ @@ -495,7 +579,7 @@ le importa si la función está siendo definida en la clase B, o si ha sido heredada. </para> - + <para> Esto se corrige en PHP 4 modificando la regla a: 'Un constructor es una función del mismo nombre de la clase en la que se @@ -504,7 +588,7 @@ base hubiera sido llamado, imprimiendo 'Soy el constructor de A.<br />'. </para> - + <caution> <simpara> Ni PHP 3 o PHP 4 llaman constructores de la clase base @@ -514,7 +598,7 @@ apropiado. </simpara> </caution> - + <note> <simpara> No hay destructores en PHP 3 o PHP 4. Puede usar @@ -522,7 +606,7 @@ emular la mayoría de efectos de los destructores. </simpara> </note> - + <para> Los destructores son funciones que son llamadas automáticamente cuando un objeto es destruido, ya sea con @@ -532,7 +616,9 @@ </sect1> <sect1 id="keyword.paamayim-nekudotayim"><!-- :-) --> - <title><literal>::</literal></title> + <title>Operador de Resolución de Contexto + (<literal>::</literal>)</title> + <caution> <simpara> @@ -943,8 +1029,8 @@ ?> ]]> </programlisting> - </informalexample> - </para> + </informalexample> + </para> <para> Otro ejemplo final, intente entenderlo. <informalexample> @@ -996,9 +1082,7 @@ ?> ]]> </programlisting> - <para> - Este ejemplo producirá la salida: - </para> + &example.outputs; <screen> <![CDATA[ clase A: 10 @@ -1080,9 +1164,9 @@ ?> ]]> </programlisting> - </example> - Veremos: + &example.outputs; <screen> +<![CDATA[ Comparar instancias creadas con los mismos parámetros o1 == o2 : TRUE o1 != o2 : FALSE @@ -1100,7 +1184,9 @@ o1 != o2 : TRUE o1 === o2 : FALSE o1 !== o2 : TRUE - </screen> +]]> + </screen> + </example> Que es la salida que podemos esperar dadas las reglas de comparación descritas anteriormente. Solo las instancias con los mismos valores para sus atributos y de la misma clase son @@ -1149,9 +1235,9 @@ ?> ]]> </programlisting> - </example> - Cosa que entrega la salida esperada: + &example.outputs; <screen> +<![CDATA[ Objetos compuestos u(o,p) y v(q,p) o1 == o2 : TRUE o1 != o2 : FALSE @@ -1163,11 +1249,13 @@ o1 != o2 : TRUE o1 === o2 : FALSE o1 !== o2 : TRUE - </screen> +]]> + </screen> + </example> </para> </sect1> </chapter> - + <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/diff.php/phpdoc-es/language/operators.xml?r1=1.15&r2=1.16&ty=u Index: phpdoc-es/language/operators.xml diff -u phpdoc-es/language/operators.xml:1.15 phpdoc-es/language/operators.xml:1.16 --- phpdoc-es/language/operators.xml:1.15 Mon Aug 23 00:48:06 2004 +++ phpdoc-es/language/operators.xml Tue Mar 1 17:39:48 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> -<!-- EN-Revision: 1.80 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.16 $ --> +<!-- EN-Revision: 1.84 Maintainer: lboshell Status: ready --> <chapter id="language.operators"> <title>Operadores</title> <simpara> @@ -30,7 +30,7 @@ ejecución. Rodear las expresiones ternarias con paréntesis es una muy buena idea. </para> - + <sect1 id="language.operators.precedence"> <title>Precedencia de Operadores</title> <para> @@ -59,90 +59,163 @@ <row> <entry>Asociatividad</entry> <entry>Operadores</entry> + <entry>Información Adicional</entry> </row> </thead> <tbody> <row> <entry>no-asociativo</entry> <entry>new</entry> + <entry><link + linkend="language.oop5.basic.new">new</link></entry> </row> <row> <entry>derecha</entry> <entry>[</entry> + <entry><function>array</function></entry> </row> <row> <entry>no-asociativos</entry> <entry>++ --</entry> + <entry> + <link + linkend="language.operators.increment">incremento/decremento</link> + </entry> </row> <row> <entry>no-asociativos</entry> <entry>! ~ - (int) (float) (string) (array) (object) @</entry> + <entry> + <link linkend="language.types">tipos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>* / %</entry> + <entry> + <link + linkend="language.operators.arithmetic">aritmética</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>+ - .</entry> + <entry> + <link + linkend="language.operators.arithmetic">aritmética</link>&listendand; + <link linkend="language.operators.string">cadena</link> + </entry> </row> <row> <entry>izquierda</entry> <entry><< >></entry> + <entry> + <link linkend="language.operators.bitwise">manejo de bits</link> + </entry> </row> <row> <entry>no-asociativos</entry> <entry>< <= > >=</entry> + <entry> + <link + linkend="language.operators.comparison">comparación</link> + </entry> </row> <row> <entry>no-asociativos</entry> <entry>== != === !==</entry> + <entry> + <link + linkend="language.operators.comparison">comparación</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>&</entry> + <entry> + <link linkend="language.operators.bitwise">manejo de + bits</link>&listendand; <link + linkend="language.references">referencias</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>^</entry> + <entry> + <link linkend="language.operators.bitwise">manejo de + bits</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>|</entry> + <entry> + <link linkend="language.operators.bitwise">manejo de + bits</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>&&</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>||</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>? :</entry> + <entry> + <link + linkend="language.operators.comparison.ternary">ternario</link> + </entry> </row> <row> <entry>derecha</entry> <entry> = += -= *= /= .= %= &= |= ^= <<= >>= </entry> + <entry> + <link + linkend="language.operators.assignment">asignación</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>and</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>xor</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>or</entry> + <entry> + <link + linkend="language.operators.logical">lógicos</link> + </entry> </row> <row> <entry>izquierda</entry> <entry>,</entry> + <entry>varios usos</entry> </row> </tbody> </tgroup> @@ -517,10 +590,22 @@ </programlisting> </informalexample> </para> + <para> - Otro operador condicional es el operador "?:" (o ternario). - <informalexample> - <programlisting role="php"> + Vea también <function>strcasecmp</function>, + <function>strcmp</function>, + <link linkend="language.operators.array">Operadores de + matriz</link>, y la sección del manual sobre + <link linkend="language.types">Tipos</link>. + </para> + + <sect2 id="language.operators.comparison.ternary"> + <title>Operador Ternario</title> + <para> + Otro operador condicional es el operador "?:" (o ternario). + <example> + <title>Asignación de un valor predeterminado</title> + <programlisting role="php"> <![CDATA[ <?php // Ejemplo de uso de: el Operador Ternario @@ -532,23 +617,20 @@ } else { $accion = $_POST['accion']; } + ?> ]]> - </programlisting> - </informalexample> - La expresión <literal>(expr1) ? (expr2) : (expr3)</literal> - evalúa a <replaceable>expr2</replaceable> si - <replaceable>expr1</replaceable> evalúa a &true;, y - <replaceable>expr3</replaceable> si - <replaceable>expr1</replaceable> evalúa a &false;. - </para> - <para> - Vea también <function>strcasecmp</function>, - <function>strcmp</function>, - <link linkend="language.operators.array">Operadores de - matriz</link>, y la sección del manual sobre - <link linkend="language.types">Tipos</link>. - </para> + </programlisting> + </example> + La expresión <literal>(expr1) ? (expr2) : + (expr3)</literal> evalúa a + <replaceable>expr2</replaceable> si + <replaceable>expr1</replaceable> evalúa a &true;, y + <replaceable>expr3</replaceable> si + <replaceable>expr1</replaceable> evalúa a &false;. + </para> + </sect2> + </sect1> <sect1 id="language.operators.errorcontrol"> @@ -753,21 +835,19 @@ $i = 'W'; for($n=0; $n<6; $n++) echo ++$i . "\n"; - -/* - Produce una salida similar a la siguiente: - +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ X Y Z AA AB AC - -*/ -?> ]]> - </programlisting> + </screen> </example> </para> <para> @@ -865,7 +945,7 @@ <link linkend="ref.strings">funciones de Cadenas</link>. </para> </sect1> - + <sect1 id="language.operators.array"> <title>Operadores de Matrices</title> <table> @@ -887,13 +967,14 @@ <row> <entry>$a == $b</entry> <entry>Igualdad</entry> - <entry>&true; si $a y $b tienen los mismos elementos.</entry> + <entry>&true; si $a y $b tienen las mismas parejas + llave/valor.</entry> </row> <row> <entry>$a === $b</entry> <entry>Identidad</entry> - <entry>&true; si $a y $b tienen los mismos elementos en el - mismo orden.</entry> + <entry>&true; si $a y $b tienen las mismas parejas llave/valor + en el mismo orden y de los mismos tipos.</entry> </row> <row> <entry>$a != $b</entry> http://cvs.php.net/diff.php/phpdoc-es/language/types.xml?r1=1.10&r2=1.11&ty=u Index: phpdoc-es/language/types.xml diff -u phpdoc-es/language/types.xml:1.10 phpdoc-es/language/types.xml:1.11 --- phpdoc-es/language/types.xml:1.10 Thu Aug 19 17:13:10 2004 +++ phpdoc-es/language/types.xml Tue Mar 1 17:39:48 2005 @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.10 $ --> -<!-- EN-Revision: 1.140 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.11 $ --> +<!-- EN-Revision: 1.150 Maintainer: lboshell Status: ready --> <chapter id="language.types"> <title>Tipos</title> <sect1 id="language.types.intro"> <title>Introducción</title> - + <simpara> PHP soporta ocho tipos primitivos. </simpara> - + <para> Cuatro tipos escalares: <itemizedlist> @@ -80,19 +80,19 @@ <listitem> <simpara> - <link linkend="language.types.mixed">mixed</link> + <type>mixed</type> </simpara> </listitem> <listitem> <simpara> - <link linkend="language.types.number">number</link> + <type>number</type> </simpara> </listitem> <listitem> <simpara> - <link linkend="language.types.mixed">callback</link> + <type>callback</type> </simpara> </listitem> @@ -101,7 +101,7 @@ "double". Considere al tipo double como el mismo que float, los dos nombres existen solo por razones históricas. </para> - + <simpara> El tipo de una variable usualmente no es declarado por el programador; en cambio, es decidido en tiempo de @@ -247,7 +247,7 @@ linkend="language.types.type-juggling">Manipulación de Tipos</link>. </simpara> - + <para> Cuando se realizan conversiones a <type>boolean</type>, los siguientes valores son considerados &false;: @@ -278,7 +278,7 @@ </listitem> <listitem> <simpara>un <link linkend="language.types.object">object</link> - con cero variables miembro</simpara> + con cero variables miembro (sólo en PHP 4)</simpara> </listitem> <listitem> <simpara>el tipo especial <link @@ -558,7 +558,7 @@ </sect3> </sect2> </sect1> - + <sect1 id="language.types.float"> <title>Números de punto flotante</title> <para> @@ -569,8 +569,8 @@ <programlisting role="php"> <![CDATA[ <?php -$a = 1.234; -$b = 1.2e3; +$a = 1.234; +$b = 1.2e3; $c = 7E-10; ?> ]]> @@ -579,9 +579,11 @@ Formalmente: <informalexample> <programlisting role="php"> +<![CDATA[ LNUM [0-9]+ DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) EXPONENT_DNUM ( ({LNUM} | {DNUM}) [eE][+-]? {LNUM}) +]]> </programlisting> </informalexample> El tamaño de un flotante depende de la plataforma, aunque @@ -589,7 +591,7 @@ una precisión de aproximadamente 14 dígitos decimales (lo que es un valor de 64 bits en formato IEEE). </para> - + <warning id="warn.float-precision"> <title>Precisión del punto flotante</title> <para> @@ -625,7 +627,7 @@ <sect2 id="language.types.float.casting"> <title>Conversión a flotante</title> - + <para> Para más información sobre cuándo y cómo son convertidas las cadenas a flotantes, vea la @@ -635,7 +637,9 @@ conversión es la misma que si el valor hubiese sido convertido a entero y luego a flotante. Vea la sección <link linkend="language.types.integer.casting">Conversión - a entero</link> para más información. + a entero</link> para más información. A partir de + PHP 5, una noticia es generada si intenta convertir un objeto a + flotante. </para> </sect2> </sect1> @@ -1182,10 +1186,10 @@ caracter</link>. </simpara> </sect2> - + <sect2 id="language.types.string.casting"> <title>Conversión a cadena</title> - + <para> Es posible convertir un valor a una cadena usando el moldeamiento <literal>(string)</literal>, o la función @@ -1230,7 +1234,8 @@ variables miembro de un <type>object</type> para efectos de depuración, lea los parágrafos siguientes. Si quiere conocer el nombre de clase del cual un objeto dado es - instancia, use <function>get_class</function>. + instancia, use <function>get_class</function>. A partir de PHP 5, + el método __toString() es usado si resulta aplicable. </para> <para> Los recursos son siempre convertidos a cadenas con la estructura @@ -1465,7 +1470,7 @@ type</literal>. </para> </sect3> - + <sect3 id="language.types.array.syntax.modifying"> <title>Creación/modificación con sintaxis de corchetes cuadrados</title> @@ -1568,11 +1573,10 @@ $matriz[] = 7; print_r($matriz); ?> -]]> +]]> </programlisting> - <para> - El anterior ejemplo produciría la siguiente salida: - <screen> + &example.outputs; + <screen> <![CDATA[ Array ( @@ -1595,14 +1599,13 @@ [1] => 7 ) ]]> - </screen> - </para> - </informalexample> + </screen> + </informalexample> </note> </sect3> </sect2><!-- end syntax --> - + <sect2 id="language.types.array.useful-funcs"> <title>Funciones útiles</title> <para> @@ -1636,9 +1639,9 @@ ]]> </programlisting> </informalexample> - - </para> - </note> + + </para> + </note> <para> La estructura de control <link linkend="control-structures.foreach">foreach</link> existe @@ -1646,7 +1649,7 @@ manera fácil de recorrer una matriz. </para> </sect2> - + <sect2 id="language.types.array.donts"> <title>Recomendaciones sobre matrices y cosas a evitar</title> @@ -1715,9 +1718,8 @@ ]]> </programlisting> </informalexample> - <para> - La salida del anterior fragmento es: - <screen> + &example.outputs; + <screen> <![CDATA[ Revisando 0: Notice: Undefined index: $i in /path/to/script.html on line 9 @@ -1734,9 +1736,8 @@ Notice: Undefined index: $i in /path/to/script.html on line 11 Mal: Bien: 2 -]]> - </screen> - </para> +]]> + </screen> </note> <para> Más ejemplos para demostrar este hecho: @@ -1902,7 +1903,7 @@ de la matriz. Las claves son los nombres de las variables miembro. </para> - + <para> Si convierte un valor &null; a matriz, obtiene una matriz vacía. @@ -1955,7 +1956,7 @@ </programlisting> </informalexample> </para> - + <example> <title>Uso de array()</title> <programlisting role="php"> @@ -1967,7 +1968,7 @@ 'idioma => 'ingles', 'etiquetas_cortas' => true ); - + // claves estrictamente numericas $matriz = array( 7, 8, @@ -1986,9 +1987,9 @@ '02' => 77, // clave = '02' 0 => 12 // el valor 10 sera reemplazado por 12 ); - + // matriz vacia -$vacio = array(); +$vacio = array(); ?> ]]> <!-- TODO example of @@ -2013,9 +2014,7 @@ ?> ]]> </programlisting> - <para> - Esto producirá la salida: - </para> + &example.outputs; <screen> <![CDATA[ ¿Le gusta el rojo? @@ -2025,14 +2024,14 @@ ]]> </screen> </example> - + <para> Note que actualmente no es posible cambiar los valores de la matriz directamente en un ciclo de ese tipo. <!-- Should be made possible, if you write: foreach ( $colors as &$color ) - + See bug#3074 --> Una solución parcial es la siguiente: @@ -2052,9 +2051,7 @@ ?> ]]> </programlisting> - <para> - Esto genera la salida: - </para> + &example.outputs; <screen> <![CDATA[ Array @@ -2080,18 +2077,16 @@ ?> ]]> </programlisting> - <para> - Esto imprime: - </para> + &example.outputs; <screen> <![CDATA[ -Array +Array ( [1] => 'Enero' [2] => 'Febrero' [3] => 'Marzo' ) -]]> +]]> </screen> </example> </para> @@ -2179,7 +2174,7 @@ $matriz2 = $matriz1; $matriz2[] = 4; // $matriz2 cambia, // $matriz1 sigue siendo array(2, 3) - + $matriz3 = &$matriz1; $matriz3[] = 4; // ahora $matriz1 y $matriz3 son iguales ?> @@ -2225,10 +2220,10 @@ Objetos</link>. </simpara> </sect2> - + <sect2 id="language.types.object.casting"> <title>Conversión a objeto</title> - + <para> Si un objeto es convertido a un objeto, éste no es modificado. Si un valor de cualquier otro tipo es convertido a @@ -2249,12 +2244,12 @@ </informalexample> </para> </sect2> - + </sect1> <sect1 id="language.types.resource"> <title>Recurso</title> - + <para> Un recurso es una variable especial, que contiene una referencia a un recurso externo. Los recursos son creados y usados por @@ -2262,16 +2257,20 @@ linkend="resource">apéndice</link> para un listado de todas estas funciones y los tipos de recurso correspondientes. </para> - + <note> <simpara> El tipo recurso fue introducido en PHP 4 </simpara> </note> + <para> + Vea también <function>get_resource_type</function>. + </para> + <sect2 id="language.types.resource.casting"> <title>Conversión a un recurso</title> - + <para> Dado que los tipos de recurso contienen gestores especiales a archivos abiertos, conexiones con bases de datos, áreas de @@ -2282,7 +2281,7 @@ <sect2 id="language.types.resource.self-destruct"> <title>Liberación de recursos</title> - + <para> Gracias al sistema de conteo de referencias introducido con el Motor Zend de PHP 4, se detecta automáticamente cuando un @@ -2301,13 +2300,13 @@ </simpara> </note> </para> - + </sect2> </sect1> - + <sect1 id="language.types.null"> <title>NULL</title> - + <para> El valor especial &null; representa que una variable no tiene valor. &null; es el único valor posible del tipo @@ -2315,7 +2314,7 @@ </para> <note> <simpara> - El tipo null se introdujo en PHP 4 + El tipo null se introdujo en PHP 4. </simpara> </note> <para> @@ -2338,7 +2337,7 @@ </listitem> </itemizedlist> </para> - + <sect2 id="language.types.null.syntax"> <title>Sintaxis</title> <para> @@ -2348,7 +2347,7 @@ <programlisting role="php"> <![CDATA[ <?php -$var = NULL; +$var = NULL; ?> ]]> </programlisting> @@ -2360,7 +2359,7 @@ </para> </sect2> </sect1> - + <sect1 id="language.pseudo-types"> <title>Pseudo-tipos usados en esta documentación</title> @@ -2376,7 +2375,7 @@ aceptará cadenas y matrices. </para> </sect2> - + <sect2 id="language.types.number"> <title>number</title> <para> @@ -2425,33 +2424,35 @@ </title> <programlisting role="php"> <![CDATA[ -<?php +<?php -// ejemplo simple de una llamada de retorno +// Una llamada de retorno de ejemplo function mi_llamada_de_retorno() { echo '¡Hola mundo!'; } -call_user_func('mi_llamada_de_retorno'); -// ejemplos de un método como llamada de retorno +// Un método como llamada de retorno de ejemplo class MiClase { function miMetodoDeRetorno() { echo '¡Hola Mundo!'; } } -// llamada de metodo estatico de clase sin instanciar un objeto +// Tipo 1: Llamada de retorno simple +call_user_func('mi_llamada_de_retorno'); + +// Tipo 2: Llamada de metodo estatico de clase call_user_func(array('MiClase', 'miMetodoDeRetorno')); -// llamada a un metodo de objeto +// Tipo 3: Llamada a un metodo de objeto $obj = new MiClase(); call_user_func(array(&$obj, 'miMetodoDeRetorno')); ?> ]]> </programlisting> </example> - </para> - + </para> + </sect2> </sect1> @@ -2657,7 +2658,7 @@ </informalexample> </para> </note> - + <para> Puede que no sea obvio qué sucede exactamente cuando se moldea entre ciertos tipos. Para más información, http://cvs.php.net/co.php/phpdoc-es/faq/migration5.xml?r=1.1&p=1 Index: phpdoc-es/faq/migration5.xml +++ phpdoc-es/faq/migration5.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> <chapter id="faq.migration5"> <title>Migración desde PHP 4 a PHP 5</title> <titleabbrev>Migración desde PHP 4 a PHP 5</titleabbrev> <para> Esta sección del faq le ayudará con la migración de PHP 4 a PHP 5. </para> <qandaset> <qandaentry id="faq.migration5.php45"> <question> <para> Migración desde PHP 4 a PHP 5 </para> </question> <answer> <para> Aunque PHP 5 ofrece varias características nuevas, está diseñado para ser tan compatible con versiones anteriores de PHP como es posible, y con muy poca funcionalidad afectada en el proceso. </para> <para> Asegúrese de leer el <link linkend="migration5">apéndice de migración de PHP 5</link> apropiado de este manual, ya que contiene más información sobre el tema de la migración a PHP 5. </para> </answer> </qandaentry> <qandaentry id="faq.migration5.mysql"> <question> <para> ¿Funciona MySQL en PHP 5? Parece haber desaparecido. </para> </question> <answer> <para> <link linkend="ref.mysql">MySQL</link> es soportado, el único cambio es que el soporte MySQL no se habilita <emphasis>por defecto</emphasis> en PHP 5. Esto básicamente quiere decir que PHP no incluye la opción <option role="configure">--with-mysql</option> en la línea <link linkend="configuration">configure</link>, así que tendrá que usarla manualmente cuando compile PHP. Los usuarios de windows deben editar &php.ini; y habilitar el recurso DLL <filename>php_mysql.dll</filename>, ya que en PHP 4 tal DLL no existía, simplemente estaba incorporado en los binarios de Windows de PHP. </para> <para> Asimismo, las bibliotecas de cliente MySQL no son incorporadas con PHP. Este tema se cubre con más detalle en <link linkend="faq.databases.mysql.php5">el siguiente FAQ</link>, y asegúrese de leer la <link linkend="ref.mysql">sección de MySQL</link> para más detalles sobre la instalación de MySQL. Una línea configure de ejemplo sería <option role="configure">--with-mysql=/usr</option> mientras que los usuarios de Windows necesitará el archivo <filename>libmySQL.dll</filename> disponible en el sistema. </para> </answer> </qandaentry> <qandaentry id="faq.migration5.oop"> <question> <para> He escuchado que PHP 5 tiene un modelo de Programación Orientada a Objetos completamente nuevo, ¿funcionará my código OO? ¿Dónde puedo encontrar información sobre estas nuevas características de programación OO? </para> </question> <answer> <para> El principal cambio en PHP 5 afecta el modelo OO ya que PHP 5 ahora usa el <emphasis>Motor Zend 2.0</emphasis>. La directiva <link linkend="ini.zend.ze1-compatibility-mode">zend.ze1_compatibility_mode</link> habilita la compatibilidad con el Motor Zend 1.0 (PHP 4). </para> <para> El nuevo modelo de programación orientada a objetos se documenta en las secciones de <link linkend="language.oop5">referencia OO del lenguaje</link> y el <link linkend="migration5.oop">apéndice de migración OO</link>. </para> </answer> </qandaentry> <qandaentry id="faq.migration5.changes"> <question> <para> Y bien, aparte del nuevo modelo OO, ¿qué más ha cambiado en PHP 5? También, ¿existe una versión específica a PHP 5 del manual de PHP? </para> </question> <answer> <para> Pocos cambios adicionales existen, vea el <link linkend="migration5">apéndice de migración a PHP 5</link> para más detalles. No habrá una versión específica a PHP 5 del manual, ya que la mayoría del lenguaje PHP permanece igual. </para> </answer> </qandaentry> </qandaset> </chapter> <!-- 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 -->