PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.6.1
Defender Security – Malware Scanner, Login Security & Firewall v5.6.1
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.6.1, at vendor/thecodingmachine/safe/generated/swoole.php

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