diff --git a/reference/shmop/book.xml b/reference/shmop/book.xml index 0b5b84fd1ae6..20336bc20108 100644 --- a/reference/shmop/book.xml +++ b/reference/shmop/book.xml @@ -1,17 +1,16 @@ - - + Shared Memory &reftitle.intro; - + Shmop is an easy to use set of functions that allows PHP to read, write, create and delete Unix shared memory segments. - + @@ -21,7 +20,6 @@ &reference.shmop.shmop; - - diff --git a/reference/shmop/configure.xml b/reference/shmop/configure.xml index b964ebf65637..3eb40084b67d 100644 --- a/reference/shmop/configure.xml +++ b/reference/shmop/configure.xml @@ -1,14 +1,13 @@ -
+
&reftitle.install; - + To use shmop you will need to compile PHP with the parameter in your configure line. - +
- - diff --git a/reference/shmop/examples.xml b/reference/shmop/examples.xml index 9b5d487d538e..16ea41ea40bb 100644 --- a/reference/shmop/examples.xml +++ b/reference/shmop/examples.xml @@ -1,17 +1,15 @@ - - + &reftitle.examples;
Basic usage - - - Shared Memory Operations Overview - + + Shared Memory Operations Overview + ]]> - - - + +
- - diff --git a/reference/shmop/functions/shmop-close.xml b/reference/shmop/functions/shmop-close.xml index 520b48c44a26..3474659e4782 100644 --- a/reference/shmop/functions/shmop-close.xml +++ b/reference/shmop/functions/shmop-close.xml @@ -1,6 +1,6 @@ - + shmop_close Close shared memory block @@ -18,31 +18,29 @@ Shmopshmop ¬e.resource-migration-8.0-dead-function; - + shmop_close is used to close a shared memory block. - + &reftitle.parameters; - - - - shmop - - - The shared memory block resource created by - shmop_open - - - - - + + + shmop + + + The shared memory block resource created by + shmop_open + + + + &reftitle.returnvalues; - + &return.void; - + @@ -76,29 +74,25 @@ &reftitle.examples; - - - Closing shared memory block - + + Closing shared memory block + ]]> - - - - + + + This example will close shared memory block identified by $shm_id. - + &reftitle.seealso; - - - shmop_open - - + + shmop_open + - + shmop_delete Delete shared memory block @@ -11,31 +11,29 @@ boolshmop_delete Shmopshmop - + shmop_delete is used to delete a shared memory block. - + &reftitle.parameters; - - - - shmop - - - The shared memory block resource created by - shmop_open - - - - - + + + shmop + + + The shared memory block resource created by + shmop_open + + + + &reftitle.returnvalues; - + &return.success; - + @@ -63,22 +61,20 @@ &reftitle.examples; - - - Deleting shared memory block - + + Deleting shared memory block + ]]> - - - - + + + This example will delete shared memory block identified by $shm_id. - + - + shmop_open Create or open shared memory block @@ -14,9 +14,9 @@ intpermissions intsize - + shmop_open can create or open a shared memory block. - + &reftitle.parameters; @@ -25,10 +25,10 @@ key - + System's id for the shared memory block. Can be passed as a decimal or hex. - + @@ -75,46 +75,46 @@ permissions - + 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 0644 - + size - + The size of the shared memory block you wish to create in bytes - + - + Note: the 3rd and 4th should be entered as 0 if you are opening an existing memory segment. - + &reftitle.returnvalues; - + On success shmop_open will return a Shmop instance that you can use to access the shared memory segment you've created. &false; is returned on failure. - + &reftitle.errors; - + If mode is invalid, or size is less than or equal to zero, a ValueError is thrown. On other failures, E_WARNING is emitted. - + @@ -150,32 +150,28 @@ &reftitle.examples; - - - Create a new shared memory block - + + Create a new shared memory block + ]]> - - - - + + + This example opened a shared memory block with a system id returned by ftok. - + &reftitle.seealso; - - - shmop_close - shmop_delete - - + + shmop_close + shmop_delete + - + shmop_read Read data from shared memory block @@ -13,59 +13,57 @@ intoffset intsize - + shmop_read will read a string from shared memory block. - + &reftitle.parameters; - - - - shmop - - - The shared memory block identifier created by - shmop_open - - - - - offset - - - 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. - - - - - size - - - The number of bytes to read; must be greater than or equal to zero, - and the sum of offset and size - must be less than or equal to the actual size of the shared memory segment. - 0 reads shmop_size($shmid) - $start bytes. - - - - - + + + shmop + + + The shared memory block identifier created by + shmop_open + + + + + offset + + + 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. + + + + + size + + + The number of bytes to read; must be greater than or equal to zero, + and the sum of offset and size + must be less than or equal to the actual size of the shared memory segment. + 0 reads shmop_size($shmid) - $start bytes. + + + + &reftitle.returnvalues; - + Returns the data. - + &reftitle.errors; - + If offset or size are out of range, a ValueError is thrown. - + @@ -101,30 +99,26 @@ &reftitle.examples; - - - Reading shared memory block - + + Reading shared memory block + ]]> - - - - + + + This example will read 50 bytes from shared memory block and place the data inside $shm_data. - + &reftitle.seealso; - - - shmop_write - - + + shmop_write + - + shmop_size Get size of shared memory block @@ -11,33 +11,31 @@ intshmop_size Shmopshmop - + shmop_size is used to get the size, in bytes of the shared memory block. - + &reftitle.parameters; - - - - shmop - - - The shared memory block identifier created by - shmop_open - - - - - + + + shmop + + + The shared memory block identifier created by + shmop_open + + + + &reftitle.returnvalues; - + Returns an int, which represents the number of bytes the shared memory block occupies. - + @@ -65,22 +63,20 @@ &reftitle.examples; - - - Getting the size of the shared memory block - + + Getting the size of the shared memory block + ]]> - - - - + + + This example will put the size of shared memory block identified by $shm_id into $shm_size. - + - + shmop_write Write data into shared memory block @@ -13,57 +13,55 @@ stringdata intoffset - + shmop_write will write a string into shared memory block. - + &reftitle.parameters; - - - - shmop - - - The shared memory block identifier created by - shmop_open - - - - - data - - - A string to write into shared memory block - - - - - offset - - - 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. - - - - - + + + shmop + + + The shared memory block identifier created by + shmop_open + + + + + data + + + A string to write into shared memory block + + + + + offset + + + 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. + + + + &reftitle.returnvalues; - + The size of the written data. - + &reftitle.errors; - + If offset is out of range, or a read-only shared memory segment should be written to, a ValueError is thrown. - + @@ -97,31 +95,27 @@ &reftitle.examples; - - - Writing to shared memory block - + + Writing to shared memory block + ]]> - - - - + + + This example will write data inside $my_string into shared memory block, $shm_bytes_written will contain the number of bytes written. - + &reftitle.seealso; - - - shmop_read - - + + shmop_read + - + The Shmop class Shmop @@ -10,9 +10,9 @@
&reftitle.intro; - + A fully opaque class which replaces shmop resources as of PHP 8.0.0. - +