cvs: phpdoc-es / language-snippets.ent translation.xml /appendices filters.xml reserved.constants.standard.xml reserved.xml
/reference/array/functions array-diff-ukey.xml /reference/domxml/functions DomAttribute-name.xml DomAttribute-value.xml DomDocument-add-root.xml
DomDocument-html-dump-mem.xml DomDocument-xinclude.xml DomDocumentType-name.xml DomDocumentType-system-id.xml DomElement-get-attribute-node.xml
DomElement-get-attribute.xml DomElement-has-attribute.xml DomElement-set-attribute.xml DomElement-tagname.xml domxml-version.xml
/reference/filesystem/functions file-get-contents.xml fwrite.xml pathinfo.xml tempnam.xml /reference/mcrypt reference.xml /reference/misc/functions
highlight-file.xml /reference/stream/functions stream-get-meta-data.xml
| From: | Leonardo Boshell | Date: | Wed, 01 Sep 2004 22:13:18 +0000 |
| Subject: | cvs: phpdoc-es / language-snippets.ent translation.xml /appendices filters.xml reserved.constants.standard.xml reserved.xml /reference/array/functions array-diff-ukey.xml /reference/domxml/functions DomAttribute-name.xml DomAttribute-value.xml DomDocument-add-root.xml DomDocument-html-dump-mem.xml DomDocument-xinclude.xml DomDocumentType-name.xml DomDocumentType-system-id.xml DomElement-get-attribute-node.xml DomElement-get-attribute.xml DomElement-has-attribute.xml DomElement-set-attribute.xml DomElement-tagname.xml domxml-version.xml /reference/filesystem/functions file-get-contents.xml fwrite.xml pathinfo.xml tempnam.xml /reference/mcrypt reference.xml /reference/misc/functions highlight-file.xml /reference/stream/functions stream-get-meta-data.xml |
||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-691@lists.php.net to get a copy of this message | ||
lboshell Wed Sep 1 18:13:18 2004 EDT
Added files:
/phpdoc-es/appendices filters.xml
Modified files:
/phpdoc-es language-snippets.ent translation.xml
/phpdoc-es/appendices reserved.constants.standard.xml reserved.xml
/phpdoc-es/reference/array/functions array-diff-ukey.xml
/phpdoc-es/reference/domxml/functions DomAttribute-name.xml
DomAttribute-value.xml
DomDocument-add-root.xml
DomDocument-html-dump-mem.xml
DomDocument-xinclude.xml
DomDocumentType-name.xml
DomDocumentType-system-id.xml
DomElement-get-attribute-node.xml
DomElement-get-attribute.xml
DomElement-has-attribute.xml
DomElement-set-attribute.xml
DomElement-tagname.xml
domxml-version.xml
/phpdoc-es/reference/filesystem/functions file-get-contents.xml
fwrite.xml pathinfo.xml
tempnam.xml
/phpdoc-es/reference/mcrypt reference.xml
/phpdoc-es/reference/misc/functions highlight-file.xml
/phpdoc-es/reference/stream/functions stream-get-meta-data.xml
Log:
- Actualizaciones
- Nuevo apendice sobre filtros
- Pequenya correccion a language-snippets.ent :)
http://cvs.php.net/diff.php/phpdoc-es/language-snippets.ent?r1=1.31&r2=1.32&ty=u Index: phpdoc-es/language-snippets.ent diff -u phpdoc-es/language-snippets.ent:1.31 phpdoc-es/language-snippets.ent:1.32 --- phpdoc-es/language-snippets.ent:1.31 Tue Aug 31 05:02:59 2004 +++ phpdoc-es/language-snippets.ent Wed Sep 1 18:13:17 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.31 $ --> +<!-- $Revision: 1.32 $ --> <!-- EN-Revision: 1.121 Maintainer: rafael Status: ready --> <!-- Keep 'em sorted --> @@ -199,7 +199,7 @@ linkend="ini.register-long-arrays">register_long_arrays</link>.'> <!ENTITY ini.shorthandbytes '<simpara>Cuando se usa un <type>número -entero</type>, el valor del mismo es medido en 'bytes'. También se +entero</type>, el valor del mismo es medido en bytes. También se puede usar la notación reducida tal como se describe en <link linkend="faq.using.shorthandbytes">esta FAQ</link>.</simpara>'> http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.169&r2=1.170&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.169 phpdoc-es/translation.xml:1.170 --- phpdoc-es/translation.xml:1.169 Tue Aug 31 04:27:41 2004 +++ phpdoc-es/translation.xml Wed Sep 1 18:13:17 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.169 $ --> +<!-- $Revision: 1.170 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -137,8 +137,6 @@ <file name="reference/array/functions/array-count-values.xml" person="baoengb" type="review" date="16.08.2004" /> - <file name="appendices/filters.xml" person="lboshell" - type="translation" date="24.08.2004" /> <file name="appendices/migration5.xml" person="lboshell" type="translation" date="24.08.2004" /> <file name="faq/migration5.xml" person="lboshell" http://cvs.php.net/diff.php/phpdoc-es/appendices/reserved.constants.standard.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/appendices/reserved.constants.standard.xml diff -u phpdoc-es/appendices/reserved.constants.standard.xml:1.1 phpdoc-es/appendices/reserved.constants.standard.xml:1.2 --- phpdoc-es/appendices/reserved.constants.standard.xml:1.1 Sat Nov 1 14:12:19 2003 +++ phpdoc-es/appendices/reserved.constants.standard.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.8 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.9 Maintainer: lboshell Status: ready --> <!-- DOCNOTE: some constants listed here are also there at reference/info/constants.xml. Further decision is needed @@ -911,6 +911,17 @@ </varlistentry> <varlistentry> <term> + <constant>PATH_SEPARATOR</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> <constant>CHAR_MAX</constant> (<type>integer</type>) </term> @@ -2211,7 +2222,7 @@ sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil -sgml-default-dtd-file:"manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil http://cvs.php.net/diff.php/phpdoc-es/appendices/reserved.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc-es/appendices/reserved.xml diff -u phpdoc-es/appendices/reserved.xml:1.9 phpdoc-es/appendices/reserved.xml:1.10 --- phpdoc-es/appendices/reserved.xml:1.9 Thu Aug 19 17:13:10 2004 +++ phpdoc-es/appendices/reserved.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.44 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.45 Maintainer: lboshell Status: ready --> <appendix id="reserved"> <title>Lista de Palabras Reservadas</title> @@ -629,6 +629,26 @@ realizado cualquier asignación al vuelo virtual-a-real. </simpara> + <note> + <simpara> + A partir de PHP 4.3.2, <envar>PATH_TRANSLATED</envar> ya no + se define implícitamente bajo la + <acronym>SAPI</acronym> de Apache 2, a diferencia de lo que + ocurre en Apache 1, en donde se define con el mismo valor de + la variable de servidor <envar>SCRIPT_FILENAME</envar> + cuando Apache no se encarga de definirlo. Este cambio fue + realizado para cumplir con la especificación + <acronym>CGI</acronym> de que <envar>PATH_TRANSLATED</envar> + debe existir únicamente si <envar>PATH_INFO</envar> + se define. + </simpara> + <simpara> + Los usuarios de Apache 2 pueden usar <literal>AcceptPathInfo + = On</literal> al interior de + <filename>httpd.conf</filename> para definir + <envar>PATH_INFO</envar>. + </simpara> + </note> </listitem> </varlistentry> http://cvs.php.net/diff.php/phpdoc-es/reference/array/functions/array-diff-ukey.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/array/functions/array-diff-ukey.xml diff -u phpdoc-es/reference/array/functions/array-diff-ukey.xml:1.1 phpdoc-es/reference/array/functions/array-diff-ukey.xml:1.2 --- phpdoc-es/reference/array/functions/array-diff-ukey.xml:1.1 Mon Aug 23 12:52:57 2004 +++ phpdoc-es/reference/array/functions/array-diff-ukey.xml Wed Sep 1 18:13:17 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- EN-Revision: 1.1 Maintainer: baoengb Status:ready --> <refentry id="function.array-diff-ukey"> <refnamediv> @@ -54,7 +54,7 @@ ]]> </programlisting> <para> - El ejemplo anterior producir&aacte; la siguiente salida: + El ejemplo anterior producirá la siguiente salida: </para> <screen> <![CDATA[ http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomAttribute-name.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/domxml/functions/DomAttribute-name.xml diff -u phpdoc-es/reference/domxml/functions/DomAttribute-name.xml:1.2 phpdoc-es/reference/domxml/functions/DomAttribute-name.xml:1.3 --- phpdoc-es/reference/domxml/functions/DomAttribute-name.xml:1.2 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/domxml/functions/DomAttribute-name.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domattribute-name'> <refnamediv> @@ -19,7 +19,8 @@ Esta función devuelve el nombre del atributo. </para> <para> - Vea también <function>domattribute_value</function>. + Vea también <function>domattribute_value</function> para + encontrar un ejemplo. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomAttribute-value.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/domxml/functions/DomAttribute-value.xml diff -u phpdoc-es/reference/domxml/functions/DomAttribute-value.xml:1.2 phpdoc-es/reference/domxml/functions/DomAttribute-value.xml:1.3 --- phpdoc-es/reference/domxml/functions/DomAttribute-value.xml:1.2 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/domxml/functions/DomAttribute-value.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domattribute-value'> <refnamediv> @@ -17,6 +17,41 @@ </methodsynopsis> <para> Esta función devuelve el valor del atributo. + </para> + <para> + <example> + <title>Obtener todos los atributos de un nodo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); +$atrs = $raiz->attributes(); + +echo 'Atributos de ' . $raiz->node_name() . "\n"; +foreach ($atrs as $atributo) { + echo ' - ' . $atributo->name . ' : ' . $attribute->value . "\n"; +} + +?> + +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Atributos de chapter + - language : en +]]> + </screen> + </example> </para> <para> Vea también <function>domattribute_name</function>. http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml diff -u phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml:1.1 Thu Jun 3 03:21:41 2004 +++ phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id="function.domdocument-add-root"> <refnamediv> @@ -12,7 +12,7 @@ <refsect1> <title>Descripción</title> <methodsynopsis> - <type>resource</type><methodname>DomDocument->add_root</methodname> + <type>object</type><methodname>DomDocument->add_root</methodname> <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> &warn.experimental.func; @@ -29,9 +29,9 @@ <![CDATA[ <?php $doc = domxml_new_doc("1.0"); -$raiz = $doc->add_root("HTML"); -$cabecera = $raiz->new_child("HEAD", ""); -$cabecera->new_child("TITLE", "Hier der Titel"); +$raiz = $doc->add_root("html"); +$cabecera = $raiz->new_child("head", ""); +$cabecera->new_child("title", "Hier der Titel"); echo htmlentities($doc->dump_mem()); ?> ]]> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml diff -u phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.1 Fri Jun 11 04:56:03 2004 +++ phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id="function.domdocument-html-dump-mem"> <refnamediv> @@ -29,21 +29,29 @@ <programlisting role="php"> <![CDATA[ <?php + +// Crea el documento $doc = domxml_new_doc("1.0"); -$raiz = $doc->create_element("HTML"); +$raiz = $doc->create_element("html"); $raiz = $doc->append_child($raiz); -$cabecera = $doc->create_element("HEAD"); +$cabecera = $doc->create_element("head"); $cabecera = $raiz->append_child($cabecera); -$titulo = $doc->create_element("TITLE"); +$titulo = $doc->create_element("title"); $titulo = $cabecera->append_child($titulo); + $texto = $doc->create_text_node("This is the title"); $texto = $titulo->append_child($texto); -echo "<PRE>"; -echo htmlentities($doc->html_dump_mem()); -echo "</PRE>"; + +echo $doc->html_dump_mem(); ?> ]]> </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<html><head><title>This is the title</title></head></html> +]]> + </screen> </example> </para> <para> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml diff -u phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml:1.2 phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml:1.3 --- phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml:1.2 Mon Aug 23 00:48:06 2004 +++ phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <refentry id="function.domdocument-xinclude"> <refnamediv> <refname>DomDocument->xinclude</refname> @@ -15,8 +15,60 @@ <void/> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; + <para> + Esta función reemplaza elementos XInclude en un objeto + DomDocument. + </para> + <para> + <example> + <title>Sustitución</title> + <programlisting role="php"> +<![CDATA[ +<?php +// include.xml contiene : +// <child>prueba</child> + +$xml = '<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="include.xml"> + <xi:fallback> + <error>xinclude: no se encontró include.xml</error> + </xi:fallback> + </xi:include> +</root>'; + +$domxml = domxml_open_mem($xml); +$domxml->xinclude(); + +echo $domxml->dump_mem(); + +?> +]]> + </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <child>prueba</child> +</root> +]]> + </screen> + <para> + Si <filename>include.xml</filename> no existe, usted + verá: + </para> + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <error>xinclude: no se encontró include.xml</error> +</root> +]]> + </screen> + </example> + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml diff -u phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domdocumenttype-name'> <refnamediv> @@ -17,6 +17,28 @@ </methodsynopsis> <para> Esta función devuelve el nombre del tipo de documento. + </para> + <para> + <example> + <title>Obtener el nombre del tipo de documento</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$tipo_doc = $dom->doctype(); +echo $tipo_doc->name(); // chapter + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml diff -u phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domdocumenttype-system-id'> <refnamediv> @@ -19,8 +19,6 @@ Devuelve el id de sistema del tipo de documento. </para> <para> - El siguiente ejemplo imprime - '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'. <example> <title>Recuperación del id de sistema</title> <programlisting role="php"> @@ -38,6 +36,12 @@ ?> ]]> </programlisting> + &example.outputs; + <screen> +<![CDATA[ +/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd +]]> + </screen> </example> </para> </refsect1> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml Wed Sep 1 18:13:17 2004 @@ -1,22 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.27 --> <refentry id='function.domelement-get-attribute-node'> <refnamediv> <refname>DomElement->get_attribute_node</refname> <refpurpose> - Devuelve el valor del atributo + Devuelve el nodo del atributo dado </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>object</type><methodname>DomElement->get_attribute_node</methodname> - <methodparam><type>object</type><parameter>atr</parameter></methodparam> + <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Devuelve el nodo del atributo <parameter>nombre</parameter> en el + elemento actual. El parámetro + <parameter>nombre</parameter> es sensible a mayúsculas y + minúsculas. + </para> + <para> + Si no se encuentra un atributo con el nombre dado, se devuelve + &false;. + </para> + <para> + <example> + <title>Obtener un nodo de atributo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); +if ($atributo = $raiz->get_attribute_node('language')) { + echo 'El idioma es: ' . $atributo->value() . "\n"; +} + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml Wed Sep 1 18:13:17 2004 @@ -1,27 +1,52 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.28 --> <refentry id='function.domelement-get-attribute'> <refnamediv> <refname>DomElement->get_attribute</refname> <refpurpose> - Devuelve el valor del atributo + Devuelve el valor del atributo dado </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> - <type>object</type><methodname>DomElement->get_attribute</methodname> + <type>string</type><methodname>DomElement->get_attribute</methodname> <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> <para> - Devuelve el atributo con nombre <parameter>nombre</parameter> del - nodo actual. + Devuelve el valor del atributo <parameter>nombre</parameter> en + el nodo actual. El parámetro <parameter>nombre</parameter> + es sensible a mayúsculas y minúsculas. </para> <para> - (Sólo PHP >= 4.3) Si no se encuentra un atributo con el - nombre dado, se devuelve una cadena vacía. + A partir de PHP 4.3, si no se encuentra un atributo con el + <parameter>nombre</parameter> dado, se devuelve una cadena + vacía. + </para> + <para> + <example> + <title>Obtener el valor de un atributo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +// obtener chapter +$raiz = $dom->document_element(); +echo $raiz->get_attribute('language')); // en + +?> +]]> + </programlisting> + </example> </para> <para> Vea también <function>domelement_set_attribute</function> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml Wed Sep 1 18:13:17 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domelement-has-attribute'> <refnamediv> <refname>DomElement->has_attribute</refname> <refpurpose> - Verifica si un atributo existe + Verifica si un atributo existe en el nodo actual </refpurpose> </refnamediv> <refsect1> @@ -16,7 +16,36 @@ <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Esta función verifica si un atributo con el + <parameter>nombre</parameter> dado existe en el nodo actual. + </para> + <para> + <example> + <title>Probar la existencia de un atributo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); + +$bufer = '<html' +if ($raiz->has_attribute('language')) { + $buffer .= 'lang="' . $raiz->get_attribute('language') . '"'; +} +$bufer .= '>'; + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml Wed Sep 1 18:13:17 2004 @@ -1,24 +1,25 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.7 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.27 --> <refentry id='function.domelement-set-attribute'> <refnamediv> <refname>DomElement->set_attribute</refname> <refpurpose> - Agrega un nuevo atributo + Define el valor de un atributo </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> - <type>bool</type><methodname>DomElement->set_attribute</methodname> + <type>object</type><methodname>DomElement->set_attribute</methodname> <methodparam><type>string</type><parameter>nombre</parameter></methodparam> <methodparam><type>string</type><parameter>valor</parameter></methodparam> </methodsynopsis> <para> Define un antributo con el nombre <parameter>nombre</parameter> - con el valor dado. Si el atributo no existe, será creado. + con el <parameter>valor</parameter> dado. Si el atributo no + existe, será creado. </para> <para> <example> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-tagname.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-tagname.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-tagname.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-tagname.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-tagname.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-tagname.xml Wed Sep 1 18:13:17 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id='function.domelement-tagname'> <refnamediv> <refname>DomElement->tagname</refname> <refpurpose> - Devuelve el nombre del elemento + Devuelve el nombre del elemento actual </refpurpose> </refnamediv> <refsect1> @@ -16,7 +16,36 @@ <void/> </methodsynopsis> <para> - &warn.undocumented.func; + Devuelve el nombre del nodo actual. Llamar esta función es + equivalente a acceder a la propiedad <literal>tagname</literal>, + o llamar <function>DomElement->node_name</function> en el nodo + actual. + </para> + <para> + <example> + <title>Obtener el nombre del nodo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); +echo $raiz->tagname(); // chapter +echo $raiz->tagname; // chapter +echo $raiz->node_name(); // chapter + + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/domxml-version.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/domxml-version.xml diff -u phpdoc-es/reference/domxml/functions/domxml-version.xml:1.1 phpdoc-es/reference/domxml/functions/domxml-version.xml:1.2 --- phpdoc-es/reference/domxml/functions/domxml-version.xml:1.1 Wed Jun 23 14:41:19 2004 +++ phpdoc-es/reference/domxml/functions/domxml-version.xml Wed Sep 1 18:13:17 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.2 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.39 --> <refentry id='function.domxml-version'> <refnamediv> <refname>domxml_version</refname> <refpurpose> - Obtener la versión de la biblioteca XML + Obtiene la versión de la biblioteca XML </refpurpose> </refnamediv> <refsect1> @@ -18,6 +18,26 @@ <para> Esta función devuelve la versión de la biblioteca XML usada actualmente. + </para> + <para> + <example> + <title>Ejemplo de <function>domxml_version</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo domxml_version(); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +20607 +]]> + </screen> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/file-get-contents.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-es/reference/filesystem/functions/file-get-contents.xml diff -u phpdoc-es/reference/filesystem/functions/file-get-contents.xml:1.7 phpdoc-es/reference/filesystem/functions/file-get-contents.xml:1.8 --- phpdoc-es/reference/filesystem/functions/file-get-contents.xml:1.7 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/filesystem/functions/file-get-contents.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.16 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.18 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.130 --> <refentry id="function.file-get-contents"> <refnamediv> @@ -32,17 +32,16 @@ <title>Uso de <function>file_get_contents</function> con una URI</title> <para> - Si está abriendo una URI con caracteres especiales, como + Si está abriendo una URI con caracteres especiales, como espacios, necesita codificar la URI con <function>urlencode</function>. - </para> <programlisting role="php"> <![CDATA[ <?php -$url = "http://foobar.com/con caracteres chistosos"; -list($protocolo, $uri) = split("//", $url); -$html = file_get_contents($protocolo . "//" . urlencode($uri)); +$url = 'http://example.com/con caracteres chistosos'; +list($protocolo, $uri) = split('//', $url); +$html = file_get_contents($protocolo . '//' . urlencode($uri)); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/fwrite.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/reference/filesystem/functions/fwrite.xml diff -u phpdoc-es/reference/filesystem/functions/fwrite.xml:1.3 phpdoc-es/reference/filesystem/functions/fwrite.xml:1.4 --- phpdoc-es/reference/filesystem/functions/fwrite.xml:1.3 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/filesystem/functions/fwrite.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.11 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.12 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.fwrite"> <refnamediv> @@ -86,8 +86,9 @@ </para> <simpara> Vea también <function>fread</function>, - <function>fopen</function>, <function>fsockopen</function>, and - <function>popen</function>. + <function>fopen</function>, <function>fsockopen</function>, + <function>popen</function>, y + <function>file_put_contents</function>. </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/pathinfo.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/reference/filesystem/functions/pathinfo.xml diff -u phpdoc-es/reference/filesystem/functions/pathinfo.xml:1.3 phpdoc-es/reference/filesystem/functions/pathinfo.xml:1.4 --- phpdoc-es/reference/filesystem/functions/pathinfo.xml:1.3 Thu Aug 12 20:05:29 2004 +++ phpdoc-es/reference/filesystem/functions/pathinfo.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.7 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.61 --> <refentry id="function.pathinfo"> <refnamediv> @@ -26,9 +26,9 @@ Puede especificar cuáles elementos son devueltos con el parámetro opcional <parameter>opciones</parameter>. Éste se compone de - <constant>PHP_PATHINFO_DIRNAME</constant>, - <constant>PHP_PATHINFO_BASENAME</constant> y - <constant>PHP_PATHINFO_EXTENSION</constant>. Su comportamiento + <constant>PATHINFO_DIRNAME</constant>, + <constant>PATHINFO_BASENAME</constant> y + <constant>PATHINFO_EXTENSION</constant>. Su comportamiento predeterminado es devolver todos los elementos. </para> <para> @@ -37,13 +37,11 @@ <programlisting role="php"> <![CDATA[ <?php +$partes_ruta = pathinfo('/www/htdocs/index.html'); -$partes_ruta = pathinfo("/www/htdocs/index.html"); - -echo $partes_ruta["dirname"] . "\n"; -echo $partes_ruta["basename"] . "\n"; -echo $partes_ruta["extension"] . "\n"; - +echo $partes_ruta['dirname'] . "\n"; +echo $partes_ruta['basename'] . "\n"; +echo $partes_ruta['extension'] . "\n"; ?> ]]> </programlisting> @@ -70,8 +68,8 @@ </note> <para> Vea también <function>dirname</function>, - <function>basename</function>, <function>parse_url</function> - y <function>realpath</function>. + <function>basename</function>, <function>parse_url</function> y + <function>realpath</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/tempnam.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/filesystem/functions/tempnam.xml diff -u phpdoc-es/reference/filesystem/functions/tempnam.xml:1.2 phpdoc-es/reference/filesystem/functions/tempnam.xml:1.3 --- phpdoc-es/reference/filesystem/functions/tempnam.xml:1.2 Tue May 25 00:53:36 2004 +++ phpdoc-es/reference/filesystem/functions/tempnam.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.7 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.tempnam"> <refnamediv> @@ -40,8 +40,8 @@ </simpara> </note> <para> - Devuelve el nuevo nombre de archivo temporal, o la cadena &false; - en caso de fallo. + Devuelve el nuevo nombre de archivo temporal, o &false; en caso + de fallo. <example> <title>Ejemplo de <function>tempnam</function></title> <programlisting role="php"> http://cvs.php.net/diff.php/phpdoc-es/reference/mcrypt/reference.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-es/reference/mcrypt/reference.xml diff -u phpdoc-es/reference/mcrypt/reference.xml:1.4 phpdoc-es/reference/mcrypt/reference.xml:1.5 --- phpdoc-es/reference/mcrypt/reference.xml:1.4 Thu May 13 14:41:55 2004 +++ phpdoc-es/reference/mcrypt/reference.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.13 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.15 Maintainer: lboshell Status: ready --> <reference id="ref.mcrypt"> <title>Funciones de Cifrado Mcrypt</title> <titleabbrev>mcrypt</titleabbrev> @@ -23,13 +23,17 @@ <para> Estas funciones trabajan usando <ulink url="&url.mcrypt;">mcrypt</ulink>. Para usar la biblioteca, - descargue libmcrypt-x.x.tar.gz desde <ulink + descargue <filename>libmcrypt-x.x.tar.gz</filename> desde <ulink url="&url.mcrypt;">&url.mcrypt;</ulink> y siga las instrucciones de instalación incluidas. Los usuarios de windows encontrarán todos los binarios compilados de mcrypt que se necesitan en <ulink url="&url.mcrypt.windows;">&url.mcrypt.windows;</ulink>. </para> + <simpara> + A partir de PHP 5.0.0, es necesario usar la versión 2.5.6 + o superior de libmcrypt. + </simpara> <para> Si ha enlazado el software contra libmcrypt 2.4.x o versiones superiores, los siguientes algoritmos de bloque adicionales son http://cvs.php.net/diff.php/phpdoc-es/reference/misc/functions/highlight-file.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc-es/reference/misc/functions/highlight-file.xml diff -u phpdoc-es/reference/misc/functions/highlight-file.xml:1.8 phpdoc-es/reference/misc/functions/highlight-file.xml:1.9 --- phpdoc-es/reference/misc/functions/highlight-file.xml:1.8 Mon Aug 23 00:48:07 2004 +++ phpdoc-es/reference/misc/functions/highlight-file.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.17 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.18 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/misc.xml, last change in rev 1.22 --> <refentry id="function.highlight-file"> <refnamediv> @@ -91,7 +91,7 @@ </head> <body bgcolor="white"> <?php - $script = getenv("PATH_TRANSLATED"); + $script = getenv('SCRIPT_FILENAME'); if (!$script) { echo "<br /><b>ERROR: Se necesita el Nombre del Script</b><br />"; } else { http://cvs.php.net/diff.php/phpdoc-es/reference/stream/functions/stream-get-meta-data.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/reference/stream/functions/stream-get-meta-data.xml diff -u phpdoc-es/reference/stream/functions/stream-get-meta-data.xml:1.3 phpdoc-es/reference/stream/functions/stream-get-meta-data.xml:1.4 --- phpdoc-es/reference/stream/functions/stream-get-meta-data.xml:1.3 Sat Mar 13 11:35:02 2004 +++ phpdoc-es/reference/stream/functions/stream-get-meta-data.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <refentry id="function.stream-get-meta-data"> <refnamediv> <refname>stream_get_meta_data</refname> @@ -85,8 +85,9 @@ <para> <parameter>filters</parameter> (array) - una matriz que contiene los nombres de cualquier filtro que esté - apilado para esta secuencia. Los filtros en la actualidad - carecen de documentación. + apilado para esta secuencia. La documentación sobre los + filtros puede encontrarse en el <link + linkend="filters">apéndice de Filtros</link>. </para> </listitem> </itemizedlist> http://cvs.php.net/co.php/phpdoc-es/appendices/filters.xml?r=1.1&p=1 Index: phpdoc-es/appendices/filters.xml +++ phpdoc-es/appendices/filters.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.11 Maintainer: lboshell Status: ready --> <appendix id="filters"> <title>Lista de Filtros Disponibles</title> <para> La siguiente es una lista de unos cuantos filtros de secuencia integrados que puede usar con <function>stream_filter_append</function>. Su versión de PHP puede tener más (o menos) filtros de los que son listados aquí. </para> <para> Vale la pena anotar una ligera asimetría entre <function>stream_filter_append</function> y <function>stream_filter_prepend</function>. Cada secuencia en PHP contiene un pequeño <emphasis>búfer de lectura</emphasis> en donde almacena los bloques de datos recibidos desde el sistema de archivos u otro recurso para procesar los datos de la forma más eficiente. Tan pronto como los datos son tomados del recurso y colocados en el búfer interno de la secuencia, éstos son procesados inmediatamente a través de cualquier filtro adjunto sin importar que la aplicación PHP esté lista para los datos o no. Si los datos están en el búfer de lectura cuando un filtro es <emphasis>añadido al final</emphasis>, los datos serán procesados inmediatamente a través del búfer haciendo parecer que el proceso fuera transparente. Sin embargo, si los datos están en el búfer de lectura cuando un filtro es <emphasis>adjuntado al comienzo</emphasis>, los datos <emphasis>NO</emphasis> serán procesados a través del filtro. En su lugar esperará a que el siguiente bloque de datos sea recuperado del recurso. </para> <para> Para una lista de filtros instalados en su versión de PHP, use <function>stream_get_filters</function>. </para> <section id="filters.string"> <title>Filtros de Cadena</title> <simpara> Cada uno de estos filtros hace precisamente lo que sus nombres implican y corresponden al comportamiento de una función de manipulación de cadenas que hace parte de php. Para más información sobre un filtro dado, refiérase a la página del manual de la función correspondiente. </simpara> <simpara> <literal>string.rot13</literal> (a partir de PHP 4.3.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>str_rot13</function>. </simpara> <example> <title>string.rot13</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.rot13'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: Rfgb rf han cehron. */ ?> ]]> </programlisting> </example> <simpara> <literal>string.toupper</literal> (a partir de PHP 5.0.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>strtoupper</function>. </simpara> <example> <title>string.toupper</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.toupper'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: ESTO ES UNA PRUEBA. */ ?> ]]> </programlisting> </example> <simpara> <literal>string.tolower</literal> (a partir de PHP 5.0.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>strtolower</function>. </simpara> <example> <title>string.tolower</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.tolower'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: esto es una prueba. */ ?> ]]> </programlisting> </example> <simpara> <literal>string.strip_tags</literal> (a partir de PHP 5.0.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>strip_tags</function>. Acepta parámetros en una de dos formas: Ya sea como una cadena que contiene una lista de etiquetas, similar al segundo parámetro de la función <function>strip_tags</function>, o como una matriz de nombres de etiqueta. </simpara> <example> <title>string.strip_tags</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.strip_tags', STREAM_FILTER_WRITE, "<b><i><u>"); fwrite($da, "<b>texto en negrilla</b> llevado a <h1>nivel de cabecera 1</h1>\n"); fclose($da); /* Imprime: <b>texto en negrilla</b> llevado a nivel de cabecera 1 */ $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.strip_tags', STREAM_FILTER_WRITE, array('b','i','u')); fwrite($da, "<b>texto en negrilla</b> llevado a <h1>nivel de cabecera 1</h1>\n"); fclose($da); /* Imprime: <b>texto en negrilla</b> llevado a nivel de cabecera 1 */ ?> ]]> </programlisting> </example> </section> <section id="filters.convert"> <title>Filtros de Conversión</title> <simpara> De forma similar a los filtros string.*, los filtros convert.* realizan acciones semejantes a sus nombres. Los filtros de conversión fueron agregados en PHP 5.0.0. Para más información sobre un filtro dado, refiérase a la página del manual sobre la función correspondiente. </simpara> <simpara> <literal>convert.base64-encode</literal> y <literal>convert.base64-decode</literal> El uso de estos filtros es equivalente a procesar todos los datos de la secuencia a través de las funciones <function>base64_encode</function> y <function>base64_decode</function> respectivamente. <literal>convert.base64-encode</literal> soporta el uso de parámetros entregados como una matriz asociativa. Si se usa <parameter>longitud-linea</parameter>, la salida base64 será separada en paquetes de <parameter>longitud-linea</parameter> caracteres cada uno. Si se usa <parameter>caracteres-final-de-linea</parameter>, cada paquete será delimitado por los caracteres dados. Estos parámetros ofrecen el mismo efecto que usar <function>base64_encode</function> con <function>chunk_split</function>. </simpara> <example> <title> convert.base64-encode y convert.base64-decode </title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.base64-encode'); fwrite($da, "This is a test.\n"); fclose($da); /* Imprime: VGhpcyBpcyBhIHRlc3QuCg== */ $param = array('line-length' => 8, 'line-break-chars' => "\r\n"); $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.base64-encode', STREAM_FILTER_WRITE, $param); fwrite($da, "This is a test.\n"); fclose($da); /* Imprime: VGhpcyBp : cyBhIHRl : c3QuCg== */ $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.base64-decode'); fwrite($da, "VGhpcyBpcyBhIHRlc3QuCg=="); fclose($da); /* Imprime: This is a test. */ ?> ]]> </programlisting> </example> <simpara> <literal>convert.quoted-printable-encode</literal> y <literal>convert.quoted-printable-decode</literal> El uso de la versión de docedificación de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>quoted_printable_decode</function>. No existe una función equivalente a <literal>convert.quoted-printable-encode</literal>. <literal>convert.quoted-printable-encode</literal> soporta el uso de parámetros dados como una matriz asociativa. Adicionalmente a los parámetros soportados por <literal>convert.base64-encode</literal>, <literal>convert.quoted-printable-encode</literal> soporta también los argumentos booleanos <parameter>binary</parameter> y <parameter>force-encode-first</parameter>. <literal>convert.base64-decode</literal> soporta únicamente el parámetro <parameter>line-break-chars</parameter> como una sugerencia del tipo para eliminar del material codificado. </simpara> <example> <title> convert.quoted-printable-encode y convert.quoted-printable-decode </title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.quoted-printable-encode'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: =Esto es una prueba.=0A */ ?> ]]> </programlisting> </example> </section> <section id="filters.compression"> <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. </simpara> <note> <simpara> Los filtros de compresión <emphasis>no</emphasis> generan cabeceras ni caracteres finales usados por utilidades de la línea de comandos como <literal>gzip</literal>. Sólo comprimen y descomprimen las porciones significativas de las secuencias de datos comprimidas. </simpara> </note> <simpara> <literal>zlib.deflate</literal> (compresión) y <literal>zlib.inflate</literal> (descompresión) son implementaciones de los métodos de compresión descritos en <ulink url="&url.rfc;1951">RFC 1951</ulink>. El filtro <literal>deflate</literal> recibe hasta tres parámetros pasados como una matriz asociativa. <parameter>level</parameter> describe la intensidad de compresión (1-9). Números más grandes producen, por lo general, resultados más pequeños, al costo de tiempo de procesamiento adicional. Dos niveles de compresión especiales existen también: 0 (para no-compresión), y -1 (el valor predeterminado de zlib -- actualmente 6). <parameter>window</parameter> es el registro en base-2 del tamaño de ventana del circuito cerrado de compresión. Valores más altos (de hasta 15 -- 32768 bytes) producen mejor compresión al costo de más memoria, mientras valores más bajos (alrededor de 9 -- 512 bytes) producen una compresión inferior en un espacio de memoria más pequeño. El tamaño de <parameter>window</parameter> es actualmente <constant>15</constant>. <parameter>memory</parameter> es una escala que indica cuánta memoria debería ser reservada. Los valores válidos están en el rango de 1 (reserva mínima) a 9 (reserva máxima). Esta reserva de memoria afecta únicamente la repidez y no tiene impacto en el tamaño del resultado generado. </simpara> <note> <simpara> Dado que el nivel de compresión es el parámetro usado con mayor frecuencia, puede indicarse alternativamente como un valor entero simple (en lugar de un elemento tipo matriz). </simpara> </note> <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 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 url="&url.pecl.package;zlib_filter">zlib_filter</ulink> desde <ulink url="&url.pecl;">PECL</ulink>. Estos filtros <emphasis>no</emphasis> están disponibles para PHP 4. </simpara> <example> <title> <literal>zlib.deflate</literal> y <literal>zlib.inflate</literal> </title> <programlisting role="php"> <![CDATA[ <?php $params = array('level' => 6, 'window' => 15, 'memory' => 9); $texto_original = "This is a test.\nThis is only a test.\nThis is not an important string.\n"; echo "El texto original tiene " . strlen($texto_original) . " caracteres.\n"; $da = fopen('test.deflated', 'w'); stream_filter_append($da, 'zlib.deflate', STREAM_FILTER_WRITE, $params); fwrite($da, $texto_original); fclose($da); echo "El archivo comprimido tiene " . filesize('test.deflated') . " bytes.\n"; echo "El texto original era:\n"; /* Use readfile y zlib.inflate para descomprimir al vuelo */ readfile('php://filter/zlib.inflate/resource=test.deflated'); /* Genera la salida: El texto original tiene 70 caracteres. El archivo comprimido tiene 56 bytes. El texto original era: This is a test. This is only a test. This is not an important string. */ ?> ]]> </programlisting> </example> <example> <title> <literal>zlib.deflate</literal> simple </title> <programlisting role="php"> <![CDATA[ <?php $texto_original = "This is a test.\nThis is only a test.\nThis is not an important string.\n"; echo "El texto original tiene " . strlen($texto_original) . " caracteres.\n"; $da = fopen('test.deflated', 'w'); /* Aqui "6" indica el nivel 6 de compresion */ stream_filter_append($da, 'zlib.deflate', STREAM_FILTER_WRITE, 6); fwrite($da, $texto_original); fclose($da); echo "El archivo comprimido tiene " . filesize('test.deflated') . " bytes.\n"; /* Generates output: El texto original tiene 70 caracteres. El archivo comprimido tiene 56 bytes. */ ?> ]]> </programlisting> </example> <simpara> <literal>bzip2.compress</literal> y <literal>bzip2.decompress</literal> funcionan de la misma forma que los filtros zlib descritos anteriormente. El filtro <literal>bzip2.compress</literal> acepta hasta dos parámetros dados como elementos de una matriz asociativa: <parameter>blocks</parameter> es un valor entero desde 1 hasta 9 que indica el número de bloques de 100kbytes de memoria a reservar para el espacio de trabajo. <parameter>work</parameter> es también un valor entero que va desde 0 a 250, e indica cuánto esfuerzo debe invertirse para expandir usando el método de compresión normal antes de caer en un método más lento pero más confiable. Modificar este parámetro afecta únicamente la rapidez de compresién. Ni el tamaño de la salida comprimida ni el uso de memoria se modifican por este valor. Un factor de trabajo de 0 le indica a la biblioteca bzip que debe usar el valor interno predeterminado. El filtro <literal>bzip2.decompress</literal> sólo acepta un parámetro, el cual puede ser pasado como un valor booleano ordinario, o como el elemento <parameter>small</parameter> de una matriz asociativa. <parameter>small</parameter>, cuando se define a un valor &true;, le indica a la biblioteca bzip de realice una descompresión con una cantidad de memoria mínima, al costo de la repidez. </simpara> <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 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 <ulink url="&url.pecl.package;bz2_filter">bz2_filter</ulink> desde <ulink url="&url.pecl;">PECL</ulink>. Estos filtros <emphasis>no</emphasis> se encuentran disponibles para PHP 4. </simpara> <example> <title> <literal>bzip2.compress</literal> y <literal>bzip2.decompress</literal> </title> <programlisting role="php"> <![CDATA[ <?php $param = array('blocks' => 9, 'work' => 0); echo "El archivo original tiene " . filesize('LICENSE') . " bytes.\n"; $da = fopen('LICENSE.compressed', 'w'); stream_filter_append($da, 'bzip2.compress', STREAM_FILTER_WRITE, $param); fwrite($da, file_get_contents('LICENSE')); fclose($da); echo "El archivo comprimido tiene " . filesize('LICENSE.compressed') . " bytes.\n"; /* Genera la salida: El archivo original tiene 3288 bytes. El archivo comprimido tiene 1488 bytes. */ ?> ]]> </programlisting> </example> </section> </appendix> <!-- 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/language-snippets.ent?r1=1.31&r2=1.32&ty=u Index: phpdoc-es/language-snippets.ent diff -u phpdoc-es/language-snippets.ent:1.31 phpdoc-es/language-snippets.ent:1.32 --- phpdoc-es/language-snippets.ent:1.31 Tue Aug 31 05:02:59 2004 +++ phpdoc-es/language-snippets.ent Wed Sep 1 18:13:17 2004 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.31 $ --> +<!-- $Revision: 1.32 $ --> <!-- EN-Revision: 1.121 Maintainer: rafael Status: ready --> <!-- Keep 'em sorted --> @@ -199,7 +199,7 @@ linkend="ini.register-long-arrays">register_long_arrays</link>.'> <!ENTITY ini.shorthandbytes '<simpara>Cuando se usa un <type>número -entero</type>, el valor del mismo es medido en 'bytes'. También se +entero</type>, el valor del mismo es medido en bytes. También se puede usar la notación reducida tal como se describe en <link linkend="faq.using.shorthandbytes">esta FAQ</link>.</simpara>'> http://cvs.php.net/diff.php/phpdoc-es/translation.xml?r1=1.169&r2=1.170&ty=u Index: phpdoc-es/translation.xml diff -u phpdoc-es/translation.xml:1.169 phpdoc-es/translation.xml:1.170 --- phpdoc-es/translation.xml:1.169 Tue Aug 31 04:27:41 2004 +++ phpdoc-es/translation.xml Wed Sep 1 18:13:17 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.169 $ --> +<!-- $Revision: 1.170 $ --> <!DOCTYPE translation SYSTEM "../entities/translation.dtd"> <translation> @@ -137,8 +137,6 @@ <file name="reference/array/functions/array-count-values.xml" person="baoengb" type="review" date="16.08.2004" /> - <file name="appendices/filters.xml" person="lboshell" - type="translation" date="24.08.2004" /> <file name="appendices/migration5.xml" person="lboshell" type="translation" date="24.08.2004" /> <file name="faq/migration5.xml" person="lboshell" http://cvs.php.net/diff.php/phpdoc-es/appendices/reserved.constants.standard.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/appendices/reserved.constants.standard.xml diff -u phpdoc-es/appendices/reserved.constants.standard.xml:1.1 phpdoc-es/appendices/reserved.constants.standard.xml:1.2 --- phpdoc-es/appendices/reserved.constants.standard.xml:1.1 Sat Nov 1 14:12:19 2003 +++ phpdoc-es/appendices/reserved.constants.standard.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.8 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.9 Maintainer: lboshell Status: ready --> <!-- DOCNOTE: some constants listed here are also there at reference/info/constants.xml. Further decision is needed @@ -911,6 +911,17 @@ </varlistentry> <varlistentry> <term> + <constant>PATH_SEPARATOR</constant> + (<type>string</type>) + </term> + <listitem> + <simpara> + + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term> <constant>CHAR_MAX</constant> (<type>integer</type>) </term> @@ -2211,7 +2222,7 @@ sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil -sgml-default-dtd-file:"manual.ced" +sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil http://cvs.php.net/diff.php/phpdoc-es/appendices/reserved.xml?r1=1.9&r2=1.10&ty=u Index: phpdoc-es/appendices/reserved.xml diff -u phpdoc-es/appendices/reserved.xml:1.9 phpdoc-es/appendices/reserved.xml:1.10 --- phpdoc-es/appendices/reserved.xml:1.9 Thu Aug 19 17:13:10 2004 +++ phpdoc-es/appendices/reserved.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> -<!-- EN-Revision: 1.44 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.10 $ --> +<!-- EN-Revision: 1.45 Maintainer: lboshell Status: ready --> <appendix id="reserved"> <title>Lista de Palabras Reservadas</title> @@ -629,6 +629,26 @@ realizado cualquier asignación al vuelo virtual-a-real. </simpara> + <note> + <simpara> + A partir de PHP 4.3.2, <envar>PATH_TRANSLATED</envar> ya no + se define implícitamente bajo la + <acronym>SAPI</acronym> de Apache 2, a diferencia de lo que + ocurre en Apache 1, en donde se define con el mismo valor de + la variable de servidor <envar>SCRIPT_FILENAME</envar> + cuando Apache no se encarga de definirlo. Este cambio fue + realizado para cumplir con la especificación + <acronym>CGI</acronym> de que <envar>PATH_TRANSLATED</envar> + debe existir únicamente si <envar>PATH_INFO</envar> + se define. + </simpara> + <simpara> + Los usuarios de Apache 2 pueden usar <literal>AcceptPathInfo + = On</literal> al interior de + <filename>httpd.conf</filename> para definir + <envar>PATH_INFO</envar>. + </simpara> + </note> </listitem> </varlistentry> http://cvs.php.net/diff.php/phpdoc-es/reference/array/functions/array-diff-ukey.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/array/functions/array-diff-ukey.xml diff -u phpdoc-es/reference/array/functions/array-diff-ukey.xml:1.1 phpdoc-es/reference/array/functions/array-diff-ukey.xml:1.2 --- phpdoc-es/reference/array/functions/array-diff-ukey.xml:1.1 Mon Aug 23 12:52:57 2004 +++ phpdoc-es/reference/array/functions/array-diff-ukey.xml Wed Sep 1 18:13:17 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- EN-Revision: 1.1 Maintainer: baoengb Status:ready --> <refentry id="function.array-diff-ukey"> <refnamediv> @@ -54,7 +54,7 @@ ]]> </programlisting> <para> - El ejemplo anterior producir&aacte; la siguiente salida: + El ejemplo anterior producirá la siguiente salida: </para> <screen> <![CDATA[ http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomAttribute-name.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/domxml/functions/DomAttribute-name.xml diff -u phpdoc-es/reference/domxml/functions/DomAttribute-name.xml:1.2 phpdoc-es/reference/domxml/functions/DomAttribute-name.xml:1.3 --- phpdoc-es/reference/domxml/functions/DomAttribute-name.xml:1.2 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/domxml/functions/DomAttribute-name.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domattribute-name'> <refnamediv> @@ -19,7 +19,8 @@ Esta función devuelve el nombre del atributo. </para> <para> - Vea también <function>domattribute_value</function>. + Vea también <function>domattribute_value</function> para + encontrar un ejemplo. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomAttribute-value.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/domxml/functions/DomAttribute-value.xml diff -u phpdoc-es/reference/domxml/functions/DomAttribute-value.xml:1.2 phpdoc-es/reference/domxml/functions/DomAttribute-value.xml:1.3 --- phpdoc-es/reference/domxml/functions/DomAttribute-value.xml:1.2 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/domxml/functions/DomAttribute-value.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domattribute-value'> <refnamediv> @@ -17,6 +17,41 @@ </methodsynopsis> <para> Esta función devuelve el valor del atributo. + </para> + <para> + <example> + <title>Obtener todos los atributos de un nodo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); +$atrs = $raiz->attributes(); + +echo 'Atributos de ' . $raiz->node_name() . "\n"; +foreach ($atrs as $atributo) { + echo ' - ' . $atributo->name . ' : ' . $attribute->value . "\n"; +} + +?> + +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Atributos de chapter + - language : en +]]> + </screen> + </example> </para> <para> Vea también <function>domattribute_name</function>. http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml diff -u phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml:1.1 Thu Jun 3 03:21:41 2004 +++ phpdoc-es/reference/domxml/functions/DomDocument-add-root.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id="function.domdocument-add-root"> <refnamediv> @@ -12,7 +12,7 @@ <refsect1> <title>Descripción</title> <methodsynopsis> - <type>resource</type><methodname>DomDocument->add_root</methodname> + <type>object</type><methodname>DomDocument->add_root</methodname> <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> &warn.experimental.func; @@ -29,9 +29,9 @@ <![CDATA[ <?php $doc = domxml_new_doc("1.0"); -$raiz = $doc->add_root("HTML"); -$cabecera = $raiz->new_child("HEAD", ""); -$cabecera->new_child("TITLE", "Hier der Titel"); +$raiz = $doc->add_root("html"); +$cabecera = $raiz->new_child("head", ""); +$cabecera->new_child("title", "Hier der Titel"); echo htmlentities($doc->dump_mem()); ?> ]]> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml diff -u phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml:1.1 Fri Jun 11 04:56:03 2004 +++ phpdoc-es/reference/domxml/functions/DomDocument-html-dump-mem.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id="function.domdocument-html-dump-mem"> <refnamediv> @@ -29,21 +29,29 @@ <programlisting role="php"> <![CDATA[ <?php + +// Crea el documento $doc = domxml_new_doc("1.0"); -$raiz = $doc->create_element("HTML"); +$raiz = $doc->create_element("html"); $raiz = $doc->append_child($raiz); -$cabecera = $doc->create_element("HEAD"); +$cabecera = $doc->create_element("head"); $cabecera = $raiz->append_child($cabecera); -$titulo = $doc->create_element("TITLE"); +$titulo = $doc->create_element("title"); $titulo = $cabecera->append_child($titulo); + $texto = $doc->create_text_node("This is the title"); $texto = $titulo->append_child($texto); -echo "<PRE>"; -echo htmlentities($doc->html_dump_mem()); -echo "</PRE>"; + +echo $doc->html_dump_mem(); ?> ]]> </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<html><head><title>This is the title</title></head></html> +]]> + </screen> </example> </para> <para> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml diff -u phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml:1.2 phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml:1.3 --- phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml:1.2 Mon Aug 23 00:48:06 2004 +++ phpdoc-es/reference/domxml/functions/DomDocument-xinclude.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <refentry id="function.domdocument-xinclude"> <refnamediv> <refname>DomDocument->xinclude</refname> @@ -15,8 +15,60 @@ <void/> </methodsynopsis> &warn.experimental.func; - &warn.undocumented.func; + <para> + Esta función reemplaza elementos XInclude en un objeto + DomDocument. + </para> + <para> + <example> + <title>Sustitución</title> + <programlisting role="php"> +<![CDATA[ +<?php +// include.xml contiene : +// <child>prueba</child> + +$xml = '<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="include.xml"> + <xi:fallback> + <error>xinclude: no se encontró include.xml</error> + </xi:fallback> + </xi:include> +</root>'; + +$domxml = domxml_open_mem($xml); +$domxml->xinclude(); + +echo $domxml->dump_mem(); + +?> +]]> + </programlisting> + &example.outputs; + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <child>prueba</child> +</root> +]]> + </screen> + <para> + Si <filename>include.xml</filename> no existe, usted + verá: + </para> + <screen role="xml"> +<![CDATA[ +<?xml version="1.0"?> +<root xmlns:xi="http://www.w3.org/2001/XInclude"> + <error>xinclude: no se encontró include.xml</error> +</root> +]]> + </screen> + </example> + </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml diff -u phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomDocumentType-name.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domdocumenttype-name'> <refnamediv> @@ -17,6 +17,28 @@ </methodsynopsis> <para> Esta función devuelve el nombre del tipo de documento. + </para> + <para> + <example> + <title>Obtener el nombre del tipo de documento</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$tipo_doc = $dom->doctype(); +echo $tipo_doc->name(); // chapter + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml diff -u phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml:1.1 phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomDocumentType-system-id.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domdocumenttype-system-id'> <refnamediv> @@ -19,8 +19,6 @@ Devuelve el id de sistema del tipo de documento. </para> <para> - El siguiente ejemplo imprime - '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'. <example> <title>Recuperación del id de sistema</title> <programlisting role="php"> @@ -38,6 +36,12 @@ ?> ]]> </programlisting> + &example.outputs; + <screen> +<![CDATA[ +/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd +]]> + </screen> </example> </para> </refsect1> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-get-attribute-node.xml Wed Sep 1 18:13:17 2004 @@ -1,22 +1,53 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.27 --> <refentry id='function.domelement-get-attribute-node'> <refnamediv> <refname>DomElement->get_attribute_node</refname> <refpurpose> - Devuelve el valor del atributo + Devuelve el nodo del atributo dado </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> <type>object</type><methodname>DomElement->get_attribute_node</methodname> - <methodparam><type>object</type><parameter>atr</parameter></methodparam> + <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Devuelve el nodo del atributo <parameter>nombre</parameter> en el + elemento actual. El parámetro + <parameter>nombre</parameter> es sensible a mayúsculas y + minúsculas. + </para> + <para> + Si no se encuentra un atributo con el nombre dado, se devuelve + &false;. + </para> + <para> + <example> + <title>Obtener un nodo de atributo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); +if ($atributo = $raiz->get_attribute_node('language')) { + echo 'El idioma es: ' . $atributo->value() . "\n"; +} + +?> +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-get-attribute.xml Wed Sep 1 18:13:17 2004 @@ -1,27 +1,52 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.28 --> <refentry id='function.domelement-get-attribute'> <refnamediv> <refname>DomElement->get_attribute</refname> <refpurpose> - Devuelve el valor del atributo + Devuelve el valor del atributo dado </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> - <type>object</type><methodname>DomElement->get_attribute</methodname> + <type>string</type><methodname>DomElement->get_attribute</methodname> <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> <para> - Devuelve el atributo con nombre <parameter>nombre</parameter> del - nodo actual. + Devuelve el valor del atributo <parameter>nombre</parameter> en + el nodo actual. El parámetro <parameter>nombre</parameter> + es sensible a mayúsculas y minúsculas. </para> <para> - (Sólo PHP >= 4.3) Si no se encuentra un atributo con el - nombre dado, se devuelve una cadena vacía. + A partir de PHP 4.3, si no se encuentra un atributo con el + <parameter>nombre</parameter> dado, se devuelve una cadena + vacía. + </para> + <para> + <example> + <title>Obtener el valor de un atributo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +// obtener chapter +$raiz = $dom->document_element(); +echo $raiz->get_attribute('language')); // en + +?> +]]> + </programlisting> + </example> </para> <para> Vea también <function>domelement_set_attribute</function> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-has-attribute.xml Wed Sep 1 18:13:17 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.5 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.38 --> <refentry id='function.domelement-has-attribute'> <refnamediv> <refname>DomElement->has_attribute</refname> <refpurpose> - Verifica si un atributo existe + Verifica si un atributo existe en el nodo actual </refpurpose> </refnamediv> <refsect1> @@ -16,7 +16,36 @@ <methodparam><type>string</type><parameter>nombre</parameter></methodparam> </methodsynopsis> <para> - &warn.undocumented.func; + Esta función verifica si un atributo con el + <parameter>nombre</parameter> dado existe en el nodo actual. + </para> + <para> + <example> + <title>Probar la existencia de un atributo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); + +$bufer = '<html' +if ($raiz->has_attribute('language')) { + $buffer .= 'lang="' . $raiz->get_attribute('language') . '"'; +} +$bufer .= '>'; + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-set-attribute.xml Wed Sep 1 18:13:17 2004 @@ -1,24 +1,25 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.7 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.27 --> <refentry id='function.domelement-set-attribute'> <refnamediv> <refname>DomElement->set_attribute</refname> <refpurpose> - Agrega un nuevo atributo + Define el valor de un atributo </refpurpose> </refnamediv> <refsect1> <title>Descripción</title> <methodsynopsis> - <type>bool</type><methodname>DomElement->set_attribute</methodname> + <type>object</type><methodname>DomElement->set_attribute</methodname> <methodparam><type>string</type><parameter>nombre</parameter></methodparam> <methodparam><type>string</type><parameter>valor</parameter></methodparam> </methodsynopsis> <para> Define un antributo con el nombre <parameter>nombre</parameter> - con el valor dado. Si el atributo no existe, será creado. + con el <parameter>valor</parameter> dado. Si el atributo no + existe, será creado. </para> <para> <example> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/DomElement-tagname.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/DomElement-tagname.xml diff -u phpdoc-es/reference/domxml/functions/DomElement-tagname.xml:1.1 phpdoc-es/reference/domxml/functions/DomElement-tagname.xml:1.2 --- phpdoc-es/reference/domxml/functions/DomElement-tagname.xml:1.1 Tue Jun 15 22:34:07 2004 +++ phpdoc-es/reference/domxml/functions/DomElement-tagname.xml Wed Sep 1 18:13:17 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.6 --> <refentry id='function.domelement-tagname'> <refnamediv> <refname>DomElement->tagname</refname> <refpurpose> - Devuelve el nombre del elemento + Devuelve el nombre del elemento actual </refpurpose> </refnamediv> <refsect1> @@ -16,7 +16,36 @@ <void/> </methodsynopsis> <para> - &warn.undocumented.func; + Devuelve el nombre del nodo actual. Llamar esta función es + equivalente a acceder a la propiedad <literal>tagname</literal>, + o llamar <function>DomElement->node_name</function> en el nodo + actual. + </para> + <para> + <example> + <title>Obtener el nombre del nodo</title> + <programlisting role="php"> +<![CDATA[ +<?php + +include("ejemplo.inc"); + +if (!$dom = domxml_open_mem($cadena_xml)) { + echo "Ocurrió un error al interpretar el documento\n"; + exit; +} + +$raiz = $dom->document_element(); +echo $raiz->tagname(); // chapter +echo $raiz->tagname; // chapter +echo $raiz->node_name(); // chapter + + +?> + +]]> + </programlisting> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/domxml/functions/domxml-version.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-es/reference/domxml/functions/domxml-version.xml diff -u phpdoc-es/reference/domxml/functions/domxml-version.xml:1.1 phpdoc-es/reference/domxml/functions/domxml-version.xml:1.2 --- phpdoc-es/reference/domxml/functions/domxml-version.xml:1.1 Wed Jun 23 14:41:19 2004 +++ phpdoc-es/reference/domxml/functions/domxml-version.xml Wed Sep 1 18:13:17 2004 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> -<!-- EN-Revision: 1.2 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.3 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/domxml.xml, last change in rev 1.39 --> <refentry id='function.domxml-version'> <refnamediv> <refname>domxml_version</refname> <refpurpose> - Obtener la versión de la biblioteca XML + Obtiene la versión de la biblioteca XML </refpurpose> </refnamediv> <refsect1> @@ -18,6 +18,26 @@ <para> Esta función devuelve la versión de la biblioteca XML usada actualmente. + </para> + <para> + <example> + <title>Ejemplo de <function>domxml_version</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +echo domxml_version(); + +?> +]]> + </programlisting> + &example.outputs.similar; + <screen> +<![CDATA[ +20607 +]]> + </screen> + </example> </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/file-get-contents.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc-es/reference/filesystem/functions/file-get-contents.xml diff -u phpdoc-es/reference/filesystem/functions/file-get-contents.xml:1.7 phpdoc-es/reference/filesystem/functions/file-get-contents.xml:1.8 --- phpdoc-es/reference/filesystem/functions/file-get-contents.xml:1.7 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/filesystem/functions/file-get-contents.xml Wed Sep 1 18:13:17 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> -<!-- EN-Revision: 1.16 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.8 $ --> +<!-- EN-Revision: 1.18 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.130 --> <refentry id="function.file-get-contents"> <refnamediv> @@ -32,17 +32,16 @@ <title>Uso de <function>file_get_contents</function> con una URI</title> <para> - Si está abriendo una URI con caracteres especiales, como + Si está abriendo una URI con caracteres especiales, como espacios, necesita codificar la URI con <function>urlencode</function>. - </para> <programlisting role="php"> <![CDATA[ <?php -$url = "http://foobar.com/con caracteres chistosos"; -list($protocolo, $uri) = split("//", $url); -$html = file_get_contents($protocolo . "//" . urlencode($uri)); +$url = 'http://example.com/con caracteres chistosos'; +list($protocolo, $uri) = split('//', $url); +$html = file_get_contents($protocolo . '//' . urlencode($uri)); ?> ]]> </programlisting> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/fwrite.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/reference/filesystem/functions/fwrite.xml diff -u phpdoc-es/reference/filesystem/functions/fwrite.xml:1.3 phpdoc-es/reference/filesystem/functions/fwrite.xml:1.4 --- phpdoc-es/reference/filesystem/functions/fwrite.xml:1.3 Tue Aug 10 18:47:32 2004 +++ phpdoc-es/reference/filesystem/functions/fwrite.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.11 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.12 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.fwrite"> <refnamediv> @@ -86,8 +86,9 @@ </para> <simpara> Vea también <function>fread</function>, - <function>fopen</function>, <function>fsockopen</function>, and - <function>popen</function>. + <function>fopen</function>, <function>fsockopen</function>, + <function>popen</function>, y + <function>file_put_contents</function>. </simpara> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/pathinfo.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/reference/filesystem/functions/pathinfo.xml diff -u phpdoc-es/reference/filesystem/functions/pathinfo.xml:1.3 phpdoc-es/reference/filesystem/functions/pathinfo.xml:1.4 --- phpdoc-es/reference/filesystem/functions/pathinfo.xml:1.3 Thu Aug 12 20:05:29 2004 +++ phpdoc-es/reference/filesystem/functions/pathinfo.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.7 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.61 --> <refentry id="function.pathinfo"> <refnamediv> @@ -26,9 +26,9 @@ Puede especificar cuáles elementos son devueltos con el parámetro opcional <parameter>opciones</parameter>. Éste se compone de - <constant>PHP_PATHINFO_DIRNAME</constant>, - <constant>PHP_PATHINFO_BASENAME</constant> y - <constant>PHP_PATHINFO_EXTENSION</constant>. Su comportamiento + <constant>PATHINFO_DIRNAME</constant>, + <constant>PATHINFO_BASENAME</constant> y + <constant>PATHINFO_EXTENSION</constant>. Su comportamiento predeterminado es devolver todos los elementos. </para> <para> @@ -37,13 +37,11 @@ <programlisting role="php"> <![CDATA[ <?php +$partes_ruta = pathinfo('/www/htdocs/index.html'); -$partes_ruta = pathinfo("/www/htdocs/index.html"); - -echo $partes_ruta["dirname"] . "\n"; -echo $partes_ruta["basename"] . "\n"; -echo $partes_ruta["extension"] . "\n"; - +echo $partes_ruta['dirname'] . "\n"; +echo $partes_ruta['basename'] . "\n"; +echo $partes_ruta['extension'] . "\n"; ?> ]]> </programlisting> @@ -70,8 +68,8 @@ </note> <para> Vea también <function>dirname</function>, - <function>basename</function>, <function>parse_url</function> - y <function>realpath</function>. + <function>basename</function>, <function>parse_url</function> y + <function>realpath</function>. </para> </refsect1> </refentry> http://cvs.php.net/diff.php/phpdoc-es/reference/filesystem/functions/tempnam.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-es/reference/filesystem/functions/tempnam.xml diff -u phpdoc-es/reference/filesystem/functions/tempnam.xml:1.2 phpdoc-es/reference/filesystem/functions/tempnam.xml:1.3 --- phpdoc-es/reference/filesystem/functions/tempnam.xml:1.2 Tue May 25 00:53:36 2004 +++ phpdoc-es/reference/filesystem/functions/tempnam.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> -<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.7 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> <refentry id="function.tempnam"> <refnamediv> @@ -40,8 +40,8 @@ </simpara> </note> <para> - Devuelve el nuevo nombre de archivo temporal, o la cadena &false; - en caso de fallo. + Devuelve el nuevo nombre de archivo temporal, o &false; en caso + de fallo. <example> <title>Ejemplo de <function>tempnam</function></title> <programlisting role="php"> http://cvs.php.net/diff.php/phpdoc-es/reference/mcrypt/reference.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-es/reference/mcrypt/reference.xml diff -u phpdoc-es/reference/mcrypt/reference.xml:1.4 phpdoc-es/reference/mcrypt/reference.xml:1.5 --- phpdoc-es/reference/mcrypt/reference.xml:1.4 Thu May 13 14:41:55 2004 +++ phpdoc-es/reference/mcrypt/reference.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> -<!-- EN-Revision: 1.13 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.15 Maintainer: lboshell Status: ready --> <reference id="ref.mcrypt"> <title>Funciones de Cifrado Mcrypt</title> <titleabbrev>mcrypt</titleabbrev> @@ -23,13 +23,17 @@ <para> Estas funciones trabajan usando <ulink url="&url.mcrypt;">mcrypt</ulink>. Para usar la biblioteca, - descargue libmcrypt-x.x.tar.gz desde <ulink + descargue <filename>libmcrypt-x.x.tar.gz</filename> desde <ulink url="&url.mcrypt;">&url.mcrypt;</ulink> y siga las instrucciones de instalación incluidas. Los usuarios de windows encontrarán todos los binarios compilados de mcrypt que se necesitan en <ulink url="&url.mcrypt.windows;">&url.mcrypt.windows;</ulink>. </para> + <simpara> + A partir de PHP 5.0.0, es necesario usar la versión 2.5.6 + o superior de libmcrypt. + </simpara> <para> Si ha enlazado el software contra libmcrypt 2.4.x o versiones superiores, los siguientes algoritmos de bloque adicionales son http://cvs.php.net/diff.php/phpdoc-es/reference/misc/functions/highlight-file.xml?r1=1.8&r2=1.9&ty=u Index: phpdoc-es/reference/misc/functions/highlight-file.xml diff -u phpdoc-es/reference/misc/functions/highlight-file.xml:1.8 phpdoc-es/reference/misc/functions/highlight-file.xml:1.9 --- phpdoc-es/reference/misc/functions/highlight-file.xml:1.8 Mon Aug 23 00:48:07 2004 +++ phpdoc-es/reference/misc/functions/highlight-file.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> -<!-- EN-Revision: 1.17 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.9 $ --> +<!-- EN-Revision: 1.18 Maintainer: lboshell Status: ready --> <!-- splitted from ./en/functions/misc.xml, last change in rev 1.22 --> <refentry id="function.highlight-file"> <refnamediv> @@ -91,7 +91,7 @@ </head> <body bgcolor="white"> <?php - $script = getenv("PATH_TRANSLATED"); + $script = getenv('SCRIPT_FILENAME'); if (!$script) { echo "<br /><b>ERROR: Se necesita el Nombre del Script</b><br />"; } else { http://cvs.php.net/diff.php/phpdoc-es/reference/stream/functions/stream-get-meta-data.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-es/reference/stream/functions/stream-get-meta-data.xml diff -u phpdoc-es/reference/stream/functions/stream-get-meta-data.xml:1.3 phpdoc-es/reference/stream/functions/stream-get-meta-data.xml:1.4 --- phpdoc-es/reference/stream/functions/stream-get-meta-data.xml:1.3 Sat Mar 13 11:35:02 2004 +++ phpdoc-es/reference/stream/functions/stream-get-meta-data.xml Wed Sep 1 18:13:18 2004 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> -<!-- EN-Revision: 1.4 Maintainer: lboshell Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- EN-Revision: 1.6 Maintainer: lboshell Status: ready --> <refentry id="function.stream-get-meta-data"> <refnamediv> <refname>stream_get_meta_data</refname> @@ -85,8 +85,9 @@ <para> <parameter>filters</parameter> (array) - una matriz que contiene los nombres de cualquier filtro que esté - apilado para esta secuencia. Los filtros en la actualidad - carecen de documentación. + apilado para esta secuencia. La documentación sobre los + filtros puede encontrarse en el <link + linkend="filters">apéndice de Filtros</link>. </para> </listitem> </itemizedlist> http://cvs.php.net/co.php/phpdoc-es/appendices/filters.xml?r=1.1&p=1 Index: phpdoc-es/appendices/filters.xml +++ phpdoc-es/appendices/filters.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.11 Maintainer: lboshell Status: ready --> <appendix id="filters"> <title>Lista de Filtros Disponibles</title> <para> La siguiente es una lista de unos cuantos filtros de secuencia integrados que puede usar con <function>stream_filter_append</function>. Su versión de PHP puede tener más (o menos) filtros de los que son listados aquí. </para> <para> Vale la pena anotar una ligera asimetría entre <function>stream_filter_append</function> y <function>stream_filter_prepend</function>. Cada secuencia en PHP contiene un pequeño <emphasis>búfer de lectura</emphasis> en donde almacena los bloques de datos recibidos desde el sistema de archivos u otro recurso para procesar los datos de la forma más eficiente. Tan pronto como los datos son tomados del recurso y colocados en el búfer interno de la secuencia, éstos son procesados inmediatamente a través de cualquier filtro adjunto sin importar que la aplicación PHP esté lista para los datos o no. Si los datos están en el búfer de lectura cuando un filtro es <emphasis>añadido al final</emphasis>, los datos serán procesados inmediatamente a través del búfer haciendo parecer que el proceso fuera transparente. Sin embargo, si los datos están en el búfer de lectura cuando un filtro es <emphasis>adjuntado al comienzo</emphasis>, los datos <emphasis>NO</emphasis> serán procesados a través del filtro. En su lugar esperará a que el siguiente bloque de datos sea recuperado del recurso. </para> <para> Para una lista de filtros instalados en su versión de PHP, use <function>stream_get_filters</function>. </para> <section id="filters.string"> <title>Filtros de Cadena</title> <simpara> Cada uno de estos filtros hace precisamente lo que sus nombres implican y corresponden al comportamiento de una función de manipulación de cadenas que hace parte de php. Para más información sobre un filtro dado, refiérase a la página del manual de la función correspondiente. </simpara> <simpara> <literal>string.rot13</literal> (a partir de PHP 4.3.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>str_rot13</function>. </simpara> <example> <title>string.rot13</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.rot13'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: Rfgb rf han cehron. */ ?> ]]> </programlisting> </example> <simpara> <literal>string.toupper</literal> (a partir de PHP 5.0.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>strtoupper</function>. </simpara> <example> <title>string.toupper</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.toupper'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: ESTO ES UNA PRUEBA. */ ?> ]]> </programlisting> </example> <simpara> <literal>string.tolower</literal> (a partir de PHP 5.0.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>strtolower</function>. </simpara> <example> <title>string.tolower</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.tolower'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: esto es una prueba. */ ?> ]]> </programlisting> </example> <simpara> <literal>string.strip_tags</literal> (a partir de PHP 5.0.0) El uso de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>strip_tags</function>. Acepta parámetros en una de dos formas: Ya sea como una cadena que contiene una lista de etiquetas, similar al segundo parámetro de la función <function>strip_tags</function>, o como una matriz de nombres de etiqueta. </simpara> <example> <title>string.strip_tags</title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.strip_tags', STREAM_FILTER_WRITE, "<b><i><u>"); fwrite($da, "<b>texto en negrilla</b> llevado a <h1>nivel de cabecera 1</h1>\n"); fclose($da); /* Imprime: <b>texto en negrilla</b> llevado a nivel de cabecera 1 */ $da = fopen('php://output', 'w'); stream_filter_append($da, 'string.strip_tags', STREAM_FILTER_WRITE, array('b','i','u')); fwrite($da, "<b>texto en negrilla</b> llevado a <h1>nivel de cabecera 1</h1>\n"); fclose($da); /* Imprime: <b>texto en negrilla</b> llevado a nivel de cabecera 1 */ ?> ]]> </programlisting> </example> </section> <section id="filters.convert"> <title>Filtros de Conversión</title> <simpara> De forma similar a los filtros string.*, los filtros convert.* realizan acciones semejantes a sus nombres. Los filtros de conversión fueron agregados en PHP 5.0.0. Para más información sobre un filtro dado, refiérase a la página del manual sobre la función correspondiente. </simpara> <simpara> <literal>convert.base64-encode</literal> y <literal>convert.base64-decode</literal> El uso de estos filtros es equivalente a procesar todos los datos de la secuencia a través de las funciones <function>base64_encode</function> y <function>base64_decode</function> respectivamente. <literal>convert.base64-encode</literal> soporta el uso de parámetros entregados como una matriz asociativa. Si se usa <parameter>longitud-linea</parameter>, la salida base64 será separada en paquetes de <parameter>longitud-linea</parameter> caracteres cada uno. Si se usa <parameter>caracteres-final-de-linea</parameter>, cada paquete será delimitado por los caracteres dados. Estos parámetros ofrecen el mismo efecto que usar <function>base64_encode</function> con <function>chunk_split</function>. </simpara> <example> <title> convert.base64-encode y convert.base64-decode </title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.base64-encode'); fwrite($da, "This is a test.\n"); fclose($da); /* Imprime: VGhpcyBpcyBhIHRlc3QuCg== */ $param = array('line-length' => 8, 'line-break-chars' => "\r\n"); $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.base64-encode', STREAM_FILTER_WRITE, $param); fwrite($da, "This is a test.\n"); fclose($da); /* Imprime: VGhpcyBp : cyBhIHRl : c3QuCg== */ $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.base64-decode'); fwrite($da, "VGhpcyBpcyBhIHRlc3QuCg=="); fclose($da); /* Imprime: This is a test. */ ?> ]]> </programlisting> </example> <simpara> <literal>convert.quoted-printable-encode</literal> y <literal>convert.quoted-printable-decode</literal> El uso de la versión de docedificación de este filtro es equivalente a procesar todos los datos de la secuencia a través de la función <function>quoted_printable_decode</function>. No existe una función equivalente a <literal>convert.quoted-printable-encode</literal>. <literal>convert.quoted-printable-encode</literal> soporta el uso de parámetros dados como una matriz asociativa. Adicionalmente a los parámetros soportados por <literal>convert.base64-encode</literal>, <literal>convert.quoted-printable-encode</literal> soporta también los argumentos booleanos <parameter>binary</parameter> y <parameter>force-encode-first</parameter>. <literal>convert.base64-decode</literal> soporta únicamente el parámetro <parameter>line-break-chars</parameter> como una sugerencia del tipo para eliminar del material codificado. </simpara> <example> <title> convert.quoted-printable-encode y convert.quoted-printable-decode </title> <programlisting role="php"> <![CDATA[ <?php $da = fopen('php://output', 'w'); stream_filter_append($da, 'convert.quoted-printable-encode'); fwrite($da, "Esto es una prueba.\n"); /* Imprime: =Esto es una prueba.=0A */ ?> ]]> </programlisting> </example> </section> <section id="filters.compression"> <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. </simpara> <note> <simpara> Los filtros de compresión <emphasis>no</emphasis> generan cabeceras ni caracteres finales usados por utilidades de la línea de comandos como <literal>gzip</literal>. Sólo comprimen y descomprimen las porciones significativas de las secuencias de datos comprimidas. </simpara> </note> <simpara> <literal>zlib.deflate</literal> (compresión) y <literal>zlib.inflate</literal> (descompresión) son implementaciones de los métodos de compresión descritos en <ulink url="&url.rfc;1951">RFC 1951</ulink>. El filtro <literal>deflate</literal> recibe hasta tres parámetros pasados como una matriz asociativa. <parameter>level</parameter> describe la intensidad de compresión (1-9). Números más grandes producen, por lo general, resultados más pequeños, al costo de tiempo de procesamiento adicional. Dos niveles de compresión especiales existen también: 0 (para no-compresión), y -1 (el valor predeterminado de zlib -- actualmente 6). <parameter>window</parameter> es el registro en base-2 del tamaño de ventana del circuito cerrado de compresión. Valores más altos (de hasta 15 -- 32768 bytes) producen mejor compresión al costo de más memoria, mientras valores más bajos (alrededor de 9 -- 512 bytes) producen una compresión inferior en un espacio de memoria más pequeño. El tamaño de <parameter>window</parameter> es actualmente <constant>15</constant>. <parameter>memory</parameter> es una escala que indica cuánta memoria debería ser reservada. Los valores válidos están en el rango de 1 (reserva mínima) a 9 (reserva máxima). Esta reserva de memoria afecta únicamente la repidez y no tiene impacto en el tamaño del resultado generado. </simpara> <note> <simpara> Dado que el nivel de compresión es el parámetro usado con mayor frecuencia, puede indicarse alternativamente como un valor entero simple (en lugar de un elemento tipo matriz). </simpara> </note> <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 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 url="&url.pecl.package;zlib_filter">zlib_filter</ulink> desde <ulink url="&url.pecl;">PECL</ulink>. Estos filtros <emphasis>no</emphasis> están disponibles para PHP 4. </simpara> <example> <title> <literal>zlib.deflate</literal> y <literal>zlib.inflate</literal> </title> <programlisting role="php"> <![CDATA[ <?php $params = array('level' => 6, 'window' => 15, 'memory' => 9); $texto_original = "This is a test.\nThis is only a test.\nThis is not an important string.\n"; echo "El texto original tiene " . strlen($texto_original) . " caracteres.\n"; $da = fopen('test.deflated', 'w'); stream_filter_append($da, 'zlib.deflate', STREAM_FILTER_WRITE, $params); fwrite($da, $texto_original); fclose($da); echo "El archivo comprimido tiene " . filesize('test.deflated') . " bytes.\n"; echo "El texto original era:\n"; /* Use readfile y zlib.inflate para descomprimir al vuelo */ readfile('php://filter/zlib.inflate/resource=test.deflated'); /* Genera la salida: El texto original tiene 70 caracteres. El archivo comprimido tiene 56 bytes. El texto original era: This is a test. This is only a test. This is not an important string. */ ?> ]]> </programlisting> </example> <example> <title> <literal>zlib.deflate</literal> simple </title> <programlisting role="php"> <![CDATA[ <?php $texto_original = "This is a test.\nThis is only a test.\nThis is not an important string.\n"; echo "El texto original tiene " . strlen($texto_original) . " caracteres.\n"; $da = fopen('test.deflated', 'w'); /* Aqui "6" indica el nivel 6 de compresion */ stream_filter_append($da, 'zlib.deflate', STREAM_FILTER_WRITE, 6); fwrite($da, $texto_original); fclose($da); echo "El archivo comprimido tiene " . filesize('test.deflated') . " bytes.\n"; /* Generates output: El texto original tiene 70 caracteres. El archivo comprimido tiene 56 bytes. */ ?> ]]> </programlisting> </example> <simpara> <literal>bzip2.compress</literal> y <literal>bzip2.decompress</literal> funcionan de la misma forma que los filtros zlib descritos anteriormente. El filtro <literal>bzip2.compress</literal> acepta hasta dos parámetros dados como elementos de una matriz asociativa: <parameter>blocks</parameter> es un valor entero desde 1 hasta 9 que indica el número de bloques de 100kbytes de memoria a reservar para el espacio de trabajo. <parameter>work</parameter> es también un valor entero que va desde 0 a 250, e indica cuánto esfuerzo debe invertirse para expandir usando el método de compresión normal antes de caer en un método más lento pero más confiable. Modificar este parámetro afecta únicamente la rapidez de compresién. Ni el tamaño de la salida comprimida ni el uso de memoria se modifican por este valor. Un factor de trabajo de 0 le indica a la biblioteca bzip que debe usar el valor interno predeterminado. El filtro <literal>bzip2.decompress</literal> sólo acepta un parámetro, el cual puede ser pasado como un valor booleano ordinario, o como el elemento <parameter>small</parameter> de una matriz asociativa. <parameter>small</parameter>, cuando se define a un valor &true;, le indica a la biblioteca bzip de realice una descompresión con una cantidad de memoria mínima, al costo de la repidez. </simpara> <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 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 <ulink url="&url.pecl.package;bz2_filter">bz2_filter</ulink> desde <ulink url="&url.pecl;">PECL</ulink>. Estos filtros <emphasis>no</emphasis> se encuentran disponibles para PHP 4. </simpara> <example> <title> <literal>bzip2.compress</literal> y <literal>bzip2.decompress</literal> </title> <programlisting role="php"> <![CDATA[ <?php $param = array('blocks' => 9, 'work' => 0); echo "El archivo original tiene " . filesize('LICENSE') . " bytes.\n"; $da = fopen('LICENSE.compressed', 'w'); stream_filter_append($da, 'bzip2.compress', STREAM_FILTER_WRITE, $param); fwrite($da, file_get_contents('LICENSE')); fclose($da); echo "El archivo comprimido tiene " . filesize('LICENSE.compressed') . " bytes.\n"; /* Genera la salida: El archivo original tiene 3288 bytes. El archivo comprimido tiene 1488 bytes. */ ?> ]]> </programlisting> </example> </section> </appendix> <!-- 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 -->