cvs: phpdoc-es /reference/shmop reference.xml

From: Date: Thu, 23 Oct 2003 18:19:56 +0000
Subject: cvs: phpdoc-es /reference/shmop reference.xml
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-352@lists.php.net to get a copy of this message
javi Thu Oct 23 14:19:56 2003 EDT Modified files: /phpdoc-es/reference/shmop reference.xml Log: Index: phpdoc-es/reference/shmop/reference.xml diff -u phpdoc-es/reference/shmop/reference.xml:1.2 phpdoc-es/reference/shmop/reference.xml:1.3 --- phpdoc-es/reference/shmop/reference.xml:1.2 Mon Apr 15 20:34:39 2002 +++ phpdoc-es/reference/shmop/reference.xml Thu Oct 23 14:19:54 2003 @@ -1,64 +1,99 @@ <?xml version="1.0" encoding="iso-8859-1"?> +<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.9 Maintainer: javi Status: ready --> <reference id="ref.shmop"> - <title>Shared Memory Functions</title> + <title>Funciones de Memoria Compartida</title> <titleabbrev>shmop</titleabbrev> - + <partintro> - <para> - Shmop is an easy to use set of functions that allows php to read, - write, create and delete UNIX shared memory segments. The functions - will not work on windows, as it does not support shared memory. To - use shmop you will need to compile php with the --enable-shmop parameter - in your configure line. - </para> - <note> - <simpara> - The functions explained in the chapter begin all with - <function>shm_</function> in PHP 4.0.3, but in PHP 4.0.4 and later - versions these names are changed to begin with - <function>shmop_</function>. - </simpara> - </note> - <para> - <example> - <title>Shared Memory Operations Overview</title> - <programlisting role="php"> -&lt;?php + <section id="shmop.intro"> + &reftitle.intro; + <para> + Shmop es un conjunto de funciones que permiten a PHP leer, escribirm crear +y borrar de forma sencilla segmentos de memoria compartida de tipo UNIX. Se debe + tener en cuenta que las versiones de Windows anteriores a Windows 2000 no +soportan el uso de memoria compartida. + </para> + <note> + <simpara> + En PHP 4.0.3, el nombre de todas estas funciones estaba precedido por el +prefijo <literal>shm</literal> y actualmente lo est&aacute;n por el +prefijo <literal>shmop</literal>. + </simpara> + </note> + </section> + + <section id="shmop.requirements"> + &reftitle.required; + &no.requirement; + </section> + + &reference.shmop.configure; + + <section id="shmop.configuration"> + &reftitle.runtime; + &no.config; + </section> + + <section id="shmop.resources"> + &reftitle.resources; + <para> + </para> + </section> + + <section id="shmop.constants"> + &reftitle.constants; + &no.constants; + </section> + + <section id="shmop.examples"> + &reftitle.examples; + <para> + <example> + <title>Resumen de las operaciones con Memoria Compartida</title> + <programlisting role="php"> +<![CDATA[ +<?php -// Create 100 byte shared memory block with system id if 0xff3 +// Creacion de un segmento de memoria compartida de 100 bytes y con un +// identificador igual a 0xff3 $shm_id = shmop_open(0xff3, "c", 0644, 100); if(!$shm_id) { - echo "Couldn't create shared memory segment\n"; + echo "No se pudo crear el segmento de memoria compartida\n"; } -// Get shared memory block's size +// Obtencion del tama&ntilde;o del segmento de memoria compartida $shm_size = shmop_size($shm_id); -echo "SHM Block Size: ".$shm_size. " has been created.\n"; +echo "Segmento de memoria: se han reservado ".$shm_size. " bytes.\n"; -// Lets write a test string into shared memory -$shm_bytes_written = shmop_write($shm_id, "my shared memory block", 0); -if($shm_bytes_written != strlen("my shared memory block")) { - echo "Couldn't write the entire length of data\n"; +// Escritura de una cadena de texto de prueba en la memoria compartida +$shm_bytes_written = shmop_write($shm_id, "mi segmento de memoria compartida", +0); +if($shm_bytes_written != strlen("mi segmento de memoria compartida")) { + echo "No se pudo escribir todos los datos indicados\n"; } -// Now lets read the string back +// Lectura de la cadena de texto de prueba $my_string = shmop_read($shm_id, 0, $shm_size); if(!$my_string) { - echo "Couldn't read from shared memory block\n"; + echo "No se pudo leer el segmento de memoria compartida\n"; } -echo "The data inside shared memory was: ".$my_string."\n"; +echo "Los datos que contenia el segmento de memoria compartida son los +siguientes:".$my_string."\n"; -//Now lets delete the block and close the shared memory segment +// Borrado y eliminacion del segmento de memoria compartida if(!shmop_delete($shm_id)) { - echo "Couldn't mark shared memory block for deletion. + echo "No se pudo borrar el segmento de memoria compartida."; } shmop_close($shm_id); -?&gt; - </programlisting> - </example> - </para> - </partintro> +?> +]]> + </programlisting> + </example> + </para> + </section> + </partintro> &reference.shmop.functions; @@ -80,5 +115,8 @@ 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 -->

« previous php.doc.es (#352) next »