1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

shmop: fix XML by converting para to simpara tags via script

This commit is contained in:
Gina Peter Banyard
2026-01-26 15:26:15 +00:00
parent 6ce09e4097
commit 41d34439ea
9 changed files with 77 additions and 82 deletions

View File

@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<book xml:id="book.shmop" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.shmop">
<?phpdoc extension-membership="bundled" ?>
<title>Shared Memory</title>
<!-- {{{ preface -->
<preface xml:id="intro.shmop">
&reftitle.intro;
<para>
<simpara>
Shmop is an easy to use set of functions that allows PHP to read,
write, create and delete Unix shared memory segments.
</para>
</simpara>
</preface>
<!-- }}} -->
@@ -21,7 +20,6 @@
&reference.shmop.shmop;
</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -42,4 +40,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View File

@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="shmop.installation" xmlns="http://docbook.org/ns/docbook">
<section xmlns="http://docbook.org/ns/docbook" xml:id="shmop.installation">
&reftitle.install;
<para>
<simpara>
To use shmop you will need to compile PHP with the
<option role="configure">--enable-shmop</option> parameter in your
configure line.
</para>
</simpara>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -29,4 +28,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View File

@@ -18,9 +18,9 @@
<methodparam><type>Shmop</type><parameter>shmop</parameter></methodparam>
</methodsynopsis>
&note.resource-migration-8.0-dead-function;
<para>
<simpara>
<function>shmop_close</function> is used to close a shared memory block.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -28,19 +28,19 @@
<varlistentry>
<term><parameter>shmop</parameter></term>
<listitem>
<para>
<simpara>
The shared memory block resource created by
<function>shmop_open</function>
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.void;
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">
@@ -84,9 +84,9 @@ shmop_close($shm_id);
]]>
</programlisting>
</example>
<para>
<simpara>
This example will close shared memory block identified by <literal>$shm_id</literal>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -11,9 +11,9 @@
<type>bool</type><methodname>shmop_delete</methodname>
<methodparam><type>Shmop</type><parameter>shmop</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>shmop_delete</function> is used to delete a shared memory block.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -21,19 +21,19 @@
<varlistentry>
<term><parameter>shmop</parameter></term>
<listitem>
<para>
<simpara>
The shared memory block resource created by
<function>shmop_open</function>
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">
@@ -71,10 +71,10 @@ shmop_delete($shm_id);
]]>
</programlisting>
</example>
<para>
<simpara>
This example will delete shared memory block identified by
<literal>$shm_id</literal>.
</para>
</simpara>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View File

@@ -14,9 +14,9 @@
<methodparam><type>int</type><parameter>permissions</parameter></methodparam>
<methodparam><type>int</type><parameter>size</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>shmop_open</function> can create or open a shared memory block.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -25,10 +25,10 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
System's id for the shared memory block.
Can be passed as a decimal or hex.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
@@ -75,46 +75,46 @@
<varlistentry>
<term><parameter>permissions</parameter></term>
<listitem>
<para>
<simpara>
The permissions that you wish to assign to your memory segment, those
are the same as permission for a file. Permissions need to be passed
in octal form, like for example <literal>0644</literal>
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
<simpara>
The size of the shared memory block you wish to create in bytes
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
<note>
<para>
<simpara>
Note: the 3rd and 4th should be entered as 0 if you are opening an
existing memory segment.
</para>
</simpara>
</note>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
On success <function>shmop_open</function> will return a <classname>Shmop</classname> instance that you can
use to access the shared memory segment you've created. &false; is
returned on failure.
</para>
</simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
<simpara>
If <parameter>mode</parameter> is invalid, or <parameter>size</parameter> is less than or equal to zero,
a <classname>ValueError</classname> is thrown.
On other failures, <constant>E_WARNING</constant> is emitted.
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">
@@ -161,10 +161,10 @@ $shm_id = shmop_open($shm_key, "c", 0644, 100);
]]>
</programlisting>
</example>
<para>
<simpara>
This example opened a shared memory block with a system id returned by
<function>ftok</function>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -13,9 +13,9 @@
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
<methodparam><type>int</type><parameter>size</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>shmop_read</function> will read a string from shared memory block.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -23,47 +23,47 @@
<varlistentry>
<term><parameter>shmop</parameter></term>
<listitem>
<para>
<simpara>
The shared memory block identifier created by
<function>shmop_open</function>
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
<simpara>
Offset from which to start reading; must be greater than or equal to zero
and less than or equal to the actual size of the shared memory segment.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
<simpara>
The number of bytes to read; must be greater than or equal to zero,
and the sum of <parameter>offset</parameter> and <parameter>size</parameter>
must be less than or equal to the actual size of the shared memory segment.
<literal>0</literal> reads <code>shmop_size($shmid) - $start</code> bytes.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the data.
</para>
</simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
<simpara>
If <parameter>offset</parameter> or <parameter>size</parameter> are out of range,
a <classname>ValueError</classname> is thrown.
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">
@@ -109,10 +109,10 @@ $shm_data = shmop_read($shm_id, 0, 50);
]]>
</programlisting>
</example>
<para>
<simpara>
This example will read 50 bytes from shared memory block and place the data
inside <literal>$shm_data</literal>.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -11,10 +11,10 @@
<type>int</type><methodname>shmop_size</methodname>
<methodparam><type>Shmop</type><parameter>shmop</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>shmop_size</function> is used to get the size, in bytes of the
shared memory block.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -22,20 +22,20 @@
<varlistentry>
<term><parameter>shmop</parameter></term>
<listitem>
<para>
<simpara>
The shared memory block identifier created by
<function>shmop_open</function>
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns an int, which represents the number of bytes the shared memory
block occupies.
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">
@@ -73,10 +73,10 @@ $shm_size = shmop_size($shm_id);
]]>
</programlisting>
</example>
<para>
<simpara>
This example will put the size of shared memory block identified by
<literal>$shm_id</literal> into <literal>$shm_size</literal>.
</para>
</simpara>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View File

@@ -13,9 +13,9 @@
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>shmop_write</function> will write a string into shared memory block.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -23,45 +23,45 @@
<varlistentry>
<term><parameter>shmop</parameter></term>
<listitem>
<para>
<simpara>
The shared memory block identifier created by
<function>shmop_open</function>
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
<simpara>
A string to write into shared memory block
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
<simpara>
Specifies where to start writing data inside the shared memory
segment. The offset must be greater than or equal to zero
and less than or equal to the actual size of the shared memory segment.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The size of the written <parameter>data</parameter>.
</para>
</simpara>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
<simpara>
If <parameter>offset</parameter> is out of range, or a read-only shared memory segment
should be written to, a <classname>ValueError</classname> is thrown.
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">
@@ -105,11 +105,11 @@ $shm_bytes_written = shmop_write($shm_id, $my_string, 0);
]]>
</programlisting>
</example>
<para>
<simpara>
This example will write data inside <literal>$my_string</literal> into
shared memory block, <literal>$shm_bytes_written</literal> will contain
the number of bytes written.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<reference xml:id="class.shmop" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<reference xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="class.shmop" role="class">
<title>The Shmop class</title>
<titleabbrev>Shmop</titleabbrev>
@@ -10,9 +10,9 @@
<!-- {{{ Shmop intro -->
<section xml:id="shmop.intro">
&reftitle.intro;
<para>
<simpara>
A fully opaque class which replaces <literal>shmop</literal> resources as of PHP 8.0.0.
</para>
</simpara>
</section>
<!-- }}} -->