PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.4.0
Defender Security – Malware Scanner, Login Security & Firewall v5.4.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / thecodingmachine / safe / generated / shmop.php

shmop.php in Defender Security – Malware Scanner, Login Security & Firewall 5.4.0, at vendor/thecodingmachine/safe/generated/shmop.php

69 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\ShmopException;
6
7 /**
8 * shmop_delete is used to delete a shared memory block.
9 *
10 * @param resource $shmid The shared memory block resource created by
11 * shmop_open
12 * @throws ShmopException
13 *
14 */
15 function shmop_delete($shmid): void
16 {
17 error_clear_last();
18 $result = \shmop_delete($shmid);
19 if ($result === false) {
20 throw ShmopException::createFromPhpError();
21 }
22 }
23
24
25 /**
26 * shmop_read will read a string from shared memory block.
27 *
28 * @param resource $shmid The shared memory block identifier created by
29 * shmop_open
30 * @param int $start Offset from which to start reading
31 * @param int $count The number of bytes to read.
32 * 0 reads shmop_size($shmid) - $start bytes.
33 * @return string Returns the data.
34 * @throws ShmopException
35 *
36 */
37 function shmop_read($shmid, int $start, int $count): string
38 {
39 error_clear_last();
40 $result = \shmop_read($shmid, $start, $count);
41 if ($result === false) {
42 throw ShmopException::createFromPhpError();
43 }
44 return $result;
45 }
46
47
48 /**
49 * shmop_write will write a string into shared memory block.
50 *
51 * @param resource $shmid The shared memory block identifier created by
52 * shmop_open
53 * @param string $data A string to write into shared memory block
54 * @param int $offset Specifies where to start writing data inside the shared memory
55 * segment.
56 * @return int The size of the written data.
57 * @throws ShmopException
58 *
59 */
60 function shmop_write($shmid, string $data, int $offset): int
61 {
62 error_clear_last();
63 $result = \shmop_write($shmid, $data, $offset);
64 if ($result === false) {
65 throw ShmopException::createFromPhpError();
66 }
67 return $result;
68 }
69