PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.9.0
Defender Security – Malware Scanner, Login Security & Firewall v5.9.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 / swoole.php

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

111 lines 2.4 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\SwooleException;
6
7 /**
8 *
9 *
10 * @param string $filename The filename being written.
11 * @param string $content The content writing to the file.
12 * @param int|null $offset The offset.
13 * @param callable|null $callback
14 *
15 * @throws SwooleException
16 *
17 */
18 function swoole_async_write(string $filename, string $content, ?int $offset = null, ?callable $callback = null): void
19 {
20 error_clear_last();
21 if ($callback !== null) {
22 $result = \swoole_async_write($filename, $content, $offset, $callback);
23 } elseif ($offset !== null) {
24 $result = \swoole_async_write($filename, $content, $offset);
25 } else {
26 $result = \swoole_async_write($filename, $content);
27 }
28 if ($result === false) {
29 throw SwooleException::createFromPhpError();
30 }
31 }
32
33
34 /**
35 *
36 *
37 * @param string $filename The filename being written.
38 * @param string $content The content writing to the file.
39 * @param callable|null $callback
40 * @param int $flags
41 *
42 * @throws SwooleException
43 *
44 */
45 function swoole_async_writefile(string $filename, string $content, ?callable $callback = null, int $flags = 0): void
46 {
47 error_clear_last();
48 if ($flags !== 0) {
49 $result = \swoole_async_writefile($filename, $content, $callback, $flags);
50 } elseif ($callback !== null) {
51 $result = \swoole_async_writefile($filename, $content, $callback);
52 } else {
53 $result = \swoole_async_writefile($filename, $content);
54 }
55 if ($result === false) {
56 throw SwooleException::createFromPhpError();
57 }
58 }
59
60
61 /**
62 *
63 *
64 * @param callable $callback
65 * @throws SwooleException
66 *
67 */
68 function swoole_event_defer(callable $callback): void
69 {
70 error_clear_last();
71 $result = \swoole_event_defer($callback);
72 if ($result === false) {
73 throw SwooleException::createFromPhpError();
74 }
75 }
76
77
78 /**
79 *
80 *
81 * @param int $fd
82 * @throws SwooleException
83 *
84 */
85 function swoole_event_del(int $fd): void
86 {
87 error_clear_last();
88 $result = \swoole_event_del($fd);
89 if ($result === false) {
90 throw SwooleException::createFromPhpError();
91 }
92 }
93
94
95 /**
96 *
97 *
98 * @param int $fd
99 * @param string $data
100 * @throws SwooleException
101 *
102 */
103 function swoole_event_write(int $fd, string $data): void
104 {
105 error_clear_last();
106 $result = \swoole_event_write($fd, $data);
107 if ($result === false) {
108 throw SwooleException::createFromPhpError();
109 }
110 }
111