@@ -194,57 +194,57 @@ discard block |
||
194 | 194 | */ |
195 | 195 | class RRDCreator |
196 | 196 | { |
197 | - /** |
|
198 | - * Adds RRA - archive of data values for each data source. <p> |
|
199 | - * Archive consists of a number of data values or statistics for each of the defined data-sources (DS). Data sources are defined by method RRDCreator::addDataSource(). You need call this method for each requested archive. |
|
200 | - * </p> |
|
201 | - * @link https://php.net/manual/en/rrdcreator.addarchive.php |
|
202 | - * @see RRDCreator::addDataSource() |
|
203 | - * @param string $description <p> |
|
204 | - * Class for creation of RRD database file. |
|
205 | - * </p> |
|
206 | - * @return void |
|
207 | - * @since PECL rrd >= 0.9.0 |
|
208 | - */ |
|
209 | - public function addArchive($description) {} |
|
197 | + /** |
|
198 | + * Adds RRA - archive of data values for each data source. <p> |
|
199 | + * Archive consists of a number of data values or statistics for each of the defined data-sources (DS). Data sources are defined by method RRDCreator::addDataSource(). You need call this method for each requested archive. |
|
200 | + * </p> |
|
201 | + * @link https://php.net/manual/en/rrdcreator.addarchive.php |
|
202 | + * @see RRDCreator::addDataSource() |
|
203 | + * @param string $description <p> |
|
204 | + * Class for creation of RRD database file. |
|
205 | + * </p> |
|
206 | + * @return void |
|
207 | + * @since PECL rrd >= 0.9.0 |
|
208 | + */ |
|
209 | + public function addArchive($description) {} |
|
210 | 210 | |
211 | - /** |
|
212 | - * Adds data source definition for RRD database.<p> |
|
213 | - * RRD can accept input from several data sources (DS), e.g incoming and outgoing traffic. This method adds data source by description. You need call this method for each data source. |
|
214 | - * </p> |
|
215 | - * @link https://php.net/manual/en/rrdcreator.adddatasource.php |
|
216 | - * @param string $description <p> |
|
217 | - * Definition of data source - DS. This has same format as DS definition in rrd create command. See man page of rrd create for more details. |
|
218 | - * </p> |
|
219 | - * @return void |
|
220 | - * @since PECL rrd >= 0.9.0 |
|
221 | - */ |
|
222 | - public function addDataSource($description) {} |
|
211 | + /** |
|
212 | + * Adds data source definition for RRD database.<p> |
|
213 | + * RRD can accept input from several data sources (DS), e.g incoming and outgoing traffic. This method adds data source by description. You need call this method for each data source. |
|
214 | + * </p> |
|
215 | + * @link https://php.net/manual/en/rrdcreator.adddatasource.php |
|
216 | + * @param string $description <p> |
|
217 | + * Definition of data source - DS. This has same format as DS definition in rrd create command. See man page of rrd create for more details. |
|
218 | + * </p> |
|
219 | + * @return void |
|
220 | + * @since PECL rrd >= 0.9.0 |
|
221 | + */ |
|
222 | + public function addDataSource($description) {} |
|
223 | 223 | |
224 | - /** |
|
225 | - * Creates new RRDCreator instance. |
|
226 | - * @link https://php.net/manual/en/rrdcreator.construct.php |
|
227 | - * @param string $path <p> |
|
228 | - * Path for newly created RRD database file. |
|
229 | - * </p> |
|
230 | - * @param string $startTime <p> |
|
231 | - * Time for the first value in RRD database. Parameter supports all formats which are supported by rrd create call. |
|
232 | - * </p> |
|
233 | - * @param int $step <p> |
|
234 | - * Base interval in seconds with which data will be fed into the RRD database. |
|
235 | - * </p> |
|
236 | - * @since PECL rrd >= 0.9.0 |
|
237 | - */ |
|
238 | - public function __construct($path, $startTime = '', $step = 0) {} |
|
224 | + /** |
|
225 | + * Creates new RRDCreator instance. |
|
226 | + * @link https://php.net/manual/en/rrdcreator.construct.php |
|
227 | + * @param string $path <p> |
|
228 | + * Path for newly created RRD database file. |
|
229 | + * </p> |
|
230 | + * @param string $startTime <p> |
|
231 | + * Time for the first value in RRD database. Parameter supports all formats which are supported by rrd create call. |
|
232 | + * </p> |
|
233 | + * @param int $step <p> |
|
234 | + * Base interval in seconds with which data will be fed into the RRD database. |
|
235 | + * </p> |
|
236 | + * @since PECL rrd >= 0.9.0 |
|
237 | + */ |
|
238 | + public function __construct($path, $startTime = '', $step = 0) {} |
|
239 | 239 | |
240 | - /** |
|
241 | - * Saves the RRD database into file, which name is defined by RRDCreator::__construct() |
|
242 | - * @link https://php.net/manual/en/rrdcreator.save.php |
|
243 | - * @see RRDCreator::__construct() |
|
244 | - * @return bool TRUE on success or FALSE on failure. |
|
245 | - * @since PECL rrd >= 0.9.0 |
|
246 | - */ |
|
247 | - public function save() {} |
|
240 | + /** |
|
241 | + * Saves the RRD database into file, which name is defined by RRDCreator::__construct() |
|
242 | + * @link https://php.net/manual/en/rrdcreator.save.php |
|
243 | + * @see RRDCreator::__construct() |
|
244 | + * @return bool TRUE on success or FALSE on failure. |
|
245 | + * @since PECL rrd >= 0.9.0 |
|
246 | + */ |
|
247 | + public function save() {} |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -254,44 +254,44 @@ discard block |
||
254 | 254 | */ |
255 | 255 | class RRDGraph |
256 | 256 | { |
257 | - /** |
|
258 | - * Creates new RRDGraph instance. This instance is responsible for rendering the result of RRD database query into image. |
|
259 | - * @link https://php.net/manual/en/rrdgraph.construct.php |
|
260 | - * @param string $path <p> |
|
261 | - * Full path for the newly created image. |
|
262 | - * </p> |
|
263 | - * @since PECL rrd >= 0.9.0 |
|
264 | - */ |
|
265 | - public function __construct($path) {} |
|
257 | + /** |
|
258 | + * Creates new RRDGraph instance. This instance is responsible for rendering the result of RRD database query into image. |
|
259 | + * @link https://php.net/manual/en/rrdgraph.construct.php |
|
260 | + * @param string $path <p> |
|
261 | + * Full path for the newly created image. |
|
262 | + * </p> |
|
263 | + * @since PECL rrd >= 0.9.0 |
|
264 | + */ |
|
265 | + public function __construct($path) {} |
|
266 | 266 | |
267 | - /** |
|
268 | - * Saves the result of RRD database query into image defined by RRDGraph::__construct(). |
|
269 | - * @link https://php.net/manual/en/rrdgraph.save.php |
|
270 | - * @return array|false Array with information about generated image is returned, FALSE if error occurs. |
|
271 | - * @since PECL rrd >= 0.9.0 |
|
272 | - */ |
|
273 | - public function save() {} |
|
267 | + /** |
|
268 | + * Saves the result of RRD database query into image defined by RRDGraph::__construct(). |
|
269 | + * @link https://php.net/manual/en/rrdgraph.save.php |
|
270 | + * @return array|false Array with information about generated image is returned, FALSE if error occurs. |
|
271 | + * @since PECL rrd >= 0.9.0 |
|
272 | + */ |
|
273 | + public function save() {} |
|
274 | 274 | |
275 | - /** |
|
276 | - * Saves the RRD database query into image and returns the verbose information about generated graph. <p> |
|
277 | - * If "-" is used as image filename, image data are also returned in result array. |
|
278 | - * </p> |
|
279 | - * @link https://php.net/manual/en/rrdgraph.saveverbose.php |
|
280 | - * @return array|false Array with detailed information about generated image is returned, optionally with image data, FALSE if error occurs. |
|
281 | - * @since PECL rrd >= 0.9.0 |
|
282 | - */ |
|
283 | - public function saveVerbose() {} |
|
275 | + /** |
|
276 | + * Saves the RRD database query into image and returns the verbose information about generated graph. <p> |
|
277 | + * If "-" is used as image filename, image data are also returned in result array. |
|
278 | + * </p> |
|
279 | + * @link https://php.net/manual/en/rrdgraph.saveverbose.php |
|
280 | + * @return array|false Array with detailed information about generated image is returned, optionally with image data, FALSE if error occurs. |
|
281 | + * @since PECL rrd >= 0.9.0 |
|
282 | + */ |
|
283 | + public function saveVerbose() {} |
|
284 | 284 | |
285 | - /** |
|
286 | - * Sets the options for rrd graph export |
|
287 | - * @link https://php.net/manual/en/rrdgraph.setoptions.php |
|
288 | - * @param array $options <p> |
|
289 | - * List of options for the image generation from the RRD database file. It can be list of strings or list of strings with keys for better readability. Read the rrd graph man pages for list of available options. |
|
290 | - * </p> |
|
291 | - * @return void |
|
292 | - * @since PECL rrd >= 0.9.0 |
|
293 | - */ |
|
294 | - public function setOptions($options) {} |
|
285 | + /** |
|
286 | + * Sets the options for rrd graph export |
|
287 | + * @link https://php.net/manual/en/rrdgraph.setoptions.php |
|
288 | + * @param array $options <p> |
|
289 | + * List of options for the image generation from the RRD database file. It can be list of strings or list of strings with keys for better readability. Read the rrd graph man pages for list of available options. |
|
290 | + * </p> |
|
291 | + * @return void |
|
292 | + * @since PECL rrd >= 0.9.0 |
|
293 | + */ |
|
294 | + public function setOptions($options) {} |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -301,31 +301,31 @@ discard block |
||
301 | 301 | */ |
302 | 302 | class RRDUpdater |
303 | 303 | { |
304 | - /** |
|
305 | - * Creates new RRDUpdater instance. This instance is responsible for updating the RRD database file. |
|
306 | - * RRDUpdater constructor. |
|
307 | - * @link https://php.net/manual/en/rrdupdater.construct.php |
|
308 | - * @param string $path <p> |
|
309 | - * Filesystem path for RRD database file, which will be updated. |
|
310 | - * </p> |
|
311 | - * @since PECL rrd >= 0.9.0 |
|
312 | - */ |
|
313 | - public function __construct($path) {} |
|
304 | + /** |
|
305 | + * Creates new RRDUpdater instance. This instance is responsible for updating the RRD database file. |
|
306 | + * RRDUpdater constructor. |
|
307 | + * @link https://php.net/manual/en/rrdupdater.construct.php |
|
308 | + * @param string $path <p> |
|
309 | + * Filesystem path for RRD database file, which will be updated. |
|
310 | + * </p> |
|
311 | + * @since PECL rrd >= 0.9.0 |
|
312 | + */ |
|
313 | + public function __construct($path) {} |
|
314 | 314 | |
315 | - /** |
|
316 | - * Update the RRD file defined via RRDUpdater::__construct(). The file is updated with a specific values. |
|
317 | - * @link https://php.net/manual/en/rrdupdater.update.php |
|
318 | - * @param array $values <p> |
|
319 | - * Data for update. Key is data source name. |
|
320 | - * </p> |
|
321 | - * @param string $time <p> |
|
322 | - * Time value for updating the RRD with a particulat data. Default value is current time. |
|
323 | - * </p> |
|
324 | - * @return bool TRUE on success or FALSE on failure. |
|
325 | - * @throws \Exception on error |
|
326 | - * @since PECL rrd >= 0.9.0 |
|
327 | - */ |
|
328 | - public function update($values, $time = '') {} |
|
315 | + /** |
|
316 | + * Update the RRD file defined via RRDUpdater::__construct(). The file is updated with a specific values. |
|
317 | + * @link https://php.net/manual/en/rrdupdater.update.php |
|
318 | + * @param array $values <p> |
|
319 | + * Data for update. Key is data source name. |
|
320 | + * </p> |
|
321 | + * @param string $time <p> |
|
322 | + * Time value for updating the RRD with a particulat data. Default value is current time. |
|
323 | + * </p> |
|
324 | + * @return bool TRUE on success or FALSE on failure. |
|
325 | + * @throws \Exception on error |
|
326 | + * @since PECL rrd >= 0.9.0 |
|
327 | + */ |
|
328 | + public function update($values, $time = '') {} |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | // end of PECL/rrd v1.0 |
@@ -192,8 +192,7 @@ discard block |
||
192 | 192 | * @link https://php.net/manual/en/class.rrdcreator.php |
193 | 193 | * @since PECL rrd >= 0.9.0 |
194 | 194 | */ |
195 | -class RRDCreator |
|
196 | -{ |
|
195 | +class RRDCreator { |
|
197 | 196 | /** |
198 | 197 | * Adds RRA - archive of data values for each data source. <p> |
199 | 198 | * Archive consists of a number of data values or statistics for each of the defined data-sources (DS). Data sources are defined by method RRDCreator::addDataSource(). You need call this method for each requested archive. |
@@ -252,8 +251,7 @@ discard block |
||
252 | 251 | * @link https://php.net/manual/en/class.rrdgraph.php |
253 | 252 | * @since PECL rrd >= 0.9.0 |
254 | 253 | */ |
255 | -class RRDGraph |
|
256 | -{ |
|
254 | +class RRDGraph { |
|
257 | 255 | /** |
258 | 256 | * Creates new RRDGraph instance. This instance is responsible for rendering the result of RRD database query into image. |
259 | 257 | * @link https://php.net/manual/en/rrdgraph.construct.php |
@@ -299,8 +297,7 @@ discard block |
||
299 | 297 | * @link https://php.net/manual/en/class.rrdupdater.php |
300 | 298 | * @since PECL rrd >= 0.9.0 |
301 | 299 | */ |
302 | -class RRDUpdater |
|
303 | -{ |
|
300 | +class RRDUpdater { |
|
304 | 301 | /** |
305 | 302 | * Creates new RRDUpdater instance. This instance is responsible for updating the RRD database file. |
306 | 303 | * RRDUpdater constructor. |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class PDOException extends RuntimeException |
18 | 18 | { |
19 | - #[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')] |
|
20 | - public $errorInfo; |
|
19 | + #[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')] |
|
20 | + public $errorInfo; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
@@ -26,1258 +26,1258 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class PDO |
28 | 28 | { |
29 | - /** |
|
30 | - * Represents a boolean data type. |
|
31 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-bool |
|
32 | - */ |
|
33 | - public const PARAM_BOOL = 1; |
|
34 | - |
|
35 | - /** |
|
36 | - * Represents the SQL NULL data type. |
|
37 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-null |
|
38 | - */ |
|
39 | - public const PARAM_NULL = 0; |
|
40 | - |
|
41 | - /** |
|
42 | - * Represents the SQL INTEGER data type. |
|
43 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-int |
|
44 | - */ |
|
45 | - public const PARAM_INT = 2; |
|
46 | - |
|
47 | - /** |
|
48 | - * Represents the SQL CHAR, VARCHAR, or other string data type. |
|
49 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str |
|
50 | - */ |
|
51 | - public const PARAM_STR = 3; |
|
52 | - |
|
53 | - /** |
|
54 | - * Flag to denote a string uses the national character set. |
|
55 | - * @since 7.2 |
|
56 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str-natl |
|
57 | - */ |
|
58 | - public const PARAM_STR_NATL = 1073741824; |
|
59 | - |
|
60 | - /** |
|
61 | - * Flag to denote a string uses the regular character set. |
|
62 | - * @since 7.2 |
|
63 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str-char |
|
64 | - */ |
|
65 | - public const PARAM_STR_CHAR = 536870912; |
|
66 | - |
|
67 | - /** |
|
68 | - * Sets the default string parameter type, this can be one of PDO::PARAM_STR_NATL and PDO::PARAM_STR_CHAR. |
|
69 | - * @since 7.2 |
|
70 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-default-str-param |
|
71 | - */ |
|
72 | - public const ATTR_DEFAULT_STR_PARAM = 21; |
|
73 | - |
|
74 | - /** |
|
75 | - * Specifies that a function created with PDO::sqliteCreateFunction() is deterministic, i.e. it always returns the same result given the same inputs within a single SQL statement. |
|
76 | - * @since 7.1.4 |
|
77 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.sqlite-deterministic |
|
78 | - */ |
|
79 | - public const SQLITE_DETERMINISTIC = 2048; |
|
80 | - |
|
81 | - /** |
|
82 | - * @since 7.3 |
|
83 | - */ |
|
84 | - public const SQLITE_OPEN_READONLY = 1; |
|
85 | - |
|
86 | - /** |
|
87 | - * @since 7.3 |
|
88 | - */ |
|
89 | - public const SQLITE_OPEN_READWRITE = 2; |
|
90 | - |
|
91 | - /** |
|
92 | - * @since 7.3 |
|
93 | - */ |
|
94 | - public const SQLITE_OPEN_CREATE = 4; |
|
95 | - |
|
96 | - /** |
|
97 | - * @since 7.3 |
|
98 | - */ |
|
99 | - public const SQLITE_ATTR_OPEN_FLAGS = 1000; |
|
100 | - |
|
101 | - /** |
|
102 | - * Represents the SQL large object data type. |
|
103 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-lob |
|
104 | - */ |
|
105 | - public const PARAM_LOB = 4; |
|
106 | - |
|
107 | - /** |
|
108 | - * Represents a recordset type. Not currently supported by any drivers. |
|
109 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-stmt |
|
110 | - */ |
|
111 | - public const PARAM_STMT = 5; |
|
112 | - |
|
113 | - /** |
|
114 | - * Specifies that the parameter is an INOUT parameter for a stored |
|
115 | - * procedure. You must bitwise-OR this value with an explicit |
|
116 | - * PDO::PARAM_* data type. |
|
117 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-input-output |
|
118 | - */ |
|
119 | - public const PARAM_INPUT_OUTPUT = 2147483648; |
|
120 | - |
|
121 | - /** |
|
122 | - * Allocation event |
|
123 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-alloc |
|
124 | - */ |
|
125 | - public const PARAM_EVT_ALLOC = 0; |
|
126 | - |
|
127 | - /** |
|
128 | - * Deallocation event |
|
129 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-free |
|
130 | - */ |
|
131 | - public const PARAM_EVT_FREE = 1; |
|
132 | - |
|
133 | - /** |
|
134 | - * Event triggered prior to execution of a prepared statement. |
|
135 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-exec-pre |
|
136 | - */ |
|
137 | - public const PARAM_EVT_EXEC_PRE = 2; |
|
138 | - |
|
139 | - /** |
|
140 | - * Event triggered subsequent to execution of a prepared statement. |
|
141 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-exec-post |
|
142 | - */ |
|
143 | - public const PARAM_EVT_EXEC_POST = 3; |
|
144 | - |
|
145 | - /** |
|
146 | - * Event triggered prior to fetching a result from a resultset. |
|
147 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-fetch-pre |
|
148 | - */ |
|
149 | - public const PARAM_EVT_FETCH_PRE = 4; |
|
150 | - |
|
151 | - /** |
|
152 | - * Event triggered subsequent to fetching a result from a resultset. |
|
153 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-fetch-post |
|
154 | - */ |
|
155 | - public const PARAM_EVT_FETCH_POST = 5; |
|
156 | - |
|
157 | - /** |
|
158 | - * Event triggered during bound parameter registration |
|
159 | - * allowing the driver to normalize the parameter name. |
|
160 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-normalize |
|
161 | - */ |
|
162 | - public const PARAM_EVT_NORMALIZE = 6; |
|
163 | - |
|
164 | - /** |
|
165 | - * Specifies that the fetch method shall return each row as an object with |
|
166 | - * variable names that correspond to the column names returned in the result |
|
167 | - * set. <b>PDO::FETCH_LAZY</b> creates the object variable names as they are accessed. |
|
168 | - * Not valid inside <b>PDOStatement::fetchAll</b>. |
|
169 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-lazy |
|
170 | - */ |
|
171 | - public const FETCH_LAZY = 1; |
|
172 | - |
|
173 | - /** |
|
174 | - * Specifies that the fetch method shall return each row as an array indexed |
|
175 | - * by column name as returned in the corresponding result set. If the result |
|
176 | - * set contains multiple columns with the same name, |
|
177 | - * <b>PDO::FETCH_ASSOC</b> returns |
|
178 | - * only a single value per column name. |
|
179 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-assoc |
|
180 | - */ |
|
181 | - public const FETCH_ASSOC = 2; |
|
182 | - |
|
183 | - /** |
|
184 | - * Specifies that the fetch method shall return each row as an array indexed |
|
185 | - * by column number as returned in the corresponding result set, starting at |
|
186 | - * column 0. |
|
187 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-num |
|
188 | - */ |
|
189 | - public const FETCH_NUM = 3; |
|
190 | - |
|
191 | - /** |
|
192 | - * Specifies that the fetch method shall return each row as an array indexed |
|
193 | - * by both column name and number as returned in the corresponding result set, |
|
194 | - * starting at column 0. |
|
195 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-both |
|
196 | - */ |
|
197 | - public const FETCH_BOTH = 4; |
|
198 | - |
|
199 | - /** |
|
200 | - * Specifies that the fetch method shall return each row as an object with |
|
201 | - * property names that correspond to the column names returned in the result |
|
202 | - * set. |
|
203 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-obj |
|
204 | - */ |
|
205 | - public const FETCH_OBJ = 5; |
|
206 | - |
|
207 | - /** |
|
208 | - * Specifies that the fetch method shall return TRUE and assign the values of |
|
209 | - * the columns in the result set to the PHP variables to which they were |
|
210 | - * bound with the <b>PDOStatement::bindParam</b> or |
|
211 | - * <b>PDOStatement::bindColumn</b> methods. |
|
212 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-bound |
|
213 | - */ |
|
214 | - public const FETCH_BOUND = 6; |
|
215 | - |
|
216 | - /** |
|
217 | - * Specifies that the fetch method shall return only a single requested |
|
218 | - * column from the next row in the result set. |
|
219 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-column |
|
220 | - */ |
|
221 | - public const FETCH_COLUMN = 7; |
|
222 | - |
|
223 | - /** |
|
224 | - * Specifies that the fetch method shall return a new instance of the |
|
225 | - * requested class, mapping the columns to named properties in the class. |
|
226 | - * The magic |
|
227 | - * <b>__set</b> |
|
228 | - * method is called if the property doesn't exist in the requested class |
|
229 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-class |
|
230 | - */ |
|
231 | - public const FETCH_CLASS = 8; |
|
232 | - |
|
233 | - /** |
|
234 | - * Specifies that the fetch method shall update an existing instance of the |
|
235 | - * requested class, mapping the columns to named properties in the class. |
|
236 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-into |
|
237 | - */ |
|
238 | - public const FETCH_INTO = 9; |
|
239 | - |
|
240 | - /** |
|
241 | - * Allows completely customize the way data is treated on the fly (only |
|
242 | - * valid inside <b>PDOStatement::fetchAll</b>). |
|
243 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-func |
|
244 | - */ |
|
245 | - public const FETCH_FUNC = 10; |
|
246 | - |
|
247 | - /** |
|
248 | - * Group return by values. Usually combined with |
|
249 | - * <b>PDO::FETCH_COLUMN</b> or |
|
250 | - * <b>PDO::FETCH_KEY_PAIR</b>. |
|
251 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-group |
|
252 | - */ |
|
253 | - public const FETCH_GROUP = 65536; |
|
254 | - |
|
255 | - /** |
|
256 | - * Fetch only the unique values. |
|
257 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-unique |
|
258 | - */ |
|
259 | - public const FETCH_UNIQUE = 196608; |
|
260 | - |
|
261 | - /** |
|
262 | - * Fetch a two-column result into an array where the first column is a key and the second column |
|
263 | - * is the value. |
|
264 | - * @since 5.2.3 |
|
265 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-key-pair |
|
266 | - */ |
|
267 | - public const FETCH_KEY_PAIR = 12; |
|
268 | - |
|
269 | - /** |
|
270 | - * Determine the class name from the value of first column. |
|
271 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-classtype |
|
272 | - */ |
|
273 | - public const FETCH_CLASSTYPE = 262144; |
|
274 | - |
|
275 | - /** |
|
276 | - * As <b>PDO::FETCH_INTO</b> but object is provided as a serialized string. |
|
277 | - * Available since PHP 5.1.0. Since PHP 5.3.0 the class constructor is never called if this |
|
278 | - * flag is set. |
|
279 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-serialize |
|
280 | - */ |
|
281 | - public const FETCH_SERIALIZE = 524288; |
|
282 | - |
|
283 | - /** |
|
284 | - * Call the constructor before setting properties. |
|
285 | - * @since 5.2.0 |
|
286 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-props-late |
|
287 | - */ |
|
288 | - public const FETCH_PROPS_LATE = 1048576; |
|
289 | - |
|
290 | - /** |
|
291 | - * Specifies that the fetch method shall return each row as an array indexed |
|
292 | - * by column name as returned in the corresponding result set. If the result |
|
293 | - * set contains multiple columns with the same name, |
|
294 | - * <b>PDO::FETCH_NAMED</b> returns |
|
295 | - * an array of values per column name. |
|
296 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-named |
|
297 | - */ |
|
298 | - public const FETCH_NAMED = 11; |
|
299 | - |
|
300 | - /** |
|
301 | - * If this value is <b>FALSE</b>, PDO attempts to disable autocommit so that the |
|
302 | - * connection begins a transaction. |
|
303 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-autocommit |
|
304 | - */ |
|
305 | - public const ATTR_AUTOCOMMIT = 0; |
|
306 | - |
|
307 | - /** |
|
308 | - * Setting the prefetch size allows you to balance speed against memory |
|
309 | - * usage for your application. Not all database/driver combinations support |
|
310 | - * setting of the prefetch size. A larger prefetch size results in |
|
311 | - * increased performance at the cost of higher memory usage. |
|
312 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-prefetch |
|
313 | - */ |
|
314 | - public const ATTR_PREFETCH = 1; |
|
315 | - |
|
316 | - /** |
|
317 | - * Sets the timeout value in seconds for communications with the database. |
|
318 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-timeout |
|
319 | - */ |
|
320 | - public const ATTR_TIMEOUT = 2; |
|
321 | - |
|
322 | - /** |
|
323 | - * @see https://php.net/manual/en/pdo.error-handling.php Errors and error handling |
|
324 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-errmode |
|
325 | - */ |
|
326 | - public const ATTR_ERRMODE = 3; |
|
327 | - |
|
328 | - /** |
|
329 | - * This is a read only attribute; it will return information about the |
|
330 | - * version of the database server to which PDO is connected. |
|
331 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr- |
|
332 | - */ |
|
333 | - public const ATTR_SERVER_VERSION = 4; |
|
334 | - |
|
335 | - /** |
|
336 | - * This is a read only attribute; it will return information about the |
|
337 | - * version of the client libraries that the PDO driver is using. |
|
338 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-client-version |
|
339 | - */ |
|
340 | - public const ATTR_CLIENT_VERSION = 5; |
|
341 | - |
|
342 | - /** |
|
343 | - * This is a read only attribute; it will return some meta information about the |
|
344 | - * database server to which PDO is connected. |
|
345 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-server-info |
|
346 | - */ |
|
347 | - public const ATTR_SERVER_INFO = 6; |
|
348 | - public const ATTR_CONNECTION_STATUS = 7; |
|
349 | - |
|
350 | - /** |
|
351 | - * Force column names to a specific case specified by the PDO::CASE_* |
|
352 | - * constants. |
|
353 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-case |
|
354 | - */ |
|
355 | - public const ATTR_CASE = 8; |
|
356 | - |
|
357 | - /** |
|
358 | - * Get or set the name to use for a cursor. Most useful when using |
|
359 | - * scrollable cursors and positioned updates. |
|
360 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-cursor-name |
|
361 | - */ |
|
362 | - public const ATTR_CURSOR_NAME = 9; |
|
363 | - |
|
364 | - /** |
|
365 | - * Selects the cursor type. PDO currently supports either |
|
366 | - * <b>PDO::CURSOR_FWDONLY</b> and |
|
367 | - * <b>PDO::CURSOR_SCROLL</b>. Stick with |
|
368 | - * <b>PDO::CURSOR_FWDONLY</b> unless you know that you need a |
|
369 | - * scrollable cursor. |
|
370 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-cursor |
|
371 | - */ |
|
372 | - public const ATTR_CURSOR = 10; |
|
373 | - |
|
374 | - /** |
|
375 | - * Convert empty strings to SQL NULL values on data fetches. |
|
376 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-oracle-nulls |
|
377 | - */ |
|
378 | - public const ATTR_ORACLE_NULLS = 11; |
|
379 | - |
|
380 | - /** |
|
381 | - * Request a persistent connection, rather than creating a new connection. |
|
382 | - * @see https://php.net/manual/en/pdo.connections.php Connections and Connection Management |
|
383 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-persistent |
|
384 | - */ |
|
385 | - public const ATTR_PERSISTENT = 12; |
|
386 | - |
|
387 | - /** |
|
388 | - * Sets the class name of which statements are returned as. |
|
389 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-statement-class |
|
390 | - */ |
|
391 | - public const ATTR_STATEMENT_CLASS = 13; |
|
392 | - |
|
393 | - /** |
|
394 | - * Prepend the containing table name to each column name returned in the |
|
395 | - * result set. The table name and column name are separated by a decimal (.) |
|
396 | - * character. Support of this attribute is at the driver level; it may not |
|
397 | - * be supported by your driver. |
|
398 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-table-names |
|
399 | - */ |
|
400 | - public const ATTR_FETCH_TABLE_NAMES = 14; |
|
401 | - |
|
402 | - /** |
|
403 | - * Prepend the containing catalog name to each column name returned in the |
|
404 | - * result set. The catalog name and column name are separated by a decimal |
|
405 | - * (.) character. Support of this attribute is at the driver level; it may |
|
406 | - * not be supported by your driver. |
|
407 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-catalog-names |
|
408 | - */ |
|
409 | - public const ATTR_FETCH_CATALOG_NAMES = 15; |
|
410 | - |
|
411 | - /** |
|
412 | - * Returns the name of the driver. |
|
413 | - * <p> |
|
414 | - * using <b>PDO::ATTR_DRIVER_NAME</b> |
|
415 | - * <code> |
|
416 | - * if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { |
|
417 | - * echo "Running on mysql; doing something mysql specific here\n"; |
|
418 | - * } |
|
419 | - * </code> |
|
420 | - * </p> |
|
421 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-driver-name |
|
422 | - */ |
|
423 | - public const ATTR_DRIVER_NAME = 16; |
|
424 | - |
|
425 | - /** |
|
426 | - * Forces all values fetched to be treated as strings. |
|
427 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-stringify-fetches |
|
428 | - */ |
|
429 | - public const ATTR_STRINGIFY_FETCHES = 17; |
|
430 | - |
|
431 | - /** |
|
432 | - * Sets the maximum column name length. |
|
433 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-max-column-len |
|
434 | - */ |
|
435 | - public const ATTR_MAX_COLUMN_LEN = 18; |
|
436 | - |
|
437 | - /** |
|
438 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-emulate-prepares |
|
439 | - * @since 5.1.3 |
|
440 | - */ |
|
441 | - public const ATTR_EMULATE_PREPARES = 20; |
|
442 | - |
|
443 | - /** |
|
444 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-default-fetch-mode |
|
445 | - * @since 5.2.0 |
|
446 | - */ |
|
447 | - public const ATTR_DEFAULT_FETCH_MODE = 19; |
|
448 | - |
|
449 | - /** |
|
450 | - * Do not raise an error or exception if an error occurs. The developer is |
|
451 | - * expected to explicitly check for errors. This is the default mode. |
|
452 | - * @see https://php.net/manual/en/pdo.error-handling.php Errors and Error Handling |
|
453 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.errmode-silent |
|
454 | - */ |
|
455 | - public const ERRMODE_SILENT = 0; |
|
456 | - |
|
457 | - /** |
|
458 | - * Issue a PHP <b>E_WARNING</b> message if an error occurs. |
|
459 | - * @see https://php.net/manual/en/pdo.error-handling.php Errors and Error Handling |
|
460 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.errmode-warning |
|
461 | - */ |
|
462 | - public const ERRMODE_WARNING = 1; |
|
463 | - |
|
464 | - /** |
|
465 | - * Throw a <b>PDOException</b> if an error occurs. |
|
466 | - * @see https://php.net/manual/en/pdo.error-handling.php Errors and Error Handling |
|
467 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.errmode-exception |
|
468 | - */ |
|
469 | - public const ERRMODE_EXCEPTION = 2; |
|
470 | - |
|
471 | - /** |
|
472 | - * Leave column names as returned by the database driver. |
|
473 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.case-natural |
|
474 | - */ |
|
475 | - public const CASE_NATURAL = 0; |
|
476 | - |
|
477 | - /** |
|
478 | - * Force column names to lower case. |
|
479 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.case-lower |
|
480 | - */ |
|
481 | - public const CASE_LOWER = 2; |
|
482 | - |
|
483 | - /** |
|
484 | - * Force column names to upper case. |
|
485 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.case-upper |
|
486 | - */ |
|
487 | - public const CASE_UPPER = 1; |
|
488 | - |
|
489 | - /** |
|
490 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.null-natural |
|
491 | - */ |
|
492 | - public const NULL_NATURAL = 0; |
|
493 | - |
|
494 | - /** |
|
495 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.null-empty-string |
|
496 | - */ |
|
497 | - public const NULL_EMPTY_STRING = 1; |
|
498 | - |
|
499 | - /** |
|
500 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.null-to-string |
|
501 | - */ |
|
502 | - public const NULL_TO_STRING = 2; |
|
503 | - |
|
504 | - /** |
|
505 | - * Corresponds to SQLSTATE '00000', meaning that the SQL statement was |
|
506 | - * successfully issued with no errors or warnings. This constant is for |
|
507 | - * your convenience when checking <b>PDO::errorCode</b> or |
|
508 | - * <b>PDOStatement::errorCode</b> to determine if an error |
|
509 | - * occurred. You will usually know if this is the case by examining the |
|
510 | - * return code from the method that raised the error condition anyway. |
|
511 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.err-none |
|
512 | - */ |
|
513 | - public const ERR_NONE = '00000'; |
|
514 | - |
|
515 | - /** |
|
516 | - * Fetch the next row in the result set. Valid only for scrollable cursors. |
|
517 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-next |
|
518 | - */ |
|
519 | - public const FETCH_ORI_NEXT = 0; |
|
520 | - |
|
521 | - /** |
|
522 | - * Fetch the previous row in the result set. Valid only for scrollable |
|
523 | - * cursors. |
|
524 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-prior |
|
525 | - */ |
|
526 | - public const FETCH_ORI_PRIOR = 1; |
|
527 | - |
|
528 | - /** |
|
529 | - * Fetch the first row in the result set. Valid only for scrollable cursors. |
|
530 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-first |
|
531 | - */ |
|
532 | - public const FETCH_ORI_FIRST = 2; |
|
533 | - |
|
534 | - /** |
|
535 | - * Fetch the last row in the result set. Valid only for scrollable cursors. |
|
536 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-last |
|
537 | - */ |
|
538 | - public const FETCH_ORI_LAST = 3; |
|
539 | - |
|
540 | - /** |
|
541 | - * Fetch the requested row by row number from the result set. Valid only |
|
542 | - * for scrollable cursors. |
|
543 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-abs |
|
544 | - */ |
|
545 | - public const FETCH_ORI_ABS = 4; |
|
546 | - |
|
547 | - /** |
|
548 | - * Fetch the requested row by relative position from the current position |
|
549 | - * of the cursor in the result set. Valid only for scrollable cursors. |
|
550 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-rel |
|
551 | - */ |
|
552 | - public const FETCH_ORI_REL = 5; |
|
553 | - |
|
554 | - /** |
|
555 | - * Specifies that the default fetch mode shall be used. |
|
556 | - * @since 8.0.7 |
|
557 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-default |
|
558 | - */ |
|
559 | - public const FETCH_DEFAULT = 0; |
|
560 | - |
|
561 | - /** |
|
562 | - * Create a <b>PDOStatement</b> object with a forward-only cursor. This is the |
|
563 | - * default cursor choice, as it is the fastest and most common data access |
|
564 | - * pattern in PHP. |
|
565 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.cursor-fwdonly |
|
566 | - */ |
|
567 | - public const CURSOR_FWDONLY = 0; |
|
568 | - |
|
569 | - /** |
|
570 | - * Create a <b>PDOStatement</b> object with a scrollable cursor. Pass the |
|
571 | - * PDO::FETCH_ORI_* constants to control the rows fetched from the result set. |
|
572 | - * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.cursor-scroll |
|
573 | - */ |
|
574 | - public const CURSOR_SCROLL = 1; |
|
575 | - |
|
576 | - /** |
|
577 | - * If this attribute is set to <b>TRUE</b> on a |
|
578 | - * <b>PDOStatement</b>, the MySQL driver will use the |
|
579 | - * buffered versions of the MySQL API. If you're writing portable code, you |
|
580 | - * should use <b>PDOStatement::fetchAll</b> instead. |
|
581 | - * <p> |
|
582 | - * Forcing queries to be buffered in mysql |
|
583 | - * <code> |
|
584 | - * if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { |
|
585 | - * $stmt = $db->prepare('select * from foo', |
|
586 | - * array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)); |
|
587 | - * } else { |
|
588 | - * die("my application only works with mysql; I should use \$stmt->fetchAll() instead"); |
|
589 | - * } |
|
590 | - * </code> |
|
591 | - * </p> |
|
592 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-use-buffered-query |
|
593 | - */ |
|
594 | - public const MYSQL_ATTR_USE_BUFFERED_QUERY = 1000; |
|
595 | - |
|
596 | - /** |
|
597 | - * <p> |
|
598 | - * Enable LOAD LOCAL INFILE. |
|
599 | - * </p> |
|
600 | - * <p> |
|
601 | - * Note, this constant can only be used in the <i>driver_options</i> |
|
602 | - * array when constructing a new database handle. |
|
603 | - * </p> |
|
604 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-local-infile |
|
605 | - */ |
|
606 | - public const MYSQL_ATTR_LOCAL_INFILE = 1001; |
|
607 | - |
|
608 | - /** |
|
609 | - * <p> |
|
610 | - * Command to execute when connecting to the MySQL server. Will |
|
611 | - * automatically be re-executed when reconnecting. |
|
612 | - * </p> |
|
613 | - * <p> |
|
614 | - * Note, this constant can only be used in the <i>driver_options</i> |
|
615 | - * array when constructing a new database handle. |
|
616 | - * </p> |
|
617 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-init-command |
|
618 | - */ |
|
619 | - public const MYSQL_ATTR_INIT_COMMAND = 1002; |
|
620 | - |
|
621 | - /** |
|
622 | - * <p> |
|
623 | - * Maximum buffer size. Defaults to 1 MiB. This constant is not supported when |
|
624 | - * compiled against mysqlnd. |
|
625 | - * </p> |
|
626 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-max-buffer-size |
|
627 | - */ |
|
628 | - public const MYSQL_ATTR_MAX_BUFFER_SIZE = 1005; |
|
629 | - |
|
630 | - /** |
|
631 | - * <p> |
|
632 | - * Read options from the named option file instead of from |
|
633 | - * my.cnf. This option is not available if |
|
634 | - * mysqlnd is used, because mysqlnd does not read the mysql |
|
635 | - * configuration files. |
|
636 | - * </p> |
|
637 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-read-default-file |
|
638 | - */ |
|
639 | - public const MYSQL_ATTR_READ_DEFAULT_FILE = 1003; |
|
640 | - |
|
641 | - /** |
|
642 | - * <p> |
|
643 | - * Read options from the named group from my.cnf or the |
|
644 | - * file specified with <b>MYSQL_READ_DEFAULT_FILE</b>. This option |
|
645 | - * is not available if mysqlnd is used, because mysqlnd does not read the mysql |
|
646 | - * configuration files. |
|
647 | - * </p> |
|
648 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-read-default-group |
|
649 | - */ |
|
650 | - public const MYSQL_ATTR_READ_DEFAULT_GROUP = 1004; |
|
651 | - |
|
652 | - /** |
|
653 | - * <p> |
|
654 | - * Enable network communication compression. This is not supported when |
|
655 | - * compiled against mysqlnd. |
|
656 | - * </p> |
|
657 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-compress |
|
658 | - */ |
|
659 | - public const MYSQL_ATTR_COMPRESS = 1003; |
|
660 | - |
|
661 | - /** |
|
662 | - * <p> |
|
663 | - * Perform direct queries, don't use prepared statements. |
|
664 | - * </p> |
|
665 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-direct-query |
|
666 | - */ |
|
667 | - public const MYSQL_ATTR_DIRECT_QUERY = 1004; |
|
668 | - |
|
669 | - /** |
|
670 | - * <p> |
|
671 | - * Return the number of found (matched) rows, not the |
|
672 | - * number of changed rows. |
|
673 | - * </p> |
|
674 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-found-rows |
|
675 | - */ |
|
676 | - public const MYSQL_ATTR_FOUND_ROWS = 1005; |
|
677 | - |
|
678 | - /** |
|
679 | - * <p> |
|
680 | - * Permit spaces after function names. Makes all functions |
|
681 | - * names reserved words. |
|
682 | - * </p> |
|
683 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ignore-space |
|
684 | - */ |
|
685 | - public const MYSQL_ATTR_IGNORE_SPACE = 1006; |
|
686 | - |
|
687 | - public const MYSQL_ATTR_SERVER_PUBLIC_KEY = 1012; |
|
688 | - |
|
689 | - /** |
|
690 | - * <p> |
|
691 | - * The file path to the SSL key. |
|
692 | - * </p> |
|
693 | - * @since 5.3.7 |
|
694 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-key |
|
695 | - */ |
|
696 | - public const MYSQL_ATTR_SSL_KEY = 1007; |
|
697 | - |
|
698 | - /** |
|
699 | - * <p> |
|
700 | - * The file path to the SSL certificate. |
|
701 | - * </p> |
|
702 | - * @since 5.3.7 |
|
703 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-cert |
|
704 | - */ |
|
705 | - public const MYSQL_ATTR_SSL_CERT = 1008; |
|
706 | - |
|
707 | - /** |
|
708 | - * <p> |
|
709 | - * The file path to the SSL certificate authority. |
|
710 | - * </p> |
|
711 | - * @since 5.3.7 |
|
712 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-ca |
|
713 | - */ |
|
714 | - public const MYSQL_ATTR_SSL_CA = 1009; |
|
715 | - |
|
716 | - /** |
|
717 | - * <p> |
|
718 | - * The file path to the directory that contains the trusted SSL |
|
719 | - * CA certificates, which are stored in PEM format. |
|
720 | - * </p> |
|
721 | - * @since 5.3.7 |
|
722 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-capath |
|
723 | - */ |
|
724 | - public const MYSQL_ATTR_SSL_CAPATH = 1010; |
|
725 | - |
|
726 | - /** |
|
727 | - * <p> |
|
728 | - * A list of one or more permissible ciphers to use for SSL encryption, |
|
729 | - * in a format understood by OpenSSL. |
|
730 | - * For example: DHE-RSA-AES256-SHA:AES128-SHA |
|
731 | - * </p> |
|
732 | - * @since 5.3.7 |
|
733 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-cipher |
|
734 | - */ |
|
735 | - public const MYSQL_ATTR_SSL_CIPHER = 1011; |
|
736 | - |
|
737 | - /** |
|
738 | - * <p> |
|
739 | - * Disables multi query execution in both {@see PDO::prepare()} and {@see PDO::query()} when set to FALSE. |
|
740 | - * </p> |
|
741 | - * <p> |
|
742 | - * Note, this constant can only be used in the driver_options array when constructing a new database handle. |
|
743 | - * </p> |
|
744 | - * @since 5.5.21 |
|
745 | - * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-multi-statements |
|
746 | - */ |
|
747 | - public const MYSQL_ATTR_MULTI_STATEMENTS = 1013; |
|
748 | - |
|
749 | - /** |
|
750 | - * <p> |
|
751 | - * Disables SSL peer verification when set to FALSE. |
|
752 | - * </p> |
|
753 | - * @since 7.0.18 |
|
754 | - * @since 7.1.4 |
|
755 | - * @link https://bugs.php.net/bug.php?id=71003 |
|
756 | - */ |
|
757 | - public const MYSQL_ATTR_SSL_VERIFY_SERVER_CERT = 1014; |
|
758 | - |
|
759 | - /** |
|
760 | - * @since 8.1 |
|
761 | - */ |
|
762 | - public const MYSQL_ATTR_LOCAL_INFILE_DIRECTORY = 1015; |
|
763 | - |
|
764 | - #[Deprecated("Use PDO::ATTR_EMULATE_PREPARES instead")] |
|
765 | - public const PGSQL_ASSOC = 1; |
|
766 | - public const PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT = 1000; |
|
767 | - |
|
768 | - /** |
|
769 | - * @since 5.6 |
|
770 | - */ |
|
771 | - public const PGSQL_ATTR_DISABLE_PREPARES = 1000; |
|
772 | - public const PGSQL_BAD_RESPONSE = 5; |
|
773 | - public const PGSQL_BOTH = 3; |
|
774 | - public const PGSQL_TRANSACTION_IDLE = 0; |
|
775 | - public const PGSQL_TRANSACTION_ACTIVE = 1; |
|
776 | - public const PGSQL_TRANSACTION_INTRANS = 2; |
|
777 | - public const PGSQL_TRANSACTION_INERROR = 3; |
|
778 | - public const PGSQL_TRANSACTION_UNKNOWN = 4; |
|
779 | - |
|
780 | - public const PGSQL_CONNECT_ASYNC = 4; |
|
781 | - public const PGSQL_CONNECT_FORCE_NEW = 2; |
|
782 | - public const PGSQL_CONNECTION_AUTH_OK = 5; |
|
783 | - public const PGSQL_CONNECTION_AWAITING_RESPONSE = 4; |
|
784 | - public const PGSQL_CONNECTION_BAD = 1; |
|
785 | - public const PGSQL_CONNECTION_OK = 0; |
|
786 | - public const PGSQL_CONNECTION_MADE = 3; |
|
787 | - public const PGSQL_CONNECTION_SETENV = 6; |
|
788 | - public const PGSQL_CONNECTION_SSL_STARTUP = 7; |
|
789 | - public const PGSQL_CONNECTION_STARTED = 2; |
|
790 | - public const PGSQL_COMMAND_OK = 1; |
|
791 | - public const PGSQL_CONV_FORCE_NULL = 4; |
|
792 | - public const PGSQL_CONV_IGNORE_DEFAULT = 2; |
|
793 | - public const PGSQL_CONV_IGNORE_NOT_NULL = 8; |
|
794 | - public const PGSQL_COPY_IN = 4; |
|
795 | - public const PGSQL_COPY_OUT = 3; |
|
796 | - public const PGSQL_DIAG_CONTEXT = 87; |
|
797 | - public const PGSQL_DIAG_INTERNAL_POSITION = 112; |
|
798 | - public const PGSQL_DIAG_INTERNAL_QUERY = 113; |
|
799 | - public const PGSQL_DIAG_MESSAGE_DETAIL = 68; |
|
800 | - public const PGSQL_DIAG_MESSAGE_HINT = 72; |
|
801 | - public const PGSQL_DIAG_MESSAGE_PRIMARY = 77; |
|
802 | - public const PGSQL_DIAG_SEVERITY = 83; |
|
803 | - public const PGSQL_DIAG_SOURCE_FILE = 70; |
|
804 | - public const PGSQL_DIAG_SOURCE_FUNCTION = 82; |
|
805 | - public const PGSQL_DIAG_SOURCE_LINE = 76; |
|
806 | - public const PGSQL_DIAG_SQLSTATE = 67; |
|
807 | - public const PGSQL_DIAG_STATEMENT_POSITION = 80; |
|
808 | - public const PGSQL_DML_ASYNC = 1024; |
|
809 | - public const PGSQL_DML_EXEC = 512; |
|
810 | - public const PGSQL_DML_NO_CONV = 256; |
|
811 | - public const PGSQL_DML_STRING = 2048; |
|
812 | - public const PGSQL_DML_ESCAPE = 4096; |
|
813 | - public const PGSQL_EMPTY_QUERY = 0; |
|
814 | - public const PGSQL_ERRORS_DEFAULT = 1; |
|
815 | - public const PGSQL_ERRORS_TERSE = 0; |
|
816 | - public const PGSQL_ERRORS_VERBOSE = 2; |
|
817 | - public const PGSQL_FATAL_ERROR = 7; |
|
818 | - public const PGSQL_NONFATAL_ERROR = 6; |
|
819 | - public const PGSQL_NOTICE_ALL = 2; |
|
820 | - public const PGSQL_NOTICE_CLEAR = 3; |
|
821 | - public const PGSQL_NOTICE_LAST = 1; |
|
822 | - public const PGSQL_NUM = 2; |
|
823 | - public const PGSQL_POLLING_ACTIVE = 4; |
|
824 | - public const PGSQL_POLLING_FAILED = 0; |
|
825 | - public const PGSQL_POLLING_OK = 3; |
|
826 | - public const PGSQL_POLLING_READING = 1; |
|
827 | - public const PGSQL_POLLING_WRITING = 2; |
|
828 | - public const PGSQL_SEEK_CUR = 1; |
|
829 | - public const PGSQL_SEEK_END = 2; |
|
830 | - public const PGSQL_SEEK_SET = 0; |
|
831 | - public const PGSQL_STATUS_LONG = 1; |
|
832 | - public const PGSQL_STATUS_STRING = 2; |
|
833 | - public const PGSQL_TUPLES_OK = 2; |
|
834 | - public const SQLSRV_TXN_READ_UNCOMMITTED = "READ_UNCOMMITTED"; |
|
835 | - public const SQLSRV_TXN_READ_COMMITTED = "READ_COMMITTED"; |
|
836 | - public const SQLSRV_TXN_REPEATABLE_READ = "REPEATABLE_READ"; |
|
837 | - public const SQLSRV_TXN_SNAPSHOT = "SNAPSHOT"; |
|
838 | - public const SQLSRV_TXN_SERIALIZABLE = "SERIALIZABLE"; |
|
839 | - public const SQLSRV_ENCODING_BINARY = 2; |
|
840 | - public const SQLSRV_ENCODING_SYSTEM = 3; |
|
841 | - public const SQLSRV_ENCODING_UTF8 = 65001; |
|
842 | - public const SQLSRV_ENCODING_DEFAULT = 1; |
|
843 | - public const SQLSRV_ATTR_ENCODING = 1000; |
|
844 | - public const SQLSRV_ATTR_QUERY_TIMEOUT = 1001; |
|
845 | - public const SQLSRV_ATTR_DIRECT_QUERY = 1002; |
|
846 | - public const SQLSRV_ATTR_CURSOR_SCROLL_TYPE = 1003; |
|
847 | - public const SQLSRV_ATTR_CLIENT_BUFFER_MAX_KB_SIZE = 1004; |
|
848 | - public const SQLSRV_ATTR_FETCHES_NUMERIC_TYPE = 1005; |
|
849 | - public const SQLSRV_ATTR_FETCHES_DATETIME_TYPE = 1006; |
|
850 | - public const SQLSRV_ATTR_FORMAT_DECIMALS = 1007; |
|
851 | - public const SQLSRV_ATTR_DECIMAL_PLACES = 1008; |
|
852 | - public const SQLSRV_ATTR_DATA_CLASSIFICATION = 1009; |
|
853 | - public const SQLSRV_PARAM_OUT_DEFAULT_SIZE = -1; |
|
854 | - public const SQLSRV_CURSOR_KEYSET = 1; |
|
855 | - public const SQLSRV_CURSOR_DYNAMIC = 2; |
|
856 | - public const SQLSRV_CURSOR_STATIC = 3; |
|
857 | - public const SQLSRV_CURSOR_BUFFERED = 42; |
|
858 | - |
|
859 | - /** |
|
860 | - * @since 7.4 |
|
861 | - */ |
|
862 | - public const SQLITE_ATTR_READONLY_STATEMENT = 1001; |
|
863 | - /** |
|
864 | - * @since 7.4 |
|
865 | - */ |
|
866 | - public const SQLITE_ATTR_EXTENDED_RESULT_CODES = 1002; |
|
867 | - |
|
868 | - /** |
|
869 | - * Provides a way to specify the action on the database session. |
|
870 | - * @since 7.2.16 |
|
871 | - * @since 7.3.3 |
|
872 | - */ |
|
873 | - public const OCI_ATTR_ACTION = 1000; |
|
874 | - |
|
875 | - /** |
|
876 | - * Provides a way to specify the client info on the database session. |
|
877 | - * @since 7.2.16 |
|
878 | - * @since 7.3.3 |
|
879 | - */ |
|
880 | - public const OCI_ATTR_CLIENT_INFO = 1001; |
|
881 | - |
|
882 | - /** |
|
883 | - * Provides a way to specify the client identifier on the database session. |
|
884 | - * @since 7.2.16 |
|
885 | - * @since 7.3.3 |
|
886 | - */ |
|
887 | - public const OCI_ATTR_CLIENT_IDENTIFIER = 1002; |
|
888 | - |
|
889 | - /** |
|
890 | - * Provides a way to specify the module on the database session. |
|
891 | - * @since 7.2.16 |
|
892 | - * @since 7.3.3 |
|
893 | - */ |
|
894 | - public const OCI_ATTR_MODULE = 1003; |
|
895 | - |
|
896 | - /** |
|
897 | - * The number of milliseconds to wait for individual round trips to the database to complete before timing out. |
|
898 | - * @since 8.0 |
|
899 | - */ |
|
900 | - public const OCI_ATTR_CALL_TIMEOUT = 1004; |
|
901 | - |
|
902 | - /** |
|
903 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
904 | - * Creates a PDO instance representing a connection to a database |
|
905 | - * @link https://php.net/manual/en/pdo.construct.php |
|
906 | - * @param string $dsn |
|
907 | - * @param string $username [optional] |
|
908 | - * @param string $password [optional] |
|
909 | - * @param array $options [optional] |
|
910 | - * @throws PDOException if the attempt to connect to the requested database fails. |
|
911 | - */ |
|
912 | - public function __construct( |
|
913 | - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $dsn, |
|
914 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $username = null, |
|
915 | - #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $password = null, |
|
916 | - #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $options = null |
|
917 | - ) {} |
|
918 | - |
|
919 | - /** |
|
920 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
921 | - * Prepares a statement for execution and returns a statement object |
|
922 | - * @link https://php.net/manual/en/pdo.prepare.php |
|
923 | - * @param string $query <p> |
|
924 | - * This must be a valid SQL statement for the target database server. |
|
925 | - * </p> |
|
926 | - * @param array $options [optional] <p> |
|
927 | - * This array holds one or more key=>value pairs to set |
|
928 | - * attribute values for the <b>PDOStatement</b> object that this method |
|
929 | - * returns. You would most commonly use this to set the |
|
930 | - * <b>PDO::ATTR_CURSOR</b> value to |
|
931 | - * <b>PDO::CURSOR_SCROLL</b> to request a scrollable cursor. |
|
932 | - * Some drivers have driver specific options that may be set at |
|
933 | - * prepare-time. |
|
934 | - * </p> |
|
935 | - * @return PDOStatement|false If the database server successfully prepares the statement, |
|
936 | - * <b>PDO::prepare</b> returns a |
|
937 | - * <b>PDOStatement</b> object. |
|
938 | - * If the database server cannot successfully prepare the statement, |
|
939 | - * <b>PDO::prepare</b> returns <b>FALSE</b> or emits |
|
940 | - * <b>PDOException</b> (depending on error handling). |
|
941 | - * </p> |
|
942 | - * <p> |
|
943 | - * Emulated prepared statements does not communicate with the database server |
|
944 | - * so <b>PDO::prepare</b> does not check the statement. |
|
945 | - */ |
|
946 | - #[TentativeType] |
|
947 | - public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []): PDOStatement|false {} |
|
948 | - |
|
949 | - /** |
|
950 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
951 | - * Initiates a transaction |
|
952 | - * <p> |
|
953 | - * Turns off autocommit mode. While autocommit mode is turned off, |
|
954 | - * changes made to the database via the PDO object instance are not committed |
|
955 | - * until you end the transaction by calling {@link PDO::commit()}. |
|
956 | - * Calling {@link PDO::rollBack()} will roll back all changes to the database and |
|
957 | - * return the connection to autocommit mode. |
|
958 | - * </p> |
|
959 | - * <p> |
|
960 | - * Some databases, including MySQL, automatically issue an implicit COMMIT |
|
961 | - * when a database definition language (DDL) statement |
|
962 | - * such as DROP TABLE or CREATE TABLE is issued within a transaction. |
|
963 | - * The implicit COMMIT will prevent you from rolling back any other changes |
|
964 | - * within the transaction boundary. |
|
965 | - * </p> |
|
966 | - * @link https://php.net/manual/en/pdo.begintransaction.php |
|
967 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
968 | - * @throws PDOException If there is already a transaction started or |
|
969 | - * the driver does not support transactions <br/> |
|
970 | - * <b>Note</b>: An exception is raised even when the <b>PDO::ATTR_ERRMODE</b> |
|
971 | - * attribute is not <b>PDO::ERRMODE_EXCEPTION</b>. |
|
972 | - */ |
|
973 | - #[TentativeType] |
|
974 | - public function beginTransaction(): bool {} |
|
975 | - |
|
976 | - /** |
|
977 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
978 | - * Commits a transaction |
|
979 | - * @link https://php.net/manual/en/pdo.commit.php |
|
980 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
981 | - * @throws PDOException if there is no active transaction. |
|
982 | - */ |
|
983 | - #[TentativeType] |
|
984 | - public function commit(): bool {} |
|
985 | - |
|
986 | - /** |
|
987 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
988 | - * Rolls back a transaction |
|
989 | - * @link https://php.net/manual/en/pdo.rollback.php |
|
990 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
991 | - * @throws PDOException if there is no active transaction. |
|
992 | - */ |
|
993 | - #[TentativeType] |
|
994 | - public function rollBack(): bool {} |
|
995 | - |
|
996 | - /** |
|
997 | - * (PHP 5 >= 5.3.3, Bundled pdo_pgsql, PHP 7)<br/> |
|
998 | - * Checks if inside a transaction |
|
999 | - * @link https://php.net/manual/en/pdo.intransaction.php |
|
1000 | - * @return bool <b>TRUE</b> if a transaction is currently active, and <b>FALSE</b> if not. |
|
1001 | - */ |
|
1002 | - #[TentativeType] |
|
1003 | - public function inTransaction(): bool {} |
|
1004 | - |
|
1005 | - /** |
|
1006 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1007 | - * Set an attribute |
|
1008 | - * @link https://php.net/manual/en/pdo.setattribute.php |
|
1009 | - * @param int $attribute |
|
1010 | - * @param mixed $value |
|
1011 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1012 | - */ |
|
1013 | - #[TentativeType] |
|
1014 | - public function setAttribute( |
|
1015 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, |
|
1016 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value |
|
1017 | - ): bool {} |
|
1018 | - |
|
1019 | - /** |
|
1020 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1021 | - * Execute an SQL statement and return the number of affected rows |
|
1022 | - * @link https://php.net/manual/en/pdo.exec.php |
|
1023 | - * @param string $statement <p> |
|
1024 | - * The SQL statement to prepare and execute. |
|
1025 | - * </p> |
|
1026 | - * <p> |
|
1027 | - * Data inside the query should be properly escaped. |
|
1028 | - * </p> |
|
1029 | - * @return int|false <b>PDO::exec</b> returns the number of rows that were modified |
|
1030 | - * or deleted by the SQL statement you issued. If no rows were affected, |
|
1031 | - * <b>PDO::exec</b> returns 0. |
|
1032 | - * </p> |
|
1033 | - * This function may |
|
1034 | - * return Boolean <b>FALSE</b>, but may also return a non-Boolean value which |
|
1035 | - * evaluates to <b>FALSE</b>. Please read the section on Booleans for more |
|
1036 | - * information. Use the === |
|
1037 | - * operator for testing the return value of this |
|
1038 | - * function. |
|
1039 | - * <p> |
|
1040 | - * The following example incorrectly relies on the return value of |
|
1041 | - * <b>PDO::exec</b>, wherein a statement that affected 0 rows |
|
1042 | - * results in a call to <b>die</b>: |
|
1043 | - * <code> |
|
1044 | - * $db->exec() or die(print_r($db->errorInfo(), true)); |
|
1045 | - * </code> |
|
1046 | - */ |
|
1047 | - #[TentativeType] |
|
1048 | - public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {} |
|
1049 | - |
|
1050 | - /** |
|
1051 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1052 | - * Executes an SQL statement, returning a result set as a PDOStatement object |
|
1053 | - * @link https://php.net/manual/en/pdo.query.php |
|
1054 | - * @param string $statement <p> |
|
1055 | - * The SQL statement to prepare and execute. |
|
1056 | - * </p> |
|
1057 | - * <p> |
|
1058 | - * Data inside the query should be properly escaped. |
|
1059 | - * </p> |
|
1060 | - * @param int $mode <p> |
|
1061 | - * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1062 | - * </p> |
|
1063 | - * @param mixed $arg3 <p> |
|
1064 | - * The second and following parameters are the same as the parameters for PDOStatement::setFetchMode. |
|
1065 | - * </p> |
|
1066 | - * @param array $ctorargs [optional] <p> |
|
1067 | - * Arguments of custom class constructor when the <i>mode</i> |
|
1068 | - * parameter is set to <b>PDO::FETCH_CLASS</b>. |
|
1069 | - * </p> |
|
1070 | - * @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b> |
|
1071 | - * on failure. |
|
1072 | - * @see PDOStatement::setFetchMode For a full description of the second and following parameters. |
|
1073 | - */ |
|
1074 | - #[PhpStormStubsElementAvailable(to: '7.4')] |
|
1075 | - public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {} |
|
1076 | - |
|
1077 | - /** |
|
1078 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1079 | - * Executes an SQL statement, returning a result set as a PDOStatement object |
|
1080 | - * @link https://php.net/manual/en/pdo.query.php |
|
1081 | - * @param string $statement <p> |
|
1082 | - * The SQL statement to prepare and execute. |
|
1083 | - * </p> |
|
1084 | - * <p> |
|
1085 | - * Data inside the query should be properly escaped. |
|
1086 | - * </p> |
|
1087 | - * @param int $mode <p> |
|
1088 | - * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1089 | - * </p> |
|
1090 | - * @param mixed $fetch_mode_args <p> |
|
1091 | - * Arguments of custom class constructor when the <i>mode</i> |
|
1092 | - * parameter is set to <b>PDO::FETCH_CLASS</b>. |
|
1093 | - * </p> |
|
1094 | - * @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b> |
|
1095 | - * on failure. |
|
1096 | - * @see PDOStatement::setFetchMode For a full description of the second and following parameters. |
|
1097 | - */ |
|
1098 | - #[PhpStormStubsElementAvailable('8.0')] |
|
1099 | - public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args) {} |
|
1100 | - |
|
1101 | - /** |
|
1102 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1103 | - * Returns the ID of the last inserted row or sequence value |
|
1104 | - * @link https://php.net/manual/en/pdo.lastinsertid.php |
|
1105 | - * @param string $name [optional] <p> |
|
1106 | - * Name of the sequence object from which the ID should be returned. |
|
1107 | - * </p> |
|
1108 | - * @return string|false If a sequence name was not specified for the <i>name</i> |
|
1109 | - * parameter, <b>PDO::lastInsertId</b> returns a |
|
1110 | - * string representing the row ID of the last row that was inserted into |
|
1111 | - * the database. |
|
1112 | - * </p> |
|
1113 | - * <p> |
|
1114 | - * If a sequence name was specified for the <i>name</i> |
|
1115 | - * parameter, <b>PDO::lastInsertId</b> returns a |
|
1116 | - * string representing the last value retrieved from the specified sequence |
|
1117 | - * object. |
|
1118 | - * </p> |
|
1119 | - * <p> |
|
1120 | - * If the PDO driver does not support this capability, |
|
1121 | - * <b>PDO::lastInsertId</b> triggers an |
|
1122 | - * IM001 SQLSTATE. |
|
1123 | - */ |
|
1124 | - #[TentativeType] |
|
1125 | - public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {} |
|
1126 | - |
|
1127 | - /** |
|
1128 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1129 | - * Fetch the SQLSTATE associated with the last operation on the database handle |
|
1130 | - * @link https://php.net/manual/en/pdo.errorcode.php |
|
1131 | - * @return mixed an SQLSTATE, a five characters alphanumeric identifier defined in |
|
1132 | - * the ANSI SQL-92 standard. Briefly, an SQLSTATE consists of a |
|
1133 | - * two characters class value followed by a three characters subclass value. A |
|
1134 | - * class value of 01 indicates a warning and is accompanied by a return code |
|
1135 | - * of SQL_SUCCESS_WITH_INFO. Class values other than '01', except for the |
|
1136 | - * class 'IM', indicate an error. The class 'IM' is specific to warnings |
|
1137 | - * and errors that derive from the implementation of PDO (or perhaps ODBC, |
|
1138 | - * if you're using the ODBC driver) itself. The subclass value '000' in any |
|
1139 | - * class indicates that there is no subclass for that SQLSTATE. |
|
1140 | - * </p> |
|
1141 | - * <p> |
|
1142 | - * <b>PDO::errorCode</b> only retrieves error codes for operations |
|
1143 | - * performed directly on the database handle. If you create a PDOStatement |
|
1144 | - * object through <b>PDO::prepare</b> or |
|
1145 | - * <b>PDO::query</b> and invoke an error on the statement |
|
1146 | - * handle, <b>PDO::errorCode</b> will not reflect that error. |
|
1147 | - * You must call <b>PDOStatement::errorCode</b> to return the error |
|
1148 | - * code for an operation performed on a particular statement handle. |
|
1149 | - * </p> |
|
1150 | - * <p> |
|
1151 | - * Returns <b>NULL</b> if no operation has been run on the database handle. |
|
1152 | - */ |
|
1153 | - #[TentativeType] |
|
1154 | - public function errorCode(): ?string {} |
|
1155 | - |
|
1156 | - /** |
|
1157 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1158 | - * Fetch extended error information associated with the last operation on the database handle |
|
1159 | - * @link https://php.net/manual/en/pdo.errorinfo.php |
|
1160 | - * @return array <b>PDO::errorInfo</b> returns an array of error information |
|
1161 | - * about the last operation performed by this database handle. The array |
|
1162 | - * consists of the following fields: |
|
1163 | - * <tr valign="top"> |
|
1164 | - * <td>Element</td> |
|
1165 | - * <td>Information</td> |
|
1166 | - * </tr> |
|
1167 | - * <tr valign="top"> |
|
1168 | - * <td>0</td> |
|
1169 | - * <td>SQLSTATE error code (a five characters alphanumeric identifier defined |
|
1170 | - * in the ANSI SQL standard).</td> |
|
1171 | - * </tr> |
|
1172 | - * <tr valign="top"> |
|
1173 | - * <td>1</td> |
|
1174 | - * <td>Driver-specific error code.</td> |
|
1175 | - * </tr> |
|
1176 | - * <tr valign="top"> |
|
1177 | - * <td>2</td> |
|
1178 | - * <td>Driver-specific error message.</td> |
|
1179 | - * </tr> |
|
1180 | - * </p> |
|
1181 | - * <p> |
|
1182 | - * If the SQLSTATE error code is not set or there is no driver-specific |
|
1183 | - * error, the elements following element 0 will be set to <b>NULL</b>. |
|
1184 | - * </p> |
|
1185 | - * <p> |
|
1186 | - * <b>PDO::errorInfo</b> only retrieves error information for |
|
1187 | - * operations performed directly on the database handle. If you create a |
|
1188 | - * PDOStatement object through <b>PDO::prepare</b> or |
|
1189 | - * <b>PDO::query</b> and invoke an error on the statement |
|
1190 | - * handle, <b>PDO::errorInfo</b> will not reflect the error |
|
1191 | - * from the statement handle. You must call |
|
1192 | - * <b>PDOStatement::errorInfo</b> to return the error |
|
1193 | - * information for an operation performed on a particular statement handle. |
|
1194 | - */ |
|
1195 | - #[ArrayShape([0 => "string", 1 => "int", 2 => "string"])] |
|
1196 | - #[TentativeType] |
|
1197 | - public function errorInfo(): array {} |
|
1198 | - |
|
1199 | - /** |
|
1200 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1201 | - * Retrieve a database connection attribute |
|
1202 | - * @link https://php.net/manual/en/pdo.getattribute.php |
|
1203 | - * @param int $attribute <p> |
|
1204 | - * One of the PDO::ATTR_* constants. The constants that |
|
1205 | - * apply to database connections are as follows: |
|
1206 | - * PDO::ATTR_AUTOCOMMIT |
|
1207 | - * PDO::ATTR_CASE |
|
1208 | - * PDO::ATTR_CLIENT_VERSION |
|
1209 | - * PDO::ATTR_CONNECTION_STATUS |
|
1210 | - * PDO::ATTR_DRIVER_NAME |
|
1211 | - * PDO::ATTR_ERRMODE |
|
1212 | - * PDO::ATTR_ORACLE_NULLS |
|
1213 | - * PDO::ATTR_PERSISTENT |
|
1214 | - * PDO::ATTR_PREFETCH |
|
1215 | - * PDO::ATTR_SERVER_INFO |
|
1216 | - * PDO::ATTR_SERVER_VERSION |
|
1217 | - * PDO::ATTR_TIMEOUT |
|
1218 | - * </p> |
|
1219 | - * @return mixed A successful call returns the value of the requested PDO attribute. |
|
1220 | - * An unsuccessful call returns null. |
|
1221 | - */ |
|
1222 | - #[TentativeType] |
|
1223 | - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {} |
|
1224 | - |
|
1225 | - /** |
|
1226 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.1)<br/> |
|
1227 | - * Quotes a string for use in a query. |
|
1228 | - * @link https://php.net/manual/en/pdo.quote.php |
|
1229 | - * @param string $string <p> |
|
1230 | - * The string to be quoted. |
|
1231 | - * </p> |
|
1232 | - * @param int $type [optional] <p> |
|
1233 | - * Provides a data type hint for drivers that have alternate quoting styles. |
|
1234 | - * </p> |
|
1235 | - * @return string|false a quoted string that is theoretically safe to pass into an |
|
1236 | - * SQL statement. Returns <b>FALSE</b> if the driver does not support quoting in |
|
1237 | - * this way. |
|
1238 | - */ |
|
1239 | - #[TentativeType] |
|
1240 | - public function quote( |
|
1241 | - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, |
|
1242 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT |
|
1243 | - ): string|false {} |
|
1244 | - |
|
1245 | - final public function __wakeup() {} |
|
1246 | - |
|
1247 | - final public function __sleep() {} |
|
1248 | - |
|
1249 | - /** |
|
1250 | - * (PHP 5 >= 5.1.3, PHP 7, PECL pdo >= 1.0.3)<br/> |
|
1251 | - * Return an array of available PDO drivers |
|
1252 | - * @link https://php.net/manual/en/pdo.getavailabledrivers.php |
|
1253 | - * @return array <b>PDO::getAvailableDrivers</b> returns an array of PDO driver names. If |
|
1254 | - * no drivers are available, it returns an empty array. |
|
1255 | - */ |
|
1256 | - #[TentativeType] |
|
1257 | - public static function getAvailableDrivers(): array {} |
|
1258 | - |
|
1259 | - /** |
|
1260 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo_sqlite >= 1.0.0)<br/> |
|
1261 | - * Registers a User Defined Function for use in SQL statements |
|
1262 | - * @link https://php.net/manual/en/pdo.sqlitecreatefunction.php |
|
1263 | - * @param string $function_name <p> |
|
1264 | - * The name of the function used in SQL statements. |
|
1265 | - * </p> |
|
1266 | - * @param callable $callback <p> |
|
1267 | - * Callback function to handle the defined SQL function. |
|
1268 | - * </p> |
|
1269 | - * @param int $num_args [optional] <p> |
|
1270 | - * The number of arguments that the SQL function takes. If this parameter is -1, |
|
1271 | - * then the SQL function may take any number of arguments. |
|
1272 | - * </p> |
|
1273 | - * @param int $flags [optional] <p> |
|
1274 | - * A bitwise conjunction of flags. Currently, only <b>PDO::SQLITE_DETERMINISTIC</b> is supported, |
|
1275 | - * which specifies that the function always returns the same result given the same inputs within |
|
1276 | - * a single SQL statement. |
|
1277 | - * </p> |
|
1278 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1279 | - */ |
|
1280 | - public function sqliteCreateFunction($function_name, $callback, $num_args = -1, $flags = 0) {} |
|
29 | + /** |
|
30 | + * Represents a boolean data type. |
|
31 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-bool |
|
32 | + */ |
|
33 | + public const PARAM_BOOL = 1; |
|
34 | + |
|
35 | + /** |
|
36 | + * Represents the SQL NULL data type. |
|
37 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-null |
|
38 | + */ |
|
39 | + public const PARAM_NULL = 0; |
|
40 | + |
|
41 | + /** |
|
42 | + * Represents the SQL INTEGER data type. |
|
43 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-int |
|
44 | + */ |
|
45 | + public const PARAM_INT = 2; |
|
46 | + |
|
47 | + /** |
|
48 | + * Represents the SQL CHAR, VARCHAR, or other string data type. |
|
49 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str |
|
50 | + */ |
|
51 | + public const PARAM_STR = 3; |
|
52 | + |
|
53 | + /** |
|
54 | + * Flag to denote a string uses the national character set. |
|
55 | + * @since 7.2 |
|
56 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str-natl |
|
57 | + */ |
|
58 | + public const PARAM_STR_NATL = 1073741824; |
|
59 | + |
|
60 | + /** |
|
61 | + * Flag to denote a string uses the regular character set. |
|
62 | + * @since 7.2 |
|
63 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-str-char |
|
64 | + */ |
|
65 | + public const PARAM_STR_CHAR = 536870912; |
|
66 | + |
|
67 | + /** |
|
68 | + * Sets the default string parameter type, this can be one of PDO::PARAM_STR_NATL and PDO::PARAM_STR_CHAR. |
|
69 | + * @since 7.2 |
|
70 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-default-str-param |
|
71 | + */ |
|
72 | + public const ATTR_DEFAULT_STR_PARAM = 21; |
|
73 | + |
|
74 | + /** |
|
75 | + * Specifies that a function created with PDO::sqliteCreateFunction() is deterministic, i.e. it always returns the same result given the same inputs within a single SQL statement. |
|
76 | + * @since 7.1.4 |
|
77 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.sqlite-deterministic |
|
78 | + */ |
|
79 | + public const SQLITE_DETERMINISTIC = 2048; |
|
80 | + |
|
81 | + /** |
|
82 | + * @since 7.3 |
|
83 | + */ |
|
84 | + public const SQLITE_OPEN_READONLY = 1; |
|
85 | + |
|
86 | + /** |
|
87 | + * @since 7.3 |
|
88 | + */ |
|
89 | + public const SQLITE_OPEN_READWRITE = 2; |
|
90 | + |
|
91 | + /** |
|
92 | + * @since 7.3 |
|
93 | + */ |
|
94 | + public const SQLITE_OPEN_CREATE = 4; |
|
95 | + |
|
96 | + /** |
|
97 | + * @since 7.3 |
|
98 | + */ |
|
99 | + public const SQLITE_ATTR_OPEN_FLAGS = 1000; |
|
100 | + |
|
101 | + /** |
|
102 | + * Represents the SQL large object data type. |
|
103 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-lob |
|
104 | + */ |
|
105 | + public const PARAM_LOB = 4; |
|
106 | + |
|
107 | + /** |
|
108 | + * Represents a recordset type. Not currently supported by any drivers. |
|
109 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-stmt |
|
110 | + */ |
|
111 | + public const PARAM_STMT = 5; |
|
112 | + |
|
113 | + /** |
|
114 | + * Specifies that the parameter is an INOUT parameter for a stored |
|
115 | + * procedure. You must bitwise-OR this value with an explicit |
|
116 | + * PDO::PARAM_* data type. |
|
117 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-input-output |
|
118 | + */ |
|
119 | + public const PARAM_INPUT_OUTPUT = 2147483648; |
|
120 | + |
|
121 | + /** |
|
122 | + * Allocation event |
|
123 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-alloc |
|
124 | + */ |
|
125 | + public const PARAM_EVT_ALLOC = 0; |
|
126 | + |
|
127 | + /** |
|
128 | + * Deallocation event |
|
129 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-free |
|
130 | + */ |
|
131 | + public const PARAM_EVT_FREE = 1; |
|
132 | + |
|
133 | + /** |
|
134 | + * Event triggered prior to execution of a prepared statement. |
|
135 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-exec-pre |
|
136 | + */ |
|
137 | + public const PARAM_EVT_EXEC_PRE = 2; |
|
138 | + |
|
139 | + /** |
|
140 | + * Event triggered subsequent to execution of a prepared statement. |
|
141 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-exec-post |
|
142 | + */ |
|
143 | + public const PARAM_EVT_EXEC_POST = 3; |
|
144 | + |
|
145 | + /** |
|
146 | + * Event triggered prior to fetching a result from a resultset. |
|
147 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-fetch-pre |
|
148 | + */ |
|
149 | + public const PARAM_EVT_FETCH_PRE = 4; |
|
150 | + |
|
151 | + /** |
|
152 | + * Event triggered subsequent to fetching a result from a resultset. |
|
153 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-fetch-post |
|
154 | + */ |
|
155 | + public const PARAM_EVT_FETCH_POST = 5; |
|
156 | + |
|
157 | + /** |
|
158 | + * Event triggered during bound parameter registration |
|
159 | + * allowing the driver to normalize the parameter name. |
|
160 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-evt-normalize |
|
161 | + */ |
|
162 | + public const PARAM_EVT_NORMALIZE = 6; |
|
163 | + |
|
164 | + /** |
|
165 | + * Specifies that the fetch method shall return each row as an object with |
|
166 | + * variable names that correspond to the column names returned in the result |
|
167 | + * set. <b>PDO::FETCH_LAZY</b> creates the object variable names as they are accessed. |
|
168 | + * Not valid inside <b>PDOStatement::fetchAll</b>. |
|
169 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-lazy |
|
170 | + */ |
|
171 | + public const FETCH_LAZY = 1; |
|
172 | + |
|
173 | + /** |
|
174 | + * Specifies that the fetch method shall return each row as an array indexed |
|
175 | + * by column name as returned in the corresponding result set. If the result |
|
176 | + * set contains multiple columns with the same name, |
|
177 | + * <b>PDO::FETCH_ASSOC</b> returns |
|
178 | + * only a single value per column name. |
|
179 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-assoc |
|
180 | + */ |
|
181 | + public const FETCH_ASSOC = 2; |
|
182 | + |
|
183 | + /** |
|
184 | + * Specifies that the fetch method shall return each row as an array indexed |
|
185 | + * by column number as returned in the corresponding result set, starting at |
|
186 | + * column 0. |
|
187 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-num |
|
188 | + */ |
|
189 | + public const FETCH_NUM = 3; |
|
190 | + |
|
191 | + /** |
|
192 | + * Specifies that the fetch method shall return each row as an array indexed |
|
193 | + * by both column name and number as returned in the corresponding result set, |
|
194 | + * starting at column 0. |
|
195 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-both |
|
196 | + */ |
|
197 | + public const FETCH_BOTH = 4; |
|
198 | + |
|
199 | + /** |
|
200 | + * Specifies that the fetch method shall return each row as an object with |
|
201 | + * property names that correspond to the column names returned in the result |
|
202 | + * set. |
|
203 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-obj |
|
204 | + */ |
|
205 | + public const FETCH_OBJ = 5; |
|
206 | + |
|
207 | + /** |
|
208 | + * Specifies that the fetch method shall return TRUE and assign the values of |
|
209 | + * the columns in the result set to the PHP variables to which they were |
|
210 | + * bound with the <b>PDOStatement::bindParam</b> or |
|
211 | + * <b>PDOStatement::bindColumn</b> methods. |
|
212 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-bound |
|
213 | + */ |
|
214 | + public const FETCH_BOUND = 6; |
|
215 | + |
|
216 | + /** |
|
217 | + * Specifies that the fetch method shall return only a single requested |
|
218 | + * column from the next row in the result set. |
|
219 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-column |
|
220 | + */ |
|
221 | + public const FETCH_COLUMN = 7; |
|
222 | + |
|
223 | + /** |
|
224 | + * Specifies that the fetch method shall return a new instance of the |
|
225 | + * requested class, mapping the columns to named properties in the class. |
|
226 | + * The magic |
|
227 | + * <b>__set</b> |
|
228 | + * method is called if the property doesn't exist in the requested class |
|
229 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-class |
|
230 | + */ |
|
231 | + public const FETCH_CLASS = 8; |
|
232 | + |
|
233 | + /** |
|
234 | + * Specifies that the fetch method shall update an existing instance of the |
|
235 | + * requested class, mapping the columns to named properties in the class. |
|
236 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-into |
|
237 | + */ |
|
238 | + public const FETCH_INTO = 9; |
|
239 | + |
|
240 | + /** |
|
241 | + * Allows completely customize the way data is treated on the fly (only |
|
242 | + * valid inside <b>PDOStatement::fetchAll</b>). |
|
243 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-func |
|
244 | + */ |
|
245 | + public const FETCH_FUNC = 10; |
|
246 | + |
|
247 | + /** |
|
248 | + * Group return by values. Usually combined with |
|
249 | + * <b>PDO::FETCH_COLUMN</b> or |
|
250 | + * <b>PDO::FETCH_KEY_PAIR</b>. |
|
251 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-group |
|
252 | + */ |
|
253 | + public const FETCH_GROUP = 65536; |
|
254 | + |
|
255 | + /** |
|
256 | + * Fetch only the unique values. |
|
257 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-unique |
|
258 | + */ |
|
259 | + public const FETCH_UNIQUE = 196608; |
|
260 | + |
|
261 | + /** |
|
262 | + * Fetch a two-column result into an array where the first column is a key and the second column |
|
263 | + * is the value. |
|
264 | + * @since 5.2.3 |
|
265 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-key-pair |
|
266 | + */ |
|
267 | + public const FETCH_KEY_PAIR = 12; |
|
268 | + |
|
269 | + /** |
|
270 | + * Determine the class name from the value of first column. |
|
271 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-classtype |
|
272 | + */ |
|
273 | + public const FETCH_CLASSTYPE = 262144; |
|
274 | + |
|
275 | + /** |
|
276 | + * As <b>PDO::FETCH_INTO</b> but object is provided as a serialized string. |
|
277 | + * Available since PHP 5.1.0. Since PHP 5.3.0 the class constructor is never called if this |
|
278 | + * flag is set. |
|
279 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-serialize |
|
280 | + */ |
|
281 | + public const FETCH_SERIALIZE = 524288; |
|
282 | + |
|
283 | + /** |
|
284 | + * Call the constructor before setting properties. |
|
285 | + * @since 5.2.0 |
|
286 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-props-late |
|
287 | + */ |
|
288 | + public const FETCH_PROPS_LATE = 1048576; |
|
289 | + |
|
290 | + /** |
|
291 | + * Specifies that the fetch method shall return each row as an array indexed |
|
292 | + * by column name as returned in the corresponding result set. If the result |
|
293 | + * set contains multiple columns with the same name, |
|
294 | + * <b>PDO::FETCH_NAMED</b> returns |
|
295 | + * an array of values per column name. |
|
296 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-named |
|
297 | + */ |
|
298 | + public const FETCH_NAMED = 11; |
|
299 | + |
|
300 | + /** |
|
301 | + * If this value is <b>FALSE</b>, PDO attempts to disable autocommit so that the |
|
302 | + * connection begins a transaction. |
|
303 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-autocommit |
|
304 | + */ |
|
305 | + public const ATTR_AUTOCOMMIT = 0; |
|
306 | + |
|
307 | + /** |
|
308 | + * Setting the prefetch size allows you to balance speed against memory |
|
309 | + * usage for your application. Not all database/driver combinations support |
|
310 | + * setting of the prefetch size. A larger prefetch size results in |
|
311 | + * increased performance at the cost of higher memory usage. |
|
312 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-prefetch |
|
313 | + */ |
|
314 | + public const ATTR_PREFETCH = 1; |
|
315 | + |
|
316 | + /** |
|
317 | + * Sets the timeout value in seconds for communications with the database. |
|
318 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-timeout |
|
319 | + */ |
|
320 | + public const ATTR_TIMEOUT = 2; |
|
321 | + |
|
322 | + /** |
|
323 | + * @see https://php.net/manual/en/pdo.error-handling.php Errors and error handling |
|
324 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-errmode |
|
325 | + */ |
|
326 | + public const ATTR_ERRMODE = 3; |
|
327 | + |
|
328 | + /** |
|
329 | + * This is a read only attribute; it will return information about the |
|
330 | + * version of the database server to which PDO is connected. |
|
331 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr- |
|
332 | + */ |
|
333 | + public const ATTR_SERVER_VERSION = 4; |
|
334 | + |
|
335 | + /** |
|
336 | + * This is a read only attribute; it will return information about the |
|
337 | + * version of the client libraries that the PDO driver is using. |
|
338 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-client-version |
|
339 | + */ |
|
340 | + public const ATTR_CLIENT_VERSION = 5; |
|
341 | + |
|
342 | + /** |
|
343 | + * This is a read only attribute; it will return some meta information about the |
|
344 | + * database server to which PDO is connected. |
|
345 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-server-info |
|
346 | + */ |
|
347 | + public const ATTR_SERVER_INFO = 6; |
|
348 | + public const ATTR_CONNECTION_STATUS = 7; |
|
349 | + |
|
350 | + /** |
|
351 | + * Force column names to a specific case specified by the PDO::CASE_* |
|
352 | + * constants. |
|
353 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-case |
|
354 | + */ |
|
355 | + public const ATTR_CASE = 8; |
|
356 | + |
|
357 | + /** |
|
358 | + * Get or set the name to use for a cursor. Most useful when using |
|
359 | + * scrollable cursors and positioned updates. |
|
360 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-cursor-name |
|
361 | + */ |
|
362 | + public const ATTR_CURSOR_NAME = 9; |
|
363 | + |
|
364 | + /** |
|
365 | + * Selects the cursor type. PDO currently supports either |
|
366 | + * <b>PDO::CURSOR_FWDONLY</b> and |
|
367 | + * <b>PDO::CURSOR_SCROLL</b>. Stick with |
|
368 | + * <b>PDO::CURSOR_FWDONLY</b> unless you know that you need a |
|
369 | + * scrollable cursor. |
|
370 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-cursor |
|
371 | + */ |
|
372 | + public const ATTR_CURSOR = 10; |
|
373 | + |
|
374 | + /** |
|
375 | + * Convert empty strings to SQL NULL values on data fetches. |
|
376 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-oracle-nulls |
|
377 | + */ |
|
378 | + public const ATTR_ORACLE_NULLS = 11; |
|
379 | + |
|
380 | + /** |
|
381 | + * Request a persistent connection, rather than creating a new connection. |
|
382 | + * @see https://php.net/manual/en/pdo.connections.php Connections and Connection Management |
|
383 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-persistent |
|
384 | + */ |
|
385 | + public const ATTR_PERSISTENT = 12; |
|
386 | + |
|
387 | + /** |
|
388 | + * Sets the class name of which statements are returned as. |
|
389 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-statement-class |
|
390 | + */ |
|
391 | + public const ATTR_STATEMENT_CLASS = 13; |
|
392 | + |
|
393 | + /** |
|
394 | + * Prepend the containing table name to each column name returned in the |
|
395 | + * result set. The table name and column name are separated by a decimal (.) |
|
396 | + * character. Support of this attribute is at the driver level; it may not |
|
397 | + * be supported by your driver. |
|
398 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-table-names |
|
399 | + */ |
|
400 | + public const ATTR_FETCH_TABLE_NAMES = 14; |
|
401 | + |
|
402 | + /** |
|
403 | + * Prepend the containing catalog name to each column name returned in the |
|
404 | + * result set. The catalog name and column name are separated by a decimal |
|
405 | + * (.) character. Support of this attribute is at the driver level; it may |
|
406 | + * not be supported by your driver. |
|
407 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-fetch-catalog-names |
|
408 | + */ |
|
409 | + public const ATTR_FETCH_CATALOG_NAMES = 15; |
|
410 | + |
|
411 | + /** |
|
412 | + * Returns the name of the driver. |
|
413 | + * <p> |
|
414 | + * using <b>PDO::ATTR_DRIVER_NAME</b> |
|
415 | + * <code> |
|
416 | + * if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { |
|
417 | + * echo "Running on mysql; doing something mysql specific here\n"; |
|
418 | + * } |
|
419 | + * </code> |
|
420 | + * </p> |
|
421 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-driver-name |
|
422 | + */ |
|
423 | + public const ATTR_DRIVER_NAME = 16; |
|
424 | + |
|
425 | + /** |
|
426 | + * Forces all values fetched to be treated as strings. |
|
427 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-stringify-fetches |
|
428 | + */ |
|
429 | + public const ATTR_STRINGIFY_FETCHES = 17; |
|
430 | + |
|
431 | + /** |
|
432 | + * Sets the maximum column name length. |
|
433 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-max-column-len |
|
434 | + */ |
|
435 | + public const ATTR_MAX_COLUMN_LEN = 18; |
|
436 | + |
|
437 | + /** |
|
438 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-emulate-prepares |
|
439 | + * @since 5.1.3 |
|
440 | + */ |
|
441 | + public const ATTR_EMULATE_PREPARES = 20; |
|
442 | + |
|
443 | + /** |
|
444 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.attr-default-fetch-mode |
|
445 | + * @since 5.2.0 |
|
446 | + */ |
|
447 | + public const ATTR_DEFAULT_FETCH_MODE = 19; |
|
448 | + |
|
449 | + /** |
|
450 | + * Do not raise an error or exception if an error occurs. The developer is |
|
451 | + * expected to explicitly check for errors. This is the default mode. |
|
452 | + * @see https://php.net/manual/en/pdo.error-handling.php Errors and Error Handling |
|
453 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.errmode-silent |
|
454 | + */ |
|
455 | + public const ERRMODE_SILENT = 0; |
|
456 | + |
|
457 | + /** |
|
458 | + * Issue a PHP <b>E_WARNING</b> message if an error occurs. |
|
459 | + * @see https://php.net/manual/en/pdo.error-handling.php Errors and Error Handling |
|
460 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.errmode-warning |
|
461 | + */ |
|
462 | + public const ERRMODE_WARNING = 1; |
|
463 | + |
|
464 | + /** |
|
465 | + * Throw a <b>PDOException</b> if an error occurs. |
|
466 | + * @see https://php.net/manual/en/pdo.error-handling.php Errors and Error Handling |
|
467 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.errmode-exception |
|
468 | + */ |
|
469 | + public const ERRMODE_EXCEPTION = 2; |
|
470 | + |
|
471 | + /** |
|
472 | + * Leave column names as returned by the database driver. |
|
473 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.case-natural |
|
474 | + */ |
|
475 | + public const CASE_NATURAL = 0; |
|
476 | + |
|
477 | + /** |
|
478 | + * Force column names to lower case. |
|
479 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.case-lower |
|
480 | + */ |
|
481 | + public const CASE_LOWER = 2; |
|
482 | + |
|
483 | + /** |
|
484 | + * Force column names to upper case. |
|
485 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.case-upper |
|
486 | + */ |
|
487 | + public const CASE_UPPER = 1; |
|
488 | + |
|
489 | + /** |
|
490 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.null-natural |
|
491 | + */ |
|
492 | + public const NULL_NATURAL = 0; |
|
493 | + |
|
494 | + /** |
|
495 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.null-empty-string |
|
496 | + */ |
|
497 | + public const NULL_EMPTY_STRING = 1; |
|
498 | + |
|
499 | + /** |
|
500 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.null-to-string |
|
501 | + */ |
|
502 | + public const NULL_TO_STRING = 2; |
|
503 | + |
|
504 | + /** |
|
505 | + * Corresponds to SQLSTATE '00000', meaning that the SQL statement was |
|
506 | + * successfully issued with no errors or warnings. This constant is for |
|
507 | + * your convenience when checking <b>PDO::errorCode</b> or |
|
508 | + * <b>PDOStatement::errorCode</b> to determine if an error |
|
509 | + * occurred. You will usually know if this is the case by examining the |
|
510 | + * return code from the method that raised the error condition anyway. |
|
511 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.err-none |
|
512 | + */ |
|
513 | + public const ERR_NONE = '00000'; |
|
514 | + |
|
515 | + /** |
|
516 | + * Fetch the next row in the result set. Valid only for scrollable cursors. |
|
517 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-next |
|
518 | + */ |
|
519 | + public const FETCH_ORI_NEXT = 0; |
|
520 | + |
|
521 | + /** |
|
522 | + * Fetch the previous row in the result set. Valid only for scrollable |
|
523 | + * cursors. |
|
524 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-prior |
|
525 | + */ |
|
526 | + public const FETCH_ORI_PRIOR = 1; |
|
527 | + |
|
528 | + /** |
|
529 | + * Fetch the first row in the result set. Valid only for scrollable cursors. |
|
530 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-first |
|
531 | + */ |
|
532 | + public const FETCH_ORI_FIRST = 2; |
|
533 | + |
|
534 | + /** |
|
535 | + * Fetch the last row in the result set. Valid only for scrollable cursors. |
|
536 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-last |
|
537 | + */ |
|
538 | + public const FETCH_ORI_LAST = 3; |
|
539 | + |
|
540 | + /** |
|
541 | + * Fetch the requested row by row number from the result set. Valid only |
|
542 | + * for scrollable cursors. |
|
543 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-abs |
|
544 | + */ |
|
545 | + public const FETCH_ORI_ABS = 4; |
|
546 | + |
|
547 | + /** |
|
548 | + * Fetch the requested row by relative position from the current position |
|
549 | + * of the cursor in the result set. Valid only for scrollable cursors. |
|
550 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-ori-rel |
|
551 | + */ |
|
552 | + public const FETCH_ORI_REL = 5; |
|
553 | + |
|
554 | + /** |
|
555 | + * Specifies that the default fetch mode shall be used. |
|
556 | + * @since 8.0.7 |
|
557 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.fetch-default |
|
558 | + */ |
|
559 | + public const FETCH_DEFAULT = 0; |
|
560 | + |
|
561 | + /** |
|
562 | + * Create a <b>PDOStatement</b> object with a forward-only cursor. This is the |
|
563 | + * default cursor choice, as it is the fastest and most common data access |
|
564 | + * pattern in PHP. |
|
565 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.cursor-fwdonly |
|
566 | + */ |
|
567 | + public const CURSOR_FWDONLY = 0; |
|
568 | + |
|
569 | + /** |
|
570 | + * Create a <b>PDOStatement</b> object with a scrollable cursor. Pass the |
|
571 | + * PDO::FETCH_ORI_* constants to control the rows fetched from the result set. |
|
572 | + * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.cursor-scroll |
|
573 | + */ |
|
574 | + public const CURSOR_SCROLL = 1; |
|
575 | + |
|
576 | + /** |
|
577 | + * If this attribute is set to <b>TRUE</b> on a |
|
578 | + * <b>PDOStatement</b>, the MySQL driver will use the |
|
579 | + * buffered versions of the MySQL API. If you're writing portable code, you |
|
580 | + * should use <b>PDOStatement::fetchAll</b> instead. |
|
581 | + * <p> |
|
582 | + * Forcing queries to be buffered in mysql |
|
583 | + * <code> |
|
584 | + * if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { |
|
585 | + * $stmt = $db->prepare('select * from foo', |
|
586 | + * array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)); |
|
587 | + * } else { |
|
588 | + * die("my application only works with mysql; I should use \$stmt->fetchAll() instead"); |
|
589 | + * } |
|
590 | + * </code> |
|
591 | + * </p> |
|
592 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-use-buffered-query |
|
593 | + */ |
|
594 | + public const MYSQL_ATTR_USE_BUFFERED_QUERY = 1000; |
|
595 | + |
|
596 | + /** |
|
597 | + * <p> |
|
598 | + * Enable LOAD LOCAL INFILE. |
|
599 | + * </p> |
|
600 | + * <p> |
|
601 | + * Note, this constant can only be used in the <i>driver_options</i> |
|
602 | + * array when constructing a new database handle. |
|
603 | + * </p> |
|
604 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-local-infile |
|
605 | + */ |
|
606 | + public const MYSQL_ATTR_LOCAL_INFILE = 1001; |
|
607 | + |
|
608 | + /** |
|
609 | + * <p> |
|
610 | + * Command to execute when connecting to the MySQL server. Will |
|
611 | + * automatically be re-executed when reconnecting. |
|
612 | + * </p> |
|
613 | + * <p> |
|
614 | + * Note, this constant can only be used in the <i>driver_options</i> |
|
615 | + * array when constructing a new database handle. |
|
616 | + * </p> |
|
617 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-init-command |
|
618 | + */ |
|
619 | + public const MYSQL_ATTR_INIT_COMMAND = 1002; |
|
620 | + |
|
621 | + /** |
|
622 | + * <p> |
|
623 | + * Maximum buffer size. Defaults to 1 MiB. This constant is not supported when |
|
624 | + * compiled against mysqlnd. |
|
625 | + * </p> |
|
626 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-max-buffer-size |
|
627 | + */ |
|
628 | + public const MYSQL_ATTR_MAX_BUFFER_SIZE = 1005; |
|
629 | + |
|
630 | + /** |
|
631 | + * <p> |
|
632 | + * Read options from the named option file instead of from |
|
633 | + * my.cnf. This option is not available if |
|
634 | + * mysqlnd is used, because mysqlnd does not read the mysql |
|
635 | + * configuration files. |
|
636 | + * </p> |
|
637 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-read-default-file |
|
638 | + */ |
|
639 | + public const MYSQL_ATTR_READ_DEFAULT_FILE = 1003; |
|
640 | + |
|
641 | + /** |
|
642 | + * <p> |
|
643 | + * Read options from the named group from my.cnf or the |
|
644 | + * file specified with <b>MYSQL_READ_DEFAULT_FILE</b>. This option |
|
645 | + * is not available if mysqlnd is used, because mysqlnd does not read the mysql |
|
646 | + * configuration files. |
|
647 | + * </p> |
|
648 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-read-default-group |
|
649 | + */ |
|
650 | + public const MYSQL_ATTR_READ_DEFAULT_GROUP = 1004; |
|
651 | + |
|
652 | + /** |
|
653 | + * <p> |
|
654 | + * Enable network communication compression. This is not supported when |
|
655 | + * compiled against mysqlnd. |
|
656 | + * </p> |
|
657 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-compress |
|
658 | + */ |
|
659 | + public const MYSQL_ATTR_COMPRESS = 1003; |
|
660 | + |
|
661 | + /** |
|
662 | + * <p> |
|
663 | + * Perform direct queries, don't use prepared statements. |
|
664 | + * </p> |
|
665 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-direct-query |
|
666 | + */ |
|
667 | + public const MYSQL_ATTR_DIRECT_QUERY = 1004; |
|
668 | + |
|
669 | + /** |
|
670 | + * <p> |
|
671 | + * Return the number of found (matched) rows, not the |
|
672 | + * number of changed rows. |
|
673 | + * </p> |
|
674 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-found-rows |
|
675 | + */ |
|
676 | + public const MYSQL_ATTR_FOUND_ROWS = 1005; |
|
677 | + |
|
678 | + /** |
|
679 | + * <p> |
|
680 | + * Permit spaces after function names. Makes all functions |
|
681 | + * names reserved words. |
|
682 | + * </p> |
|
683 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ignore-space |
|
684 | + */ |
|
685 | + public const MYSQL_ATTR_IGNORE_SPACE = 1006; |
|
686 | + |
|
687 | + public const MYSQL_ATTR_SERVER_PUBLIC_KEY = 1012; |
|
688 | + |
|
689 | + /** |
|
690 | + * <p> |
|
691 | + * The file path to the SSL key. |
|
692 | + * </p> |
|
693 | + * @since 5.3.7 |
|
694 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-key |
|
695 | + */ |
|
696 | + public const MYSQL_ATTR_SSL_KEY = 1007; |
|
697 | + |
|
698 | + /** |
|
699 | + * <p> |
|
700 | + * The file path to the SSL certificate. |
|
701 | + * </p> |
|
702 | + * @since 5.3.7 |
|
703 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-cert |
|
704 | + */ |
|
705 | + public const MYSQL_ATTR_SSL_CERT = 1008; |
|
706 | + |
|
707 | + /** |
|
708 | + * <p> |
|
709 | + * The file path to the SSL certificate authority. |
|
710 | + * </p> |
|
711 | + * @since 5.3.7 |
|
712 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-ca |
|
713 | + */ |
|
714 | + public const MYSQL_ATTR_SSL_CA = 1009; |
|
715 | + |
|
716 | + /** |
|
717 | + * <p> |
|
718 | + * The file path to the directory that contains the trusted SSL |
|
719 | + * CA certificates, which are stored in PEM format. |
|
720 | + * </p> |
|
721 | + * @since 5.3.7 |
|
722 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-ssl-capath |
|
723 | + */ |
|
724 | + public const MYSQL_ATTR_SSL_CAPATH = 1010; |
|
725 | + |
|
726 | + /** |
|
727 | + * <p> |
|
728 | + * A list of one or more permissible ciphers to use for SSL encryption, |
|
729 | + * in a format understood by OpenSSL. |
|
730 | + * For example: DHE-RSA-AES256-SHA:AES128-SHA |
|
731 | + * </p> |
|
732 | + * @since 5.3.7 |
|
733 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-cipher |
|
734 | + */ |
|
735 | + public const MYSQL_ATTR_SSL_CIPHER = 1011; |
|
736 | + |
|
737 | + /** |
|
738 | + * <p> |
|
739 | + * Disables multi query execution in both {@see PDO::prepare()} and {@see PDO::query()} when set to FALSE. |
|
740 | + * </p> |
|
741 | + * <p> |
|
742 | + * Note, this constant can only be used in the driver_options array when constructing a new database handle. |
|
743 | + * </p> |
|
744 | + * @since 5.5.21 |
|
745 | + * @link https://php.net/manual/en/ref.pdo-mysql.php#pdo.constants.mysql-attr-multi-statements |
|
746 | + */ |
|
747 | + public const MYSQL_ATTR_MULTI_STATEMENTS = 1013; |
|
748 | + |
|
749 | + /** |
|
750 | + * <p> |
|
751 | + * Disables SSL peer verification when set to FALSE. |
|
752 | + * </p> |
|
753 | + * @since 7.0.18 |
|
754 | + * @since 7.1.4 |
|
755 | + * @link https://bugs.php.net/bug.php?id=71003 |
|
756 | + */ |
|
757 | + public const MYSQL_ATTR_SSL_VERIFY_SERVER_CERT = 1014; |
|
758 | + |
|
759 | + /** |
|
760 | + * @since 8.1 |
|
761 | + */ |
|
762 | + public const MYSQL_ATTR_LOCAL_INFILE_DIRECTORY = 1015; |
|
763 | + |
|
764 | + #[Deprecated("Use PDO::ATTR_EMULATE_PREPARES instead")] |
|
765 | + public const PGSQL_ASSOC = 1; |
|
766 | + public const PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT = 1000; |
|
767 | + |
|
768 | + /** |
|
769 | + * @since 5.6 |
|
770 | + */ |
|
771 | + public const PGSQL_ATTR_DISABLE_PREPARES = 1000; |
|
772 | + public const PGSQL_BAD_RESPONSE = 5; |
|
773 | + public const PGSQL_BOTH = 3; |
|
774 | + public const PGSQL_TRANSACTION_IDLE = 0; |
|
775 | + public const PGSQL_TRANSACTION_ACTIVE = 1; |
|
776 | + public const PGSQL_TRANSACTION_INTRANS = 2; |
|
777 | + public const PGSQL_TRANSACTION_INERROR = 3; |
|
778 | + public const PGSQL_TRANSACTION_UNKNOWN = 4; |
|
779 | + |
|
780 | + public const PGSQL_CONNECT_ASYNC = 4; |
|
781 | + public const PGSQL_CONNECT_FORCE_NEW = 2; |
|
782 | + public const PGSQL_CONNECTION_AUTH_OK = 5; |
|
783 | + public const PGSQL_CONNECTION_AWAITING_RESPONSE = 4; |
|
784 | + public const PGSQL_CONNECTION_BAD = 1; |
|
785 | + public const PGSQL_CONNECTION_OK = 0; |
|
786 | + public const PGSQL_CONNECTION_MADE = 3; |
|
787 | + public const PGSQL_CONNECTION_SETENV = 6; |
|
788 | + public const PGSQL_CONNECTION_SSL_STARTUP = 7; |
|
789 | + public const PGSQL_CONNECTION_STARTED = 2; |
|
790 | + public const PGSQL_COMMAND_OK = 1; |
|
791 | + public const PGSQL_CONV_FORCE_NULL = 4; |
|
792 | + public const PGSQL_CONV_IGNORE_DEFAULT = 2; |
|
793 | + public const PGSQL_CONV_IGNORE_NOT_NULL = 8; |
|
794 | + public const PGSQL_COPY_IN = 4; |
|
795 | + public const PGSQL_COPY_OUT = 3; |
|
796 | + public const PGSQL_DIAG_CONTEXT = 87; |
|
797 | + public const PGSQL_DIAG_INTERNAL_POSITION = 112; |
|
798 | + public const PGSQL_DIAG_INTERNAL_QUERY = 113; |
|
799 | + public const PGSQL_DIAG_MESSAGE_DETAIL = 68; |
|
800 | + public const PGSQL_DIAG_MESSAGE_HINT = 72; |
|
801 | + public const PGSQL_DIAG_MESSAGE_PRIMARY = 77; |
|
802 | + public const PGSQL_DIAG_SEVERITY = 83; |
|
803 | + public const PGSQL_DIAG_SOURCE_FILE = 70; |
|
804 | + public const PGSQL_DIAG_SOURCE_FUNCTION = 82; |
|
805 | + public const PGSQL_DIAG_SOURCE_LINE = 76; |
|
806 | + public const PGSQL_DIAG_SQLSTATE = 67; |
|
807 | + public const PGSQL_DIAG_STATEMENT_POSITION = 80; |
|
808 | + public const PGSQL_DML_ASYNC = 1024; |
|
809 | + public const PGSQL_DML_EXEC = 512; |
|
810 | + public const PGSQL_DML_NO_CONV = 256; |
|
811 | + public const PGSQL_DML_STRING = 2048; |
|
812 | + public const PGSQL_DML_ESCAPE = 4096; |
|
813 | + public const PGSQL_EMPTY_QUERY = 0; |
|
814 | + public const PGSQL_ERRORS_DEFAULT = 1; |
|
815 | + public const PGSQL_ERRORS_TERSE = 0; |
|
816 | + public const PGSQL_ERRORS_VERBOSE = 2; |
|
817 | + public const PGSQL_FATAL_ERROR = 7; |
|
818 | + public const PGSQL_NONFATAL_ERROR = 6; |
|
819 | + public const PGSQL_NOTICE_ALL = 2; |
|
820 | + public const PGSQL_NOTICE_CLEAR = 3; |
|
821 | + public const PGSQL_NOTICE_LAST = 1; |
|
822 | + public const PGSQL_NUM = 2; |
|
823 | + public const PGSQL_POLLING_ACTIVE = 4; |
|
824 | + public const PGSQL_POLLING_FAILED = 0; |
|
825 | + public const PGSQL_POLLING_OK = 3; |
|
826 | + public const PGSQL_POLLING_READING = 1; |
|
827 | + public const PGSQL_POLLING_WRITING = 2; |
|
828 | + public const PGSQL_SEEK_CUR = 1; |
|
829 | + public const PGSQL_SEEK_END = 2; |
|
830 | + public const PGSQL_SEEK_SET = 0; |
|
831 | + public const PGSQL_STATUS_LONG = 1; |
|
832 | + public const PGSQL_STATUS_STRING = 2; |
|
833 | + public const PGSQL_TUPLES_OK = 2; |
|
834 | + public const SQLSRV_TXN_READ_UNCOMMITTED = "READ_UNCOMMITTED"; |
|
835 | + public const SQLSRV_TXN_READ_COMMITTED = "READ_COMMITTED"; |
|
836 | + public const SQLSRV_TXN_REPEATABLE_READ = "REPEATABLE_READ"; |
|
837 | + public const SQLSRV_TXN_SNAPSHOT = "SNAPSHOT"; |
|
838 | + public const SQLSRV_TXN_SERIALIZABLE = "SERIALIZABLE"; |
|
839 | + public const SQLSRV_ENCODING_BINARY = 2; |
|
840 | + public const SQLSRV_ENCODING_SYSTEM = 3; |
|
841 | + public const SQLSRV_ENCODING_UTF8 = 65001; |
|
842 | + public const SQLSRV_ENCODING_DEFAULT = 1; |
|
843 | + public const SQLSRV_ATTR_ENCODING = 1000; |
|
844 | + public const SQLSRV_ATTR_QUERY_TIMEOUT = 1001; |
|
845 | + public const SQLSRV_ATTR_DIRECT_QUERY = 1002; |
|
846 | + public const SQLSRV_ATTR_CURSOR_SCROLL_TYPE = 1003; |
|
847 | + public const SQLSRV_ATTR_CLIENT_BUFFER_MAX_KB_SIZE = 1004; |
|
848 | + public const SQLSRV_ATTR_FETCHES_NUMERIC_TYPE = 1005; |
|
849 | + public const SQLSRV_ATTR_FETCHES_DATETIME_TYPE = 1006; |
|
850 | + public const SQLSRV_ATTR_FORMAT_DECIMALS = 1007; |
|
851 | + public const SQLSRV_ATTR_DECIMAL_PLACES = 1008; |
|
852 | + public const SQLSRV_ATTR_DATA_CLASSIFICATION = 1009; |
|
853 | + public const SQLSRV_PARAM_OUT_DEFAULT_SIZE = -1; |
|
854 | + public const SQLSRV_CURSOR_KEYSET = 1; |
|
855 | + public const SQLSRV_CURSOR_DYNAMIC = 2; |
|
856 | + public const SQLSRV_CURSOR_STATIC = 3; |
|
857 | + public const SQLSRV_CURSOR_BUFFERED = 42; |
|
858 | + |
|
859 | + /** |
|
860 | + * @since 7.4 |
|
861 | + */ |
|
862 | + public const SQLITE_ATTR_READONLY_STATEMENT = 1001; |
|
863 | + /** |
|
864 | + * @since 7.4 |
|
865 | + */ |
|
866 | + public const SQLITE_ATTR_EXTENDED_RESULT_CODES = 1002; |
|
867 | + |
|
868 | + /** |
|
869 | + * Provides a way to specify the action on the database session. |
|
870 | + * @since 7.2.16 |
|
871 | + * @since 7.3.3 |
|
872 | + */ |
|
873 | + public const OCI_ATTR_ACTION = 1000; |
|
874 | + |
|
875 | + /** |
|
876 | + * Provides a way to specify the client info on the database session. |
|
877 | + * @since 7.2.16 |
|
878 | + * @since 7.3.3 |
|
879 | + */ |
|
880 | + public const OCI_ATTR_CLIENT_INFO = 1001; |
|
881 | + |
|
882 | + /** |
|
883 | + * Provides a way to specify the client identifier on the database session. |
|
884 | + * @since 7.2.16 |
|
885 | + * @since 7.3.3 |
|
886 | + */ |
|
887 | + public const OCI_ATTR_CLIENT_IDENTIFIER = 1002; |
|
888 | + |
|
889 | + /** |
|
890 | + * Provides a way to specify the module on the database session. |
|
891 | + * @since 7.2.16 |
|
892 | + * @since 7.3.3 |
|
893 | + */ |
|
894 | + public const OCI_ATTR_MODULE = 1003; |
|
895 | + |
|
896 | + /** |
|
897 | + * The number of milliseconds to wait for individual round trips to the database to complete before timing out. |
|
898 | + * @since 8.0 |
|
899 | + */ |
|
900 | + public const OCI_ATTR_CALL_TIMEOUT = 1004; |
|
901 | + |
|
902 | + /** |
|
903 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
904 | + * Creates a PDO instance representing a connection to a database |
|
905 | + * @link https://php.net/manual/en/pdo.construct.php |
|
906 | + * @param string $dsn |
|
907 | + * @param string $username [optional] |
|
908 | + * @param string $password [optional] |
|
909 | + * @param array $options [optional] |
|
910 | + * @throws PDOException if the attempt to connect to the requested database fails. |
|
911 | + */ |
|
912 | + public function __construct( |
|
913 | + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $dsn, |
|
914 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $username = null, |
|
915 | + #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $password = null, |
|
916 | + #[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $options = null |
|
917 | + ) {} |
|
918 | + |
|
919 | + /** |
|
920 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
921 | + * Prepares a statement for execution and returns a statement object |
|
922 | + * @link https://php.net/manual/en/pdo.prepare.php |
|
923 | + * @param string $query <p> |
|
924 | + * This must be a valid SQL statement for the target database server. |
|
925 | + * </p> |
|
926 | + * @param array $options [optional] <p> |
|
927 | + * This array holds one or more key=>value pairs to set |
|
928 | + * attribute values for the <b>PDOStatement</b> object that this method |
|
929 | + * returns. You would most commonly use this to set the |
|
930 | + * <b>PDO::ATTR_CURSOR</b> value to |
|
931 | + * <b>PDO::CURSOR_SCROLL</b> to request a scrollable cursor. |
|
932 | + * Some drivers have driver specific options that may be set at |
|
933 | + * prepare-time. |
|
934 | + * </p> |
|
935 | + * @return PDOStatement|false If the database server successfully prepares the statement, |
|
936 | + * <b>PDO::prepare</b> returns a |
|
937 | + * <b>PDOStatement</b> object. |
|
938 | + * If the database server cannot successfully prepare the statement, |
|
939 | + * <b>PDO::prepare</b> returns <b>FALSE</b> or emits |
|
940 | + * <b>PDOException</b> (depending on error handling). |
|
941 | + * </p> |
|
942 | + * <p> |
|
943 | + * Emulated prepared statements does not communicate with the database server |
|
944 | + * so <b>PDO::prepare</b> does not check the statement. |
|
945 | + */ |
|
946 | + #[TentativeType] |
|
947 | + public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []): PDOStatement|false {} |
|
948 | + |
|
949 | + /** |
|
950 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
951 | + * Initiates a transaction |
|
952 | + * <p> |
|
953 | + * Turns off autocommit mode. While autocommit mode is turned off, |
|
954 | + * changes made to the database via the PDO object instance are not committed |
|
955 | + * until you end the transaction by calling {@link PDO::commit()}. |
|
956 | + * Calling {@link PDO::rollBack()} will roll back all changes to the database and |
|
957 | + * return the connection to autocommit mode. |
|
958 | + * </p> |
|
959 | + * <p> |
|
960 | + * Some databases, including MySQL, automatically issue an implicit COMMIT |
|
961 | + * when a database definition language (DDL) statement |
|
962 | + * such as DROP TABLE or CREATE TABLE is issued within a transaction. |
|
963 | + * The implicit COMMIT will prevent you from rolling back any other changes |
|
964 | + * within the transaction boundary. |
|
965 | + * </p> |
|
966 | + * @link https://php.net/manual/en/pdo.begintransaction.php |
|
967 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
968 | + * @throws PDOException If there is already a transaction started or |
|
969 | + * the driver does not support transactions <br/> |
|
970 | + * <b>Note</b>: An exception is raised even when the <b>PDO::ATTR_ERRMODE</b> |
|
971 | + * attribute is not <b>PDO::ERRMODE_EXCEPTION</b>. |
|
972 | + */ |
|
973 | + #[TentativeType] |
|
974 | + public function beginTransaction(): bool {} |
|
975 | + |
|
976 | + /** |
|
977 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
978 | + * Commits a transaction |
|
979 | + * @link https://php.net/manual/en/pdo.commit.php |
|
980 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
981 | + * @throws PDOException if there is no active transaction. |
|
982 | + */ |
|
983 | + #[TentativeType] |
|
984 | + public function commit(): bool {} |
|
985 | + |
|
986 | + /** |
|
987 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
988 | + * Rolls back a transaction |
|
989 | + * @link https://php.net/manual/en/pdo.rollback.php |
|
990 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
991 | + * @throws PDOException if there is no active transaction. |
|
992 | + */ |
|
993 | + #[TentativeType] |
|
994 | + public function rollBack(): bool {} |
|
995 | + |
|
996 | + /** |
|
997 | + * (PHP 5 >= 5.3.3, Bundled pdo_pgsql, PHP 7)<br/> |
|
998 | + * Checks if inside a transaction |
|
999 | + * @link https://php.net/manual/en/pdo.intransaction.php |
|
1000 | + * @return bool <b>TRUE</b> if a transaction is currently active, and <b>FALSE</b> if not. |
|
1001 | + */ |
|
1002 | + #[TentativeType] |
|
1003 | + public function inTransaction(): bool {} |
|
1004 | + |
|
1005 | + /** |
|
1006 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1007 | + * Set an attribute |
|
1008 | + * @link https://php.net/manual/en/pdo.setattribute.php |
|
1009 | + * @param int $attribute |
|
1010 | + * @param mixed $value |
|
1011 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1012 | + */ |
|
1013 | + #[TentativeType] |
|
1014 | + public function setAttribute( |
|
1015 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, |
|
1016 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value |
|
1017 | + ): bool {} |
|
1018 | + |
|
1019 | + /** |
|
1020 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1021 | + * Execute an SQL statement and return the number of affected rows |
|
1022 | + * @link https://php.net/manual/en/pdo.exec.php |
|
1023 | + * @param string $statement <p> |
|
1024 | + * The SQL statement to prepare and execute. |
|
1025 | + * </p> |
|
1026 | + * <p> |
|
1027 | + * Data inside the query should be properly escaped. |
|
1028 | + * </p> |
|
1029 | + * @return int|false <b>PDO::exec</b> returns the number of rows that were modified |
|
1030 | + * or deleted by the SQL statement you issued. If no rows were affected, |
|
1031 | + * <b>PDO::exec</b> returns 0. |
|
1032 | + * </p> |
|
1033 | + * This function may |
|
1034 | + * return Boolean <b>FALSE</b>, but may also return a non-Boolean value which |
|
1035 | + * evaluates to <b>FALSE</b>. Please read the section on Booleans for more |
|
1036 | + * information. Use the === |
|
1037 | + * operator for testing the return value of this |
|
1038 | + * function. |
|
1039 | + * <p> |
|
1040 | + * The following example incorrectly relies on the return value of |
|
1041 | + * <b>PDO::exec</b>, wherein a statement that affected 0 rows |
|
1042 | + * results in a call to <b>die</b>: |
|
1043 | + * <code> |
|
1044 | + * $db->exec() or die(print_r($db->errorInfo(), true)); |
|
1045 | + * </code> |
|
1046 | + */ |
|
1047 | + #[TentativeType] |
|
1048 | + public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {} |
|
1049 | + |
|
1050 | + /** |
|
1051 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1052 | + * Executes an SQL statement, returning a result set as a PDOStatement object |
|
1053 | + * @link https://php.net/manual/en/pdo.query.php |
|
1054 | + * @param string $statement <p> |
|
1055 | + * The SQL statement to prepare and execute. |
|
1056 | + * </p> |
|
1057 | + * <p> |
|
1058 | + * Data inside the query should be properly escaped. |
|
1059 | + * </p> |
|
1060 | + * @param int $mode <p> |
|
1061 | + * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1062 | + * </p> |
|
1063 | + * @param mixed $arg3 <p> |
|
1064 | + * The second and following parameters are the same as the parameters for PDOStatement::setFetchMode. |
|
1065 | + * </p> |
|
1066 | + * @param array $ctorargs [optional] <p> |
|
1067 | + * Arguments of custom class constructor when the <i>mode</i> |
|
1068 | + * parameter is set to <b>PDO::FETCH_CLASS</b>. |
|
1069 | + * </p> |
|
1070 | + * @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b> |
|
1071 | + * on failure. |
|
1072 | + * @see PDOStatement::setFetchMode For a full description of the second and following parameters. |
|
1073 | + */ |
|
1074 | + #[PhpStormStubsElementAvailable(to: '7.4')] |
|
1075 | + public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, $arg3 = null, array $ctorargs = []) {} |
|
1076 | + |
|
1077 | + /** |
|
1078 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1079 | + * Executes an SQL statement, returning a result set as a PDOStatement object |
|
1080 | + * @link https://php.net/manual/en/pdo.query.php |
|
1081 | + * @param string $statement <p> |
|
1082 | + * The SQL statement to prepare and execute. |
|
1083 | + * </p> |
|
1084 | + * <p> |
|
1085 | + * Data inside the query should be properly escaped. |
|
1086 | + * </p> |
|
1087 | + * @param int $mode <p> |
|
1088 | + * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1089 | + * </p> |
|
1090 | + * @param mixed $fetch_mode_args <p> |
|
1091 | + * Arguments of custom class constructor when the <i>mode</i> |
|
1092 | + * parameter is set to <b>PDO::FETCH_CLASS</b>. |
|
1093 | + * </p> |
|
1094 | + * @return PDOStatement|false <b>PDO::query</b> returns a PDOStatement object, or <b>FALSE</b> |
|
1095 | + * on failure. |
|
1096 | + * @see PDOStatement::setFetchMode For a full description of the second and following parameters. |
|
1097 | + */ |
|
1098 | + #[PhpStormStubsElementAvailable('8.0')] |
|
1099 | + public function query($statement, $mode = PDO::ATTR_DEFAULT_FETCH_MODE, ...$fetch_mode_args) {} |
|
1100 | + |
|
1101 | + /** |
|
1102 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1103 | + * Returns the ID of the last inserted row or sequence value |
|
1104 | + * @link https://php.net/manual/en/pdo.lastinsertid.php |
|
1105 | + * @param string $name [optional] <p> |
|
1106 | + * Name of the sequence object from which the ID should be returned. |
|
1107 | + * </p> |
|
1108 | + * @return string|false If a sequence name was not specified for the <i>name</i> |
|
1109 | + * parameter, <b>PDO::lastInsertId</b> returns a |
|
1110 | + * string representing the row ID of the last row that was inserted into |
|
1111 | + * the database. |
|
1112 | + * </p> |
|
1113 | + * <p> |
|
1114 | + * If a sequence name was specified for the <i>name</i> |
|
1115 | + * parameter, <b>PDO::lastInsertId</b> returns a |
|
1116 | + * string representing the last value retrieved from the specified sequence |
|
1117 | + * object. |
|
1118 | + * </p> |
|
1119 | + * <p> |
|
1120 | + * If the PDO driver does not support this capability, |
|
1121 | + * <b>PDO::lastInsertId</b> triggers an |
|
1122 | + * IM001 SQLSTATE. |
|
1123 | + */ |
|
1124 | + #[TentativeType] |
|
1125 | + public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {} |
|
1126 | + |
|
1127 | + /** |
|
1128 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1129 | + * Fetch the SQLSTATE associated with the last operation on the database handle |
|
1130 | + * @link https://php.net/manual/en/pdo.errorcode.php |
|
1131 | + * @return mixed an SQLSTATE, a five characters alphanumeric identifier defined in |
|
1132 | + * the ANSI SQL-92 standard. Briefly, an SQLSTATE consists of a |
|
1133 | + * two characters class value followed by a three characters subclass value. A |
|
1134 | + * class value of 01 indicates a warning and is accompanied by a return code |
|
1135 | + * of SQL_SUCCESS_WITH_INFO. Class values other than '01', except for the |
|
1136 | + * class 'IM', indicate an error. The class 'IM' is specific to warnings |
|
1137 | + * and errors that derive from the implementation of PDO (or perhaps ODBC, |
|
1138 | + * if you're using the ODBC driver) itself. The subclass value '000' in any |
|
1139 | + * class indicates that there is no subclass for that SQLSTATE. |
|
1140 | + * </p> |
|
1141 | + * <p> |
|
1142 | + * <b>PDO::errorCode</b> only retrieves error codes for operations |
|
1143 | + * performed directly on the database handle. If you create a PDOStatement |
|
1144 | + * object through <b>PDO::prepare</b> or |
|
1145 | + * <b>PDO::query</b> and invoke an error on the statement |
|
1146 | + * handle, <b>PDO::errorCode</b> will not reflect that error. |
|
1147 | + * You must call <b>PDOStatement::errorCode</b> to return the error |
|
1148 | + * code for an operation performed on a particular statement handle. |
|
1149 | + * </p> |
|
1150 | + * <p> |
|
1151 | + * Returns <b>NULL</b> if no operation has been run on the database handle. |
|
1152 | + */ |
|
1153 | + #[TentativeType] |
|
1154 | + public function errorCode(): ?string {} |
|
1155 | + |
|
1156 | + /** |
|
1157 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1158 | + * Fetch extended error information associated with the last operation on the database handle |
|
1159 | + * @link https://php.net/manual/en/pdo.errorinfo.php |
|
1160 | + * @return array <b>PDO::errorInfo</b> returns an array of error information |
|
1161 | + * about the last operation performed by this database handle. The array |
|
1162 | + * consists of the following fields: |
|
1163 | + * <tr valign="top"> |
|
1164 | + * <td>Element</td> |
|
1165 | + * <td>Information</td> |
|
1166 | + * </tr> |
|
1167 | + * <tr valign="top"> |
|
1168 | + * <td>0</td> |
|
1169 | + * <td>SQLSTATE error code (a five characters alphanumeric identifier defined |
|
1170 | + * in the ANSI SQL standard).</td> |
|
1171 | + * </tr> |
|
1172 | + * <tr valign="top"> |
|
1173 | + * <td>1</td> |
|
1174 | + * <td>Driver-specific error code.</td> |
|
1175 | + * </tr> |
|
1176 | + * <tr valign="top"> |
|
1177 | + * <td>2</td> |
|
1178 | + * <td>Driver-specific error message.</td> |
|
1179 | + * </tr> |
|
1180 | + * </p> |
|
1181 | + * <p> |
|
1182 | + * If the SQLSTATE error code is not set or there is no driver-specific |
|
1183 | + * error, the elements following element 0 will be set to <b>NULL</b>. |
|
1184 | + * </p> |
|
1185 | + * <p> |
|
1186 | + * <b>PDO::errorInfo</b> only retrieves error information for |
|
1187 | + * operations performed directly on the database handle. If you create a |
|
1188 | + * PDOStatement object through <b>PDO::prepare</b> or |
|
1189 | + * <b>PDO::query</b> and invoke an error on the statement |
|
1190 | + * handle, <b>PDO::errorInfo</b> will not reflect the error |
|
1191 | + * from the statement handle. You must call |
|
1192 | + * <b>PDOStatement::errorInfo</b> to return the error |
|
1193 | + * information for an operation performed on a particular statement handle. |
|
1194 | + */ |
|
1195 | + #[ArrayShape([0 => "string", 1 => "int", 2 => "string"])] |
|
1196 | + #[TentativeType] |
|
1197 | + public function errorInfo(): array {} |
|
1198 | + |
|
1199 | + /** |
|
1200 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1201 | + * Retrieve a database connection attribute |
|
1202 | + * @link https://php.net/manual/en/pdo.getattribute.php |
|
1203 | + * @param int $attribute <p> |
|
1204 | + * One of the PDO::ATTR_* constants. The constants that |
|
1205 | + * apply to database connections are as follows: |
|
1206 | + * PDO::ATTR_AUTOCOMMIT |
|
1207 | + * PDO::ATTR_CASE |
|
1208 | + * PDO::ATTR_CLIENT_VERSION |
|
1209 | + * PDO::ATTR_CONNECTION_STATUS |
|
1210 | + * PDO::ATTR_DRIVER_NAME |
|
1211 | + * PDO::ATTR_ERRMODE |
|
1212 | + * PDO::ATTR_ORACLE_NULLS |
|
1213 | + * PDO::ATTR_PERSISTENT |
|
1214 | + * PDO::ATTR_PREFETCH |
|
1215 | + * PDO::ATTR_SERVER_INFO |
|
1216 | + * PDO::ATTR_SERVER_VERSION |
|
1217 | + * PDO::ATTR_TIMEOUT |
|
1218 | + * </p> |
|
1219 | + * @return mixed A successful call returns the value of the requested PDO attribute. |
|
1220 | + * An unsuccessful call returns null. |
|
1221 | + */ |
|
1222 | + #[TentativeType] |
|
1223 | + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {} |
|
1224 | + |
|
1225 | + /** |
|
1226 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.1)<br/> |
|
1227 | + * Quotes a string for use in a query. |
|
1228 | + * @link https://php.net/manual/en/pdo.quote.php |
|
1229 | + * @param string $string <p> |
|
1230 | + * The string to be quoted. |
|
1231 | + * </p> |
|
1232 | + * @param int $type [optional] <p> |
|
1233 | + * Provides a data type hint for drivers that have alternate quoting styles. |
|
1234 | + * </p> |
|
1235 | + * @return string|false a quoted string that is theoretically safe to pass into an |
|
1236 | + * SQL statement. Returns <b>FALSE</b> if the driver does not support quoting in |
|
1237 | + * this way. |
|
1238 | + */ |
|
1239 | + #[TentativeType] |
|
1240 | + public function quote( |
|
1241 | + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, |
|
1242 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT |
|
1243 | + ): string|false {} |
|
1244 | + |
|
1245 | + final public function __wakeup() {} |
|
1246 | + |
|
1247 | + final public function __sleep() {} |
|
1248 | + |
|
1249 | + /** |
|
1250 | + * (PHP 5 >= 5.1.3, PHP 7, PECL pdo >= 1.0.3)<br/> |
|
1251 | + * Return an array of available PDO drivers |
|
1252 | + * @link https://php.net/manual/en/pdo.getavailabledrivers.php |
|
1253 | + * @return array <b>PDO::getAvailableDrivers</b> returns an array of PDO driver names. If |
|
1254 | + * no drivers are available, it returns an empty array. |
|
1255 | + */ |
|
1256 | + #[TentativeType] |
|
1257 | + public static function getAvailableDrivers(): array {} |
|
1258 | + |
|
1259 | + /** |
|
1260 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo_sqlite >= 1.0.0)<br/> |
|
1261 | + * Registers a User Defined Function for use in SQL statements |
|
1262 | + * @link https://php.net/manual/en/pdo.sqlitecreatefunction.php |
|
1263 | + * @param string $function_name <p> |
|
1264 | + * The name of the function used in SQL statements. |
|
1265 | + * </p> |
|
1266 | + * @param callable $callback <p> |
|
1267 | + * Callback function to handle the defined SQL function. |
|
1268 | + * </p> |
|
1269 | + * @param int $num_args [optional] <p> |
|
1270 | + * The number of arguments that the SQL function takes. If this parameter is -1, |
|
1271 | + * then the SQL function may take any number of arguments. |
|
1272 | + * </p> |
|
1273 | + * @param int $flags [optional] <p> |
|
1274 | + * A bitwise conjunction of flags. Currently, only <b>PDO::SQLITE_DETERMINISTIC</b> is supported, |
|
1275 | + * which specifies that the function always returns the same result given the same inputs within |
|
1276 | + * a single SQL statement. |
|
1277 | + * </p> |
|
1278 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1279 | + */ |
|
1280 | + public function sqliteCreateFunction($function_name, $callback, $num_args = -1, $flags = 0) {} |
|
1281 | 1281 | } |
1282 | 1282 | |
1283 | 1283 | /** |
@@ -1288,478 +1288,478 @@ discard block |
||
1288 | 1288 | */ |
1289 | 1289 | class PDOStatement implements IteratorAggregate |
1290 | 1290 | { |
1291 | - /** |
|
1292 | - * @var string |
|
1293 | - */ |
|
1294 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
1295 | - public $queryString; |
|
1296 | - |
|
1297 | - /** |
|
1298 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1299 | - * Executes a prepared statement |
|
1300 | - * @link https://php.net/manual/en/pdostatement.execute.php |
|
1301 | - * @param array $params [optional] <p> |
|
1302 | - * An array of values with as many elements as there are bound |
|
1303 | - * parameters in the SQL statement being executed. |
|
1304 | - * All values are treated as <b>PDO::PARAM_STR</b>. |
|
1305 | - * </p> |
|
1306 | - * <p> |
|
1307 | - * You cannot bind multiple values to a single parameter; for example, |
|
1308 | - * you cannot bind two values to a single named parameter in an IN() |
|
1309 | - * clause. |
|
1310 | - * </p> |
|
1311 | - * <p> |
|
1312 | - * You cannot bind more values than specified; if more keys exist in |
|
1313 | - * <i>input_parameters</i> than in the SQL specified |
|
1314 | - * in the <b>PDO::prepare</b>, then the statement will |
|
1315 | - * fail and an error is emitted. |
|
1316 | - * </p> |
|
1317 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1318 | - * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true. |
|
1319 | - */ |
|
1320 | - #[TentativeType] |
|
1321 | - public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $params = null): bool {} |
|
1322 | - |
|
1323 | - /** |
|
1324 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1325 | - * Fetches the next row from a result set |
|
1326 | - * @link https://php.net/manual/en/pdostatement.fetch.php |
|
1327 | - * @param int $mode [optional] <p> |
|
1328 | - * Controls how the next row will be returned to the caller. This value |
|
1329 | - * must be one of the PDO::FETCH_* constants, |
|
1330 | - * defaulting to value of PDO::ATTR_DEFAULT_FETCH_MODE |
|
1331 | - * (which defaults to PDO::FETCH_BOTH). |
|
1332 | - * </p> |
|
1333 | - * <p> |
|
1334 | - * PDO::FETCH_ASSOC: returns an array indexed by column |
|
1335 | - * name as returned in your result set |
|
1336 | - * </p> |
|
1337 | - * @param int $cursorOrientation [optional] <p> |
|
1338 | - * For a PDOStatement object representing a scrollable cursor, this |
|
1339 | - * value determines which row will be returned to the caller. This value |
|
1340 | - * must be one of the PDO::FETCH_ORI_* constants, |
|
1341 | - * defaulting to PDO::FETCH_ORI_NEXT. To request a |
|
1342 | - * scrollable cursor for your PDOStatement object, you must set the |
|
1343 | - * PDO::ATTR_CURSOR attribute to |
|
1344 | - * PDO::CURSOR_SCROLL when you prepare the SQL |
|
1345 | - * statement with <b>PDO::prepare</b>. |
|
1346 | - * </p> |
|
1347 | - * @param int $cursorOffset [optional] |
|
1348 | - * @return mixed The return value of this function on success depends on the fetch type. In |
|
1349 | - * all cases, <b>FALSE</b> is returned on failure. |
|
1350 | - */ |
|
1351 | - #[TentativeType] |
|
1352 | - public function fetch( |
|
1353 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, |
|
1354 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOrientation = PDO::FETCH_ORI_NEXT, |
|
1355 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOffset = 0 |
|
1356 | - ): mixed {} |
|
1357 | - |
|
1358 | - /** |
|
1359 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1360 | - * Binds a parameter to the specified variable name |
|
1361 | - * @link https://php.net/manual/en/pdostatement.bindparam.php |
|
1362 | - * @param mixed $param <p> |
|
1363 | - * Parameter identifier. For a prepared statement using named |
|
1364 | - * placeholders, this will be a parameter name of the form |
|
1365 | - * :name. For a prepared statement using |
|
1366 | - * question mark placeholders, this will be the 1-indexed position of |
|
1367 | - * the parameter. |
|
1368 | - * </p> |
|
1369 | - * @param mixed &$var <p> |
|
1370 | - * Name of the PHP variable to bind to the SQL statement parameter. |
|
1371 | - * </p> |
|
1372 | - * @param int $type [optional] <p> |
|
1373 | - * Explicit data type for the parameter using the PDO::PARAM_* |
|
1374 | - * constants. |
|
1375 | - * To return an INOUT parameter from a stored procedure, |
|
1376 | - * use the bitwise OR operator to set the PDO::PARAM_INPUT_OUTPUT bits |
|
1377 | - * for the <i>data_type</i> parameter. |
|
1378 | - * </p> |
|
1379 | - * @param int $maxLength [optional] <p> |
|
1380 | - * Length of the data type. To indicate that a parameter is an OUT |
|
1381 | - * parameter from a stored procedure, you must explicitly set the |
|
1382 | - * length. |
|
1383 | - * </p> |
|
1384 | - * @param mixed $driverOptions [optional] <p> |
|
1385 | - * </p> |
|
1386 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1387 | - */ |
|
1388 | - #[TentativeType] |
|
1389 | - public function bindParam( |
|
1390 | - #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, |
|
1391 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, |
|
1392 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, |
|
1393 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, |
|
1394 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null |
|
1395 | - ): bool {} |
|
1396 | - |
|
1397 | - /** |
|
1398 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1399 | - * Bind a column to a PHP variable |
|
1400 | - * @link https://php.net/manual/en/pdostatement.bindcolumn.php |
|
1401 | - * @param mixed $column <p> |
|
1402 | - * Number of the column (1-indexed) or name of the column in the result set. |
|
1403 | - * If using the column name, be aware that the name should match the |
|
1404 | - * case of the column, as returned by the driver. |
|
1405 | - * </p> |
|
1406 | - * @param mixed &$var <p> |
|
1407 | - * Name of the PHP variable to which the column will be bound. |
|
1408 | - * </p> |
|
1409 | - * @param int $type [optional] <p> |
|
1410 | - * Data type of the parameter, specified by the PDO::PARAM_* constants. |
|
1411 | - * </p> |
|
1412 | - * @param int $maxLength [optional] <p> |
|
1413 | - * A hint for pre-allocation. |
|
1414 | - * </p> |
|
1415 | - * @param mixed $driverOptions [optional] <p> |
|
1416 | - * Optional parameter(s) for the driver. |
|
1417 | - * </p> |
|
1418 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1419 | - */ |
|
1420 | - #[TentativeType] |
|
1421 | - public function bindColumn( |
|
1422 | - #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column, |
|
1423 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, |
|
1424 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, |
|
1425 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, |
|
1426 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null |
|
1427 | - ): bool {} |
|
1428 | - |
|
1429 | - /** |
|
1430 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 1.0.0)<br/> |
|
1431 | - * Binds a value to a parameter |
|
1432 | - * @link https://php.net/manual/en/pdostatement.bindvalue.php |
|
1433 | - * @param mixed $param <p> |
|
1434 | - * Parameter identifier. For a prepared statement using named |
|
1435 | - * placeholders, this will be a parameter name of the form |
|
1436 | - * :name. For a prepared statement using |
|
1437 | - * question mark placeholders, this will be the 1-indexed position of |
|
1438 | - * the parameter. |
|
1439 | - * </p> |
|
1440 | - * @param mixed $value <p> |
|
1441 | - * The value to bind to the parameter. |
|
1442 | - * </p> |
|
1443 | - * @param int $type [optional] <p> |
|
1444 | - * Explicit data type for the parameter using the PDO::PARAM_* |
|
1445 | - * constants. |
|
1446 | - * </p> |
|
1447 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1448 | - */ |
|
1449 | - #[TentativeType] |
|
1450 | - public function bindValue( |
|
1451 | - #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, |
|
1452 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value, |
|
1453 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT |
|
1454 | - ): bool {} |
|
1455 | - |
|
1456 | - /** |
|
1457 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1458 | - * Returns the number of rows affected by the last SQL statement |
|
1459 | - * @link https://php.net/manual/en/pdostatement.rowcount.php |
|
1460 | - * @return int the number of rows. |
|
1461 | - */ |
|
1462 | - #[TentativeType] |
|
1463 | - public function rowCount(): int {} |
|
1464 | - |
|
1465 | - /** |
|
1466 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)<br/> |
|
1467 | - * Returns a single column from the next row of a result set |
|
1468 | - * @link https://php.net/manual/en/pdostatement.fetchcolumn.php |
|
1469 | - * @param int $column [optional] <p> |
|
1470 | - * 0-indexed number of the column you wish to retrieve from the row. If |
|
1471 | - * no value is supplied, <b>PDOStatement::fetchColumn</b> |
|
1472 | - * fetches the first column. |
|
1473 | - * </p> |
|
1474 | - * @return mixed Returns a single column from the next row of a result |
|
1475 | - * set or FALSE if there are no more rows. |
|
1476 | - * </p> |
|
1477 | - * <p> |
|
1478 | - * There is no way to return another column from the same row if you |
|
1479 | - * use <b>PDOStatement::fetchColumn</b> to retrieve data. |
|
1480 | - */ |
|
1481 | - #[TentativeType] |
|
1482 | - public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0): mixed {} |
|
1483 | - |
|
1484 | - /** |
|
1485 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1486 | - * Returns an array containing all of the result set rows |
|
1487 | - * @link https://php.net/manual/en/pdostatement.fetchall.php |
|
1488 | - * @param int $mode [optional] <p> |
|
1489 | - * Controls the contents of the returned array as documented in |
|
1490 | - * <b>PDOStatement::fetch</b>. |
|
1491 | - * Defaults to value of <b>PDO::ATTR_DEFAULT_FETCH_MODE</b> |
|
1492 | - * (which defaults to <b>PDO::FETCH_BOTH</b>) |
|
1493 | - * </p> |
|
1494 | - * <p> |
|
1495 | - * To return an array consisting of all values of a single column from |
|
1496 | - * the result set, specify <b>PDO::FETCH_COLUMN</b>. You |
|
1497 | - * can specify which column you want with the |
|
1498 | - * <i>column-index</i> parameter. |
|
1499 | - * </p> |
|
1500 | - * <p> |
|
1501 | - * To fetch only the unique values of a single column from the result set, |
|
1502 | - * bitwise-OR <b>PDO::FETCH_COLUMN</b> with |
|
1503 | - * <b>PDO::FETCH_UNIQUE</b>. |
|
1504 | - * </p> |
|
1505 | - * <p> |
|
1506 | - * To return an associative array grouped by the values of a specified |
|
1507 | - * column, bitwise-OR <b>PDO::FETCH_COLUMN</b> with |
|
1508 | - * <b>PDO::FETCH_GROUP</b>. |
|
1509 | - * </p> |
|
1510 | - * @param mixed ...$args [optional] <p> |
|
1511 | - * Arguments of custom class constructor when the <i>fetch_style</i> |
|
1512 | - * parameter is <b>PDO::FETCH_CLASS</b>. |
|
1513 | - * </p> |
|
1514 | - * @return array|false <b>PDOStatement::fetchAll</b> returns an array containing |
|
1515 | - * all of the remaining rows in the result set. The array represents each |
|
1516 | - * row as either an array of column values or an object with properties |
|
1517 | - * corresponding to each column name. |
|
1518 | - * An empty array is returned if there are zero results to fetch, or false on failure. |
|
1519 | - * </p> |
|
1520 | - * <p> |
|
1521 | - * Using this method to fetch large result sets will result in a heavy |
|
1522 | - * demand on system and possibly network resources. Rather than retrieving |
|
1523 | - * all of the data and manipulating it in PHP, consider using the database |
|
1524 | - * server to manipulate the result sets. For example, use the WHERE and |
|
1525 | - * ORDER BY clauses in SQL to restrict results before retrieving and |
|
1526 | - * processing them with PHP. |
|
1527 | - */ |
|
1528 | - #[TentativeType] |
|
1529 | - public function fetchAll( |
|
1530 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, |
|
1531 | - #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $fetch_argument = null, |
|
1532 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args |
|
1533 | - ): array {} |
|
1534 | - |
|
1535 | - /** |
|
1536 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.4)<br/> |
|
1537 | - * Fetches the next row and returns it as an object. |
|
1538 | - * @link https://php.net/manual/en/pdostatement.fetchobject.php |
|
1539 | - * @param string $class [optional] <p> |
|
1540 | - * Name of the created class. |
|
1541 | - * </p> |
|
1542 | - * @param array $constructorArgs [optional] <p> |
|
1543 | - * Elements of this array are passed to the constructor. |
|
1544 | - * </p> |
|
1545 | - * @return mixed an instance of the required class with property names that |
|
1546 | - * correspond to the column names or <b>FALSE</b> on failure. |
|
1547 | - */ |
|
1548 | - #[TentativeType] |
|
1549 | - public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []): object|false {} |
|
1550 | - |
|
1551 | - /** |
|
1552 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1553 | - * Fetch the SQLSTATE associated with the last operation on the statement handle |
|
1554 | - * @link https://php.net/manual/en/pdostatement.errorcode.php |
|
1555 | - * @return string Identical to <b>PDO::errorCode</b>, except that |
|
1556 | - * <b>PDOStatement::errorCode</b> only retrieves error codes |
|
1557 | - * for operations performed with PDOStatement objects. |
|
1558 | - */ |
|
1559 | - #[TentativeType] |
|
1560 | - public function errorCode(): ?string {} |
|
1561 | - |
|
1562 | - /** |
|
1563 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1564 | - * Fetch extended error information associated with the last operation on the statement handle |
|
1565 | - * @link https://php.net/manual/en/pdostatement.errorinfo.php |
|
1566 | - * @return array <b>PDOStatement::errorInfo</b> returns an array of |
|
1567 | - * error information about the last operation performed by this |
|
1568 | - * statement handle. The array consists of the following fields: |
|
1569 | - * <tr valign="top"> |
|
1570 | - * <td>Element</td> |
|
1571 | - * <td>Information</td> |
|
1572 | - * </tr> |
|
1573 | - * <tr valign="top"> |
|
1574 | - * <td>0</td> |
|
1575 | - * <td>SQLSTATE error code (a five characters alphanumeric identifier defined |
|
1576 | - * in the ANSI SQL standard).</td> |
|
1577 | - * </tr> |
|
1578 | - * <tr valign="top"> |
|
1579 | - * <td>1</td> |
|
1580 | - * <td>Driver specific error code.</td> |
|
1581 | - * </tr> |
|
1582 | - * <tr valign="top"> |
|
1583 | - * <td>2</td> |
|
1584 | - * <td>Driver specific error message.</td> |
|
1585 | - * </tr> |
|
1586 | - */ |
|
1587 | - #[ArrayShape([0 => "string", 1 => "int", 2 => "string"])] |
|
1588 | - #[TentativeType] |
|
1589 | - public function errorInfo(): array {} |
|
1590 | - |
|
1591 | - /** |
|
1592 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1593 | - * Set a statement attribute |
|
1594 | - * @link https://php.net/manual/en/pdostatement.setattribute.php |
|
1595 | - * @param int $attribute |
|
1596 | - * @param mixed $value |
|
1597 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1598 | - */ |
|
1599 | - #[TentativeType] |
|
1600 | - public function setAttribute( |
|
1601 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, |
|
1602 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value |
|
1603 | - ): bool {} |
|
1604 | - |
|
1605 | - /** |
|
1606 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1607 | - * Retrieve a statement attribute |
|
1608 | - * @link https://php.net/manual/en/pdostatement.getattribute.php |
|
1609 | - * @param int $name |
|
1610 | - * @return mixed the attribute value. |
|
1611 | - */ |
|
1612 | - #[TentativeType] |
|
1613 | - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $name): mixed {} |
|
1614 | - |
|
1615 | - /** |
|
1616 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1617 | - * Returns the number of columns in the result set |
|
1618 | - * @link https://php.net/manual/en/pdostatement.columncount.php |
|
1619 | - * @return int the number of columns in the result set represented by the |
|
1620 | - * PDOStatement object. If there is no result set, |
|
1621 | - * <b>PDOStatement::columnCount</b> returns 0. |
|
1622 | - */ |
|
1623 | - #[TentativeType] |
|
1624 | - public function columnCount(): int {} |
|
1625 | - |
|
1626 | - /** |
|
1627 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1628 | - * Returns metadata for a column in a result set |
|
1629 | - * @link https://php.net/manual/en/pdostatement.getcolumnmeta.php |
|
1630 | - * @param int $column <p> |
|
1631 | - * The 0-indexed column in the result set. |
|
1632 | - * </p> |
|
1633 | - * @return array|false an associative array containing the following values representing |
|
1634 | - * the metadata for a single column: |
|
1635 | - * </p> |
|
1636 | - * <table> |
|
1637 | - * Column metadata |
|
1638 | - * <tr valign="top"> |
|
1639 | - * <td>Name</td> |
|
1640 | - * <td>Value</td> |
|
1641 | - * </tr> |
|
1642 | - * <tr valign="top"> |
|
1643 | - * <td>native_type</td> |
|
1644 | - * <td>The PHP native type used to represent the column value.</td> |
|
1645 | - * </tr> |
|
1646 | - * <tr valign="top"> |
|
1647 | - * <td>driver:decl_type</td> |
|
1648 | - * <td>The SQL type used to represent the column value in the database. |
|
1649 | - * If the column in the result set is the result of a function, this value |
|
1650 | - * is not returned by <b>PDOStatement::getColumnMeta</b>. |
|
1651 | - * </td> |
|
1652 | - * </tr> |
|
1653 | - * <tr valign="top"> |
|
1654 | - * <td>flags</td> |
|
1655 | - * <td>Any flags set for this column.</td> |
|
1656 | - * </tr> |
|
1657 | - * <tr valign="top"> |
|
1658 | - * <td>name</td> |
|
1659 | - * <td>The name of this column as returned by the database.</td> |
|
1660 | - * </tr> |
|
1661 | - * <tr valign="top"> |
|
1662 | - * <td>table</td> |
|
1663 | - * <td>The name of this column's table as returned by the database.</td> |
|
1664 | - * </tr> |
|
1665 | - * <tr valign="top"> |
|
1666 | - * <td>len</td> |
|
1667 | - * <td>The length of this column. Normally -1 for |
|
1668 | - * types other than floating point decimals.</td> |
|
1669 | - * </tr> |
|
1670 | - * <tr valign="top"> |
|
1671 | - * <td>precision</td> |
|
1672 | - * <td>The numeric precision of this column. Normally |
|
1673 | - * 0 for types other than floating point |
|
1674 | - * decimals.</td> |
|
1675 | - * </tr> |
|
1676 | - * <tr valign="top"> |
|
1677 | - * <td>pdo_type</td> |
|
1678 | - * <td>The type of this column as represented by the |
|
1679 | - * PDO::PARAM_* constants.</td> |
|
1680 | - * </tr> |
|
1681 | - * </table> |
|
1682 | - * <p> |
|
1683 | - * Returns <b>FALSE</b> if the requested column does not exist in the result set, |
|
1684 | - * or if no result set exists. |
|
1685 | - */ |
|
1686 | - #[TentativeType] |
|
1687 | - public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {} |
|
1688 | - |
|
1689 | - /** |
|
1690 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1691 | - * Set the default fetch mode for this statement |
|
1692 | - * @link https://php.net/manual/en/pdostatement.setfetchmode.php |
|
1693 | - * @param int $mode <p> |
|
1694 | - * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1695 | - * </p> |
|
1696 | - * @param null|string|object $className [optional] <p> |
|
1697 | - * Class name or object |
|
1698 | - * </p> |
|
1699 | - * @param array $params [optional] <p> Constructor arguments. </p> |
|
1700 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1701 | - */ |
|
1702 | - #[PhpStormStubsElementAvailable(to: '7.4')] |
|
1703 | - public function setFetchMode($mode, $className = null, array $params = []) {} |
|
1704 | - |
|
1705 | - /** |
|
1706 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1707 | - * Set the default fetch mode for this statement |
|
1708 | - * @link https://php.net/manual/en/pdostatement.setfetchmode.php |
|
1709 | - * @param int $mode <p> |
|
1710 | - * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1711 | - * </p> |
|
1712 | - * @param string|object|null $className [optional] <p> |
|
1713 | - * Class name or object |
|
1714 | - * </p> |
|
1715 | - * @param mixed ...$params <p> Constructor arguments. </p> |
|
1716 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1717 | - */ |
|
1718 | - #[PhpStormStubsElementAvailable('8.0')] |
|
1719 | - public function setFetchMode($mode, $className = null, ...$params) {} |
|
1720 | - |
|
1721 | - /** |
|
1722 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1723 | - * Advances to the next rowset in a multi-rowset statement handle |
|
1724 | - * @link https://php.net/manual/en/pdostatement.nextrowset.php |
|
1725 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1726 | - */ |
|
1727 | - #[TentativeType] |
|
1728 | - public function nextRowset(): bool {} |
|
1729 | - |
|
1730 | - /** |
|
1731 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)<br/> |
|
1732 | - * Closes the cursor, enabling the statement to be executed again. |
|
1733 | - * @link https://php.net/manual/en/pdostatement.closecursor.php |
|
1734 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1735 | - */ |
|
1736 | - #[TentativeType] |
|
1737 | - public function closeCursor(): bool {} |
|
1738 | - |
|
1739 | - /** |
|
1740 | - * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)<br/> |
|
1741 | - * Dump an SQL prepared command |
|
1742 | - * @link https://php.net/manual/en/pdostatement.debugdumpparams.php |
|
1743 | - * @return bool|null No value is returned. |
|
1744 | - */ |
|
1745 | - #[TentativeType] |
|
1746 | - public function debugDumpParams(): ?bool {} |
|
1747 | - |
|
1748 | - final public function __wakeup() {} |
|
1749 | - |
|
1750 | - final public function __sleep() {} |
|
1751 | - |
|
1752 | - /** |
|
1753 | - * @return Iterator |
|
1754 | - * @since 8.0 |
|
1755 | - */ |
|
1756 | - public function getIterator(): Iterator {} |
|
1291 | + /** |
|
1292 | + * @var string |
|
1293 | + */ |
|
1294 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
1295 | + public $queryString; |
|
1296 | + |
|
1297 | + /** |
|
1298 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1299 | + * Executes a prepared statement |
|
1300 | + * @link https://php.net/manual/en/pdostatement.execute.php |
|
1301 | + * @param array $params [optional] <p> |
|
1302 | + * An array of values with as many elements as there are bound |
|
1303 | + * parameters in the SQL statement being executed. |
|
1304 | + * All values are treated as <b>PDO::PARAM_STR</b>. |
|
1305 | + * </p> |
|
1306 | + * <p> |
|
1307 | + * You cannot bind multiple values to a single parameter; for example, |
|
1308 | + * you cannot bind two values to a single named parameter in an IN() |
|
1309 | + * clause. |
|
1310 | + * </p> |
|
1311 | + * <p> |
|
1312 | + * You cannot bind more values than specified; if more keys exist in |
|
1313 | + * <i>input_parameters</i> than in the SQL specified |
|
1314 | + * in the <b>PDO::prepare</b>, then the statement will |
|
1315 | + * fail and an error is emitted. |
|
1316 | + * </p> |
|
1317 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1318 | + * @throws PDOException On error if PDO::ERRMODE_EXCEPTION option is true. |
|
1319 | + */ |
|
1320 | + #[TentativeType] |
|
1321 | + public function execute(#[LanguageLevelTypeAware(['8.0' => 'array|null'], default: '')] $params = null): bool {} |
|
1322 | + |
|
1323 | + /** |
|
1324 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1325 | + * Fetches the next row from a result set |
|
1326 | + * @link https://php.net/manual/en/pdostatement.fetch.php |
|
1327 | + * @param int $mode [optional] <p> |
|
1328 | + * Controls how the next row will be returned to the caller. This value |
|
1329 | + * must be one of the PDO::FETCH_* constants, |
|
1330 | + * defaulting to value of PDO::ATTR_DEFAULT_FETCH_MODE |
|
1331 | + * (which defaults to PDO::FETCH_BOTH). |
|
1332 | + * </p> |
|
1333 | + * <p> |
|
1334 | + * PDO::FETCH_ASSOC: returns an array indexed by column |
|
1335 | + * name as returned in your result set |
|
1336 | + * </p> |
|
1337 | + * @param int $cursorOrientation [optional] <p> |
|
1338 | + * For a PDOStatement object representing a scrollable cursor, this |
|
1339 | + * value determines which row will be returned to the caller. This value |
|
1340 | + * must be one of the PDO::FETCH_ORI_* constants, |
|
1341 | + * defaulting to PDO::FETCH_ORI_NEXT. To request a |
|
1342 | + * scrollable cursor for your PDOStatement object, you must set the |
|
1343 | + * PDO::ATTR_CURSOR attribute to |
|
1344 | + * PDO::CURSOR_SCROLL when you prepare the SQL |
|
1345 | + * statement with <b>PDO::prepare</b>. |
|
1346 | + * </p> |
|
1347 | + * @param int $cursorOffset [optional] |
|
1348 | + * @return mixed The return value of this function on success depends on the fetch type. In |
|
1349 | + * all cases, <b>FALSE</b> is returned on failure. |
|
1350 | + */ |
|
1351 | + #[TentativeType] |
|
1352 | + public function fetch( |
|
1353 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, |
|
1354 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOrientation = PDO::FETCH_ORI_NEXT, |
|
1355 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $cursorOffset = 0 |
|
1356 | + ): mixed {} |
|
1357 | + |
|
1358 | + /** |
|
1359 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1360 | + * Binds a parameter to the specified variable name |
|
1361 | + * @link https://php.net/manual/en/pdostatement.bindparam.php |
|
1362 | + * @param mixed $param <p> |
|
1363 | + * Parameter identifier. For a prepared statement using named |
|
1364 | + * placeholders, this will be a parameter name of the form |
|
1365 | + * :name. For a prepared statement using |
|
1366 | + * question mark placeholders, this will be the 1-indexed position of |
|
1367 | + * the parameter. |
|
1368 | + * </p> |
|
1369 | + * @param mixed &$var <p> |
|
1370 | + * Name of the PHP variable to bind to the SQL statement parameter. |
|
1371 | + * </p> |
|
1372 | + * @param int $type [optional] <p> |
|
1373 | + * Explicit data type for the parameter using the PDO::PARAM_* |
|
1374 | + * constants. |
|
1375 | + * To return an INOUT parameter from a stored procedure, |
|
1376 | + * use the bitwise OR operator to set the PDO::PARAM_INPUT_OUTPUT bits |
|
1377 | + * for the <i>data_type</i> parameter. |
|
1378 | + * </p> |
|
1379 | + * @param int $maxLength [optional] <p> |
|
1380 | + * Length of the data type. To indicate that a parameter is an OUT |
|
1381 | + * parameter from a stored procedure, you must explicitly set the |
|
1382 | + * length. |
|
1383 | + * </p> |
|
1384 | + * @param mixed $driverOptions [optional] <p> |
|
1385 | + * </p> |
|
1386 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1387 | + */ |
|
1388 | + #[TentativeType] |
|
1389 | + public function bindParam( |
|
1390 | + #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, |
|
1391 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, |
|
1392 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, |
|
1393 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, |
|
1394 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null |
|
1395 | + ): bool {} |
|
1396 | + |
|
1397 | + /** |
|
1398 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1399 | + * Bind a column to a PHP variable |
|
1400 | + * @link https://php.net/manual/en/pdostatement.bindcolumn.php |
|
1401 | + * @param mixed $column <p> |
|
1402 | + * Number of the column (1-indexed) or name of the column in the result set. |
|
1403 | + * If using the column name, be aware that the name should match the |
|
1404 | + * case of the column, as returned by the driver. |
|
1405 | + * </p> |
|
1406 | + * @param mixed &$var <p> |
|
1407 | + * Name of the PHP variable to which the column will be bound. |
|
1408 | + * </p> |
|
1409 | + * @param int $type [optional] <p> |
|
1410 | + * Data type of the parameter, specified by the PDO::PARAM_* constants. |
|
1411 | + * </p> |
|
1412 | + * @param int $maxLength [optional] <p> |
|
1413 | + * A hint for pre-allocation. |
|
1414 | + * </p> |
|
1415 | + * @param mixed $driverOptions [optional] <p> |
|
1416 | + * Optional parameter(s) for the driver. |
|
1417 | + * </p> |
|
1418 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1419 | + */ |
|
1420 | + #[TentativeType] |
|
1421 | + public function bindColumn( |
|
1422 | + #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column, |
|
1423 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, |
|
1424 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, |
|
1425 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, |
|
1426 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null |
|
1427 | + ): bool {} |
|
1428 | + |
|
1429 | + /** |
|
1430 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 1.0.0)<br/> |
|
1431 | + * Binds a value to a parameter |
|
1432 | + * @link https://php.net/manual/en/pdostatement.bindvalue.php |
|
1433 | + * @param mixed $param <p> |
|
1434 | + * Parameter identifier. For a prepared statement using named |
|
1435 | + * placeholders, this will be a parameter name of the form |
|
1436 | + * :name. For a prepared statement using |
|
1437 | + * question mark placeholders, this will be the 1-indexed position of |
|
1438 | + * the parameter. |
|
1439 | + * </p> |
|
1440 | + * @param mixed $value <p> |
|
1441 | + * The value to bind to the parameter. |
|
1442 | + * </p> |
|
1443 | + * @param int $type [optional] <p> |
|
1444 | + * Explicit data type for the parameter using the PDO::PARAM_* |
|
1445 | + * constants. |
|
1446 | + * </p> |
|
1447 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1448 | + */ |
|
1449 | + #[TentativeType] |
|
1450 | + public function bindValue( |
|
1451 | + #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, |
|
1452 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value, |
|
1453 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT |
|
1454 | + ): bool {} |
|
1455 | + |
|
1456 | + /** |
|
1457 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1458 | + * Returns the number of rows affected by the last SQL statement |
|
1459 | + * @link https://php.net/manual/en/pdostatement.rowcount.php |
|
1460 | + * @return int the number of rows. |
|
1461 | + */ |
|
1462 | + #[TentativeType] |
|
1463 | + public function rowCount(): int {} |
|
1464 | + |
|
1465 | + /** |
|
1466 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)<br/> |
|
1467 | + * Returns a single column from the next row of a result set |
|
1468 | + * @link https://php.net/manual/en/pdostatement.fetchcolumn.php |
|
1469 | + * @param int $column [optional] <p> |
|
1470 | + * 0-indexed number of the column you wish to retrieve from the row. If |
|
1471 | + * no value is supplied, <b>PDOStatement::fetchColumn</b> |
|
1472 | + * fetches the first column. |
|
1473 | + * </p> |
|
1474 | + * @return mixed Returns a single column from the next row of a result |
|
1475 | + * set or FALSE if there are no more rows. |
|
1476 | + * </p> |
|
1477 | + * <p> |
|
1478 | + * There is no way to return another column from the same row if you |
|
1479 | + * use <b>PDOStatement::fetchColumn</b> to retrieve data. |
|
1480 | + */ |
|
1481 | + #[TentativeType] |
|
1482 | + public function fetchColumn(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column = 0): mixed {} |
|
1483 | + |
|
1484 | + /** |
|
1485 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1486 | + * Returns an array containing all of the result set rows |
|
1487 | + * @link https://php.net/manual/en/pdostatement.fetchall.php |
|
1488 | + * @param int $mode [optional] <p> |
|
1489 | + * Controls the contents of the returned array as documented in |
|
1490 | + * <b>PDOStatement::fetch</b>. |
|
1491 | + * Defaults to value of <b>PDO::ATTR_DEFAULT_FETCH_MODE</b> |
|
1492 | + * (which defaults to <b>PDO::FETCH_BOTH</b>) |
|
1493 | + * </p> |
|
1494 | + * <p> |
|
1495 | + * To return an array consisting of all values of a single column from |
|
1496 | + * the result set, specify <b>PDO::FETCH_COLUMN</b>. You |
|
1497 | + * can specify which column you want with the |
|
1498 | + * <i>column-index</i> parameter. |
|
1499 | + * </p> |
|
1500 | + * <p> |
|
1501 | + * To fetch only the unique values of a single column from the result set, |
|
1502 | + * bitwise-OR <b>PDO::FETCH_COLUMN</b> with |
|
1503 | + * <b>PDO::FETCH_UNIQUE</b>. |
|
1504 | + * </p> |
|
1505 | + * <p> |
|
1506 | + * To return an associative array grouped by the values of a specified |
|
1507 | + * column, bitwise-OR <b>PDO::FETCH_COLUMN</b> with |
|
1508 | + * <b>PDO::FETCH_GROUP</b>. |
|
1509 | + * </p> |
|
1510 | + * @param mixed ...$args [optional] <p> |
|
1511 | + * Arguments of custom class constructor when the <i>fetch_style</i> |
|
1512 | + * parameter is <b>PDO::FETCH_CLASS</b>. |
|
1513 | + * </p> |
|
1514 | + * @return array|false <b>PDOStatement::fetchAll</b> returns an array containing |
|
1515 | + * all of the remaining rows in the result set. The array represents each |
|
1516 | + * row as either an array of column values or an object with properties |
|
1517 | + * corresponding to each column name. |
|
1518 | + * An empty array is returned if there are zero results to fetch, or false on failure. |
|
1519 | + * </p> |
|
1520 | + * <p> |
|
1521 | + * Using this method to fetch large result sets will result in a heavy |
|
1522 | + * demand on system and possibly network resources. Rather than retrieving |
|
1523 | + * all of the data and manipulating it in PHP, consider using the database |
|
1524 | + * server to manipulate the result sets. For example, use the WHERE and |
|
1525 | + * ORDER BY clauses in SQL to restrict results before retrieving and |
|
1526 | + * processing them with PHP. |
|
1527 | + */ |
|
1528 | + #[TentativeType] |
|
1529 | + public function fetchAll( |
|
1530 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $mode = PDO::FETCH_BOTH, |
|
1531 | + #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $fetch_argument = null, |
|
1532 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] ...$args |
|
1533 | + ): array {} |
|
1534 | + |
|
1535 | + /** |
|
1536 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.4)<br/> |
|
1537 | + * Fetches the next row and returns it as an object. |
|
1538 | + * @link https://php.net/manual/en/pdostatement.fetchobject.php |
|
1539 | + * @param string $class [optional] <p> |
|
1540 | + * Name of the created class. |
|
1541 | + * </p> |
|
1542 | + * @param array $constructorArgs [optional] <p> |
|
1543 | + * Elements of this array are passed to the constructor. |
|
1544 | + * </p> |
|
1545 | + * @return mixed an instance of the required class with property names that |
|
1546 | + * correspond to the column names or <b>FALSE</b> on failure. |
|
1547 | + */ |
|
1548 | + #[TentativeType] |
|
1549 | + public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []): object|false {} |
|
1550 | + |
|
1551 | + /** |
|
1552 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1553 | + * Fetch the SQLSTATE associated with the last operation on the statement handle |
|
1554 | + * @link https://php.net/manual/en/pdostatement.errorcode.php |
|
1555 | + * @return string Identical to <b>PDO::errorCode</b>, except that |
|
1556 | + * <b>PDOStatement::errorCode</b> only retrieves error codes |
|
1557 | + * for operations performed with PDOStatement objects. |
|
1558 | + */ |
|
1559 | + #[TentativeType] |
|
1560 | + public function errorCode(): ?string {} |
|
1561 | + |
|
1562 | + /** |
|
1563 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
|
1564 | + * Fetch extended error information associated with the last operation on the statement handle |
|
1565 | + * @link https://php.net/manual/en/pdostatement.errorinfo.php |
|
1566 | + * @return array <b>PDOStatement::errorInfo</b> returns an array of |
|
1567 | + * error information about the last operation performed by this |
|
1568 | + * statement handle. The array consists of the following fields: |
|
1569 | + * <tr valign="top"> |
|
1570 | + * <td>Element</td> |
|
1571 | + * <td>Information</td> |
|
1572 | + * </tr> |
|
1573 | + * <tr valign="top"> |
|
1574 | + * <td>0</td> |
|
1575 | + * <td>SQLSTATE error code (a five characters alphanumeric identifier defined |
|
1576 | + * in the ANSI SQL standard).</td> |
|
1577 | + * </tr> |
|
1578 | + * <tr valign="top"> |
|
1579 | + * <td>1</td> |
|
1580 | + * <td>Driver specific error code.</td> |
|
1581 | + * </tr> |
|
1582 | + * <tr valign="top"> |
|
1583 | + * <td>2</td> |
|
1584 | + * <td>Driver specific error message.</td> |
|
1585 | + * </tr> |
|
1586 | + */ |
|
1587 | + #[ArrayShape([0 => "string", 1 => "int", 2 => "string"])] |
|
1588 | + #[TentativeType] |
|
1589 | + public function errorInfo(): array {} |
|
1590 | + |
|
1591 | + /** |
|
1592 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1593 | + * Set a statement attribute |
|
1594 | + * @link https://php.net/manual/en/pdostatement.setattribute.php |
|
1595 | + * @param int $attribute |
|
1596 | + * @param mixed $value |
|
1597 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1598 | + */ |
|
1599 | + #[TentativeType] |
|
1600 | + public function setAttribute( |
|
1601 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, |
|
1602 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value |
|
1603 | + ): bool {} |
|
1604 | + |
|
1605 | + /** |
|
1606 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1607 | + * Retrieve a statement attribute |
|
1608 | + * @link https://php.net/manual/en/pdostatement.getattribute.php |
|
1609 | + * @param int $name |
|
1610 | + * @return mixed the attribute value. |
|
1611 | + */ |
|
1612 | + #[TentativeType] |
|
1613 | + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $name): mixed {} |
|
1614 | + |
|
1615 | + /** |
|
1616 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1617 | + * Returns the number of columns in the result set |
|
1618 | + * @link https://php.net/manual/en/pdostatement.columncount.php |
|
1619 | + * @return int the number of columns in the result set represented by the |
|
1620 | + * PDOStatement object. If there is no result set, |
|
1621 | + * <b>PDOStatement::columnCount</b> returns 0. |
|
1622 | + */ |
|
1623 | + #[TentativeType] |
|
1624 | + public function columnCount(): int {} |
|
1625 | + |
|
1626 | + /** |
|
1627 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1628 | + * Returns metadata for a column in a result set |
|
1629 | + * @link https://php.net/manual/en/pdostatement.getcolumnmeta.php |
|
1630 | + * @param int $column <p> |
|
1631 | + * The 0-indexed column in the result set. |
|
1632 | + * </p> |
|
1633 | + * @return array|false an associative array containing the following values representing |
|
1634 | + * the metadata for a single column: |
|
1635 | + * </p> |
|
1636 | + * <table> |
|
1637 | + * Column metadata |
|
1638 | + * <tr valign="top"> |
|
1639 | + * <td>Name</td> |
|
1640 | + * <td>Value</td> |
|
1641 | + * </tr> |
|
1642 | + * <tr valign="top"> |
|
1643 | + * <td>native_type</td> |
|
1644 | + * <td>The PHP native type used to represent the column value.</td> |
|
1645 | + * </tr> |
|
1646 | + * <tr valign="top"> |
|
1647 | + * <td>driver:decl_type</td> |
|
1648 | + * <td>The SQL type used to represent the column value in the database. |
|
1649 | + * If the column in the result set is the result of a function, this value |
|
1650 | + * is not returned by <b>PDOStatement::getColumnMeta</b>. |
|
1651 | + * </td> |
|
1652 | + * </tr> |
|
1653 | + * <tr valign="top"> |
|
1654 | + * <td>flags</td> |
|
1655 | + * <td>Any flags set for this column.</td> |
|
1656 | + * </tr> |
|
1657 | + * <tr valign="top"> |
|
1658 | + * <td>name</td> |
|
1659 | + * <td>The name of this column as returned by the database.</td> |
|
1660 | + * </tr> |
|
1661 | + * <tr valign="top"> |
|
1662 | + * <td>table</td> |
|
1663 | + * <td>The name of this column's table as returned by the database.</td> |
|
1664 | + * </tr> |
|
1665 | + * <tr valign="top"> |
|
1666 | + * <td>len</td> |
|
1667 | + * <td>The length of this column. Normally -1 for |
|
1668 | + * types other than floating point decimals.</td> |
|
1669 | + * </tr> |
|
1670 | + * <tr valign="top"> |
|
1671 | + * <td>precision</td> |
|
1672 | + * <td>The numeric precision of this column. Normally |
|
1673 | + * 0 for types other than floating point |
|
1674 | + * decimals.</td> |
|
1675 | + * </tr> |
|
1676 | + * <tr valign="top"> |
|
1677 | + * <td>pdo_type</td> |
|
1678 | + * <td>The type of this column as represented by the |
|
1679 | + * PDO::PARAM_* constants.</td> |
|
1680 | + * </tr> |
|
1681 | + * </table> |
|
1682 | + * <p> |
|
1683 | + * Returns <b>FALSE</b> if the requested column does not exist in the result set, |
|
1684 | + * or if no result set exists. |
|
1685 | + */ |
|
1686 | + #[TentativeType] |
|
1687 | + public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {} |
|
1688 | + |
|
1689 | + /** |
|
1690 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1691 | + * Set the default fetch mode for this statement |
|
1692 | + * @link https://php.net/manual/en/pdostatement.setfetchmode.php |
|
1693 | + * @param int $mode <p> |
|
1694 | + * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1695 | + * </p> |
|
1696 | + * @param null|string|object $className [optional] <p> |
|
1697 | + * Class name or object |
|
1698 | + * </p> |
|
1699 | + * @param array $params [optional] <p> Constructor arguments. </p> |
|
1700 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1701 | + */ |
|
1702 | + #[PhpStormStubsElementAvailable(to: '7.4')] |
|
1703 | + public function setFetchMode($mode, $className = null, array $params = []) {} |
|
1704 | + |
|
1705 | + /** |
|
1706 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1707 | + * Set the default fetch mode for this statement |
|
1708 | + * @link https://php.net/manual/en/pdostatement.setfetchmode.php |
|
1709 | + * @param int $mode <p> |
|
1710 | + * The fetch mode must be one of the PDO::FETCH_* constants. |
|
1711 | + * </p> |
|
1712 | + * @param string|object|null $className [optional] <p> |
|
1713 | + * Class name or object |
|
1714 | + * </p> |
|
1715 | + * @param mixed ...$params <p> Constructor arguments. </p> |
|
1716 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1717 | + */ |
|
1718 | + #[PhpStormStubsElementAvailable('8.0')] |
|
1719 | + public function setFetchMode($mode, $className = null, ...$params) {} |
|
1720 | + |
|
1721 | + /** |
|
1722 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
|
1723 | + * Advances to the next rowset in a multi-rowset statement handle |
|
1724 | + * @link https://php.net/manual/en/pdostatement.nextrowset.php |
|
1725 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1726 | + */ |
|
1727 | + #[TentativeType] |
|
1728 | + public function nextRowset(): bool {} |
|
1729 | + |
|
1730 | + /** |
|
1731 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)<br/> |
|
1732 | + * Closes the cursor, enabling the statement to be executed again. |
|
1733 | + * @link https://php.net/manual/en/pdostatement.closecursor.php |
|
1734 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
1735 | + */ |
|
1736 | + #[TentativeType] |
|
1737 | + public function closeCursor(): bool {} |
|
1738 | + |
|
1739 | + /** |
|
1740 | + * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.9.0)<br/> |
|
1741 | + * Dump an SQL prepared command |
|
1742 | + * @link https://php.net/manual/en/pdostatement.debugdumpparams.php |
|
1743 | + * @return bool|null No value is returned. |
|
1744 | + */ |
|
1745 | + #[TentativeType] |
|
1746 | + public function debugDumpParams(): ?bool {} |
|
1747 | + |
|
1748 | + final public function __wakeup() {} |
|
1749 | + |
|
1750 | + final public function __sleep() {} |
|
1751 | + |
|
1752 | + /** |
|
1753 | + * @return Iterator |
|
1754 | + * @since 8.0 |
|
1755 | + */ |
|
1756 | + public function getIterator(): Iterator {} |
|
1757 | 1757 | } |
1758 | 1758 | |
1759 | 1759 | final class PDORow |
1760 | 1760 | { |
1761 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
1762 | - public $queryString; |
|
1761 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
1762 | + public $queryString; |
|
1763 | 1763 | } |
1764 | 1764 | |
1765 | 1765 | /** |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | * so <b>PDO::prepare</b> does not check the statement. |
945 | 945 | */ |
946 | 946 | #[TentativeType] |
947 | - public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []): PDOStatement|false {} |
|
947 | + public function prepare(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $query, array $options = []): PDOStatement | false {} |
|
948 | 948 | |
949 | 949 | /** |
950 | 950 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
@@ -1045,7 +1045,7 @@ discard block |
||
1045 | 1045 | * </code> |
1046 | 1046 | */ |
1047 | 1047 | #[TentativeType] |
1048 | - public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int|false {} |
|
1048 | + public function exec(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $statement): int | false {} |
|
1049 | 1049 | |
1050 | 1050 | /** |
1051 | 1051 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | * IM001 SQLSTATE. |
1123 | 1123 | */ |
1124 | 1124 | #[TentativeType] |
1125 | - public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string|false {} |
|
1125 | + public function lastInsertId(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $name = null): string | false {} |
|
1126 | 1126 | |
1127 | 1127 | /** |
1128 | 1128 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | * An unsuccessful call returns null. |
1221 | 1221 | */ |
1222 | 1222 | #[TentativeType] |
1223 | - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute): mixed {} |
|
1223 | + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $attribute): mixed {} |
|
1224 | 1224 | |
1225 | 1225 | /** |
1226 | 1226 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.1)<br/> |
@@ -1238,9 +1238,9 @@ discard block |
||
1238 | 1238 | */ |
1239 | 1239 | #[TentativeType] |
1240 | 1240 | public function quote( |
1241 | - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $string, |
|
1242 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT |
|
1243 | - ): string|false {} |
|
1241 | + #[LanguageLevelTypeAware(['8.0' => 'string'], default : '')] $string, |
|
1242 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $type = PDO::PARAM_INT |
|
1243 | + ): string | false {} |
|
1244 | 1244 | |
1245 | 1245 | final public function __wakeup() {} |
1246 | 1246 | |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | /** |
1292 | 1292 | * @var string |
1293 | 1293 | */ |
1294 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
1294 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default : '')] |
|
1295 | 1295 | public $queryString; |
1296 | 1296 | |
1297 | 1297 | /** |
@@ -1388,7 +1388,7 @@ discard block |
||
1388 | 1388 | #[TentativeType] |
1389 | 1389 | public function bindParam( |
1390 | 1390 | #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $param, |
1391 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, |
|
1391 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] & $var, |
|
1392 | 1392 | #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, |
1393 | 1393 | #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, |
1394 | 1394 | #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null |
@@ -1420,7 +1420,7 @@ discard block |
||
1420 | 1420 | #[TentativeType] |
1421 | 1421 | public function bindColumn( |
1422 | 1422 | #[LanguageLevelTypeAware(['8.0' => 'int|string'], default: '')] $column, |
1423 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] &$var, |
|
1423 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] & $var, |
|
1424 | 1424 | #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $type = PDO::PARAM_INT, |
1425 | 1425 | #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $maxLength = null, |
1426 | 1426 | #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $driverOptions = null |
@@ -1546,7 +1546,7 @@ discard block |
||
1546 | 1546 | * correspond to the column names or <b>FALSE</b> on failure. |
1547 | 1547 | */ |
1548 | 1548 | #[TentativeType] |
1549 | - public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []): object|false {} |
|
1549 | + public function fetchObject(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $class = "stdClass", array $constructorArgs = []): object | false {} |
|
1550 | 1550 | |
1551 | 1551 | /** |
1552 | 1552 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)<br/> |
@@ -1598,8 +1598,8 @@ discard block |
||
1598 | 1598 | */ |
1599 | 1599 | #[TentativeType] |
1600 | 1600 | public function setAttribute( |
1601 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $attribute, |
|
1602 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $value |
|
1601 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $attribute, |
|
1602 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default : '')] $value |
|
1603 | 1603 | ): bool {} |
1604 | 1604 | |
1605 | 1605 | /** |
@@ -1610,7 +1610,7 @@ discard block |
||
1610 | 1610 | * @return mixed the attribute value. |
1611 | 1611 | */ |
1612 | 1612 | #[TentativeType] |
1613 | - public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $name): mixed {} |
|
1613 | + public function getAttribute(#[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $name): mixed {} |
|
1614 | 1614 | |
1615 | 1615 | /** |
1616 | 1616 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
@@ -1684,7 +1684,7 @@ discard block |
||
1684 | 1684 | * or if no result set exists. |
1685 | 1685 | */ |
1686 | 1686 | #[TentativeType] |
1687 | - public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $column): array|false {} |
|
1687 | + public function getColumnMeta(#[LanguageLevelTypeAware(['8.0' => 'int'], default : '')] $column): array | false {} |
|
1688 | 1688 | |
1689 | 1689 | /** |
1690 | 1690 | * (PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.2.0)<br/> |
@@ -1699,7 +1699,7 @@ discard block |
||
1699 | 1699 | * @param array $params [optional] <p> Constructor arguments. </p> |
1700 | 1700 | * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
1701 | 1701 | */ |
1702 | - #[PhpStormStubsElementAvailable(to: '7.4')] |
|
1702 | + #[PhpStormStubsElementAvailable(to : '7.4')] |
|
1703 | 1703 | public function setFetchMode($mode, $className = null, array $params = []) {} |
1704 | 1704 | |
1705 | 1705 | /** |
@@ -1758,7 +1758,7 @@ discard block |
||
1758 | 1758 | |
1759 | 1759 | final class PDORow |
1760 | 1760 | { |
1761 | - #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
|
1761 | + #[LanguageLevelTypeAware(['8.1' => 'string'], default : '')] |
|
1762 | 1762 | public $queryString; |
1763 | 1763 | } |
1764 | 1764 |
@@ -14,8 +14,7 @@ discard block |
||
14 | 14 | * @see https://php.net/manual/en/language.exceptions.php Exceptions in PHP |
15 | 15 | * @link https://php.net/manual/en/class.pdoexception.php |
16 | 16 | */ |
17 | -class PDOException extends RuntimeException |
|
18 | -{ |
|
17 | +class PDOException extends RuntimeException { |
|
19 | 18 | #[LanguageLevelTypeAware(['8.1' => 'array|null'], default: '')] |
20 | 19 | public $errorInfo; |
21 | 20 | } |
@@ -24,8 +23,7 @@ discard block |
||
24 | 23 | * Represents a connection between PHP and a database server. |
25 | 24 | * @link https://php.net/manual/en/class.pdo.php |
26 | 25 | */ |
27 | -class PDO |
|
28 | -{ |
|
26 | +class PDO { |
|
29 | 27 | /** |
30 | 28 | * Represents a boolean data type. |
31 | 29 | * @link https://php.net/manual/en/pdo.constants.php#pdo.constants.param-bool |
@@ -1286,8 +1284,7 @@ discard block |
||
1286 | 1284 | * associated result set. |
1287 | 1285 | * @link https://php.net/manual/en/class.pdostatement.php |
1288 | 1286 | */ |
1289 | -class PDOStatement implements IteratorAggregate |
|
1290 | -{ |
|
1287 | +class PDOStatement implements IteratorAggregate { |
|
1291 | 1288 | /** |
1292 | 1289 | * @var string |
1293 | 1290 | */ |
@@ -1756,8 +1753,7 @@ discard block |
||
1756 | 1753 | public function getIterator(): Iterator {} |
1757 | 1754 | } |
1758 | 1755 | |
1759 | -final class PDORow |
|
1760 | -{ |
|
1756 | +final class PDORow { |
|
1761 | 1757 | #[LanguageLevelTypeAware(['8.1' => 'string'], default: '')] |
1762 | 1758 | public $queryString; |
1763 | 1759 | } |
@@ -37,116 +37,116 @@ discard block |
||
37 | 37 | */ |
38 | 38 | class Yar_Server |
39 | 39 | { |
40 | - protected $_executor; |
|
41 | - |
|
42 | - /** |
|
43 | - * Register a server |
|
44 | - * Set up a Yar HTTP RPC Server, All the public methods of $obj will be register as a RPC service. |
|
45 | - * |
|
46 | - * Yar_Server constructor. |
|
47 | - * @param object $obj An Object, all public methods of its will be registered as RPC services. |
|
48 | - * @link https://secure.php.net/manual/en/yar-server.construct.php |
|
49 | - */ |
|
50 | - final public function __construct($obj, $protocol = null) {} |
|
51 | - |
|
52 | - /** |
|
53 | - * Start RPC Server |
|
54 | - * Start a RPC HTTP server, and ready for accpet RPC requests. |
|
55 | - * Note: |
|
56 | - * Usual RPC calls will be issued as HTTP POST requests. |
|
57 | - * If a HTTP GET request is issued to the uri, |
|
58 | - * the service information (commented section above) will be printed on the page |
|
59 | - * @return bool |
|
60 | - * @link https://secure.php.net/manual/en/yar-server.handle.php |
|
61 | - */ |
|
62 | - public function handle() {} |
|
40 | + protected $_executor; |
|
41 | + |
|
42 | + /** |
|
43 | + * Register a server |
|
44 | + * Set up a Yar HTTP RPC Server, All the public methods of $obj will be register as a RPC service. |
|
45 | + * |
|
46 | + * Yar_Server constructor. |
|
47 | + * @param object $obj An Object, all public methods of its will be registered as RPC services. |
|
48 | + * @link https://secure.php.net/manual/en/yar-server.construct.php |
|
49 | + */ |
|
50 | + final public function __construct($obj, $protocol = null) {} |
|
51 | + |
|
52 | + /** |
|
53 | + * Start RPC Server |
|
54 | + * Start a RPC HTTP server, and ready for accpet RPC requests. |
|
55 | + * Note: |
|
56 | + * Usual RPC calls will be issued as HTTP POST requests. |
|
57 | + * If a HTTP GET request is issued to the uri, |
|
58 | + * the service information (commented section above) will be printed on the page |
|
59 | + * @return bool |
|
60 | + * @link https://secure.php.net/manual/en/yar-server.handle.php |
|
61 | + */ |
|
62 | + public function handle() {} |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | class Yar_Client |
66 | 66 | { |
67 | - protected $_protocol; |
|
68 | - protected $_uri; |
|
69 | - protected $_options; |
|
70 | - protected $_running; |
|
71 | - |
|
72 | - /** |
|
73 | - * Call service |
|
74 | - * Issue a call to remote RPC method. |
|
75 | - * |
|
76 | - * @param string $method Remote RPC method name. |
|
77 | - * @param array $parameters Parameters. |
|
78 | - * @link https://secure.php.net/manual/en/yar-client.call.php |
|
79 | - */ |
|
80 | - public function __call($method, $parameters) {} |
|
81 | - |
|
82 | - /** |
|
83 | - * Create a client |
|
84 | - * Yar_Client constructor. |
|
85 | - * @param string $url Yar Server URL. |
|
86 | - * @link https://secure.php.net/manual/en/yar-client.construct.php |
|
87 | - */ |
|
88 | - final public function __construct($url, $async = null) {} |
|
89 | - |
|
90 | - public function call($method, $parameters) {} |
|
91 | - |
|
92 | - /** |
|
93 | - * Set calling contexts |
|
94 | - * |
|
95 | - * @param int $type it can be: |
|
96 | - * - YAR_OPT_PACKAGER, |
|
97 | - * - YAR_OPT_PERSISTENT (Need server support), |
|
98 | - * - YAR_OPT_TIMEOUT, |
|
99 | - * - YAR_OPT_CONNECT_TIMEOUT |
|
100 | - * - YAR_OPT_HEADER (Since 2.0.4) |
|
101 | - * @param $value |
|
102 | - * @return static|false Returns $this on success or FALSE on failure. |
|
103 | - * @link https://secure.php.net/manual/en/yar-client.setopt.php |
|
104 | - */ |
|
105 | - public function setOpt($type, $value) {} |
|
106 | - |
|
107 | - public function getOpt($type) {} |
|
67 | + protected $_protocol; |
|
68 | + protected $_uri; |
|
69 | + protected $_options; |
|
70 | + protected $_running; |
|
71 | + |
|
72 | + /** |
|
73 | + * Call service |
|
74 | + * Issue a call to remote RPC method. |
|
75 | + * |
|
76 | + * @param string $method Remote RPC method name. |
|
77 | + * @param array $parameters Parameters. |
|
78 | + * @link https://secure.php.net/manual/en/yar-client.call.php |
|
79 | + */ |
|
80 | + public function __call($method, $parameters) {} |
|
81 | + |
|
82 | + /** |
|
83 | + * Create a client |
|
84 | + * Yar_Client constructor. |
|
85 | + * @param string $url Yar Server URL. |
|
86 | + * @link https://secure.php.net/manual/en/yar-client.construct.php |
|
87 | + */ |
|
88 | + final public function __construct($url, $async = null) {} |
|
89 | + |
|
90 | + public function call($method, $parameters) {} |
|
91 | + |
|
92 | + /** |
|
93 | + * Set calling contexts |
|
94 | + * |
|
95 | + * @param int $type it can be: |
|
96 | + * - YAR_OPT_PACKAGER, |
|
97 | + * - YAR_OPT_PERSISTENT (Need server support), |
|
98 | + * - YAR_OPT_TIMEOUT, |
|
99 | + * - YAR_OPT_CONNECT_TIMEOUT |
|
100 | + * - YAR_OPT_HEADER (Since 2.0.4) |
|
101 | + * @param $value |
|
102 | + * @return static|false Returns $this on success or FALSE on failure. |
|
103 | + * @link https://secure.php.net/manual/en/yar-client.setopt.php |
|
104 | + */ |
|
105 | + public function setOpt($type, $value) {} |
|
106 | + |
|
107 | + public function getOpt($type) {} |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | class Yar_Concurrent_Client |
111 | 111 | { |
112 | - protected static $_callstack; |
|
113 | - protected static $_callback; |
|
114 | - protected static $_error_callback; |
|
115 | - |
|
116 | - protected static $_start; |
|
117 | - |
|
118 | - /** |
|
119 | - * Register a concurrent call |
|
120 | - * @param string $uri The RPC server URI(http, tcp) |
|
121 | - * @param string $method Service name(aka the method name) |
|
122 | - * @param array $parameters Parameters |
|
123 | - * @param callable $callback A function callback, which will be called while the response return. |
|
124 | - * @param callable $error_callback A function callback, which will be called while the response return. |
|
125 | - * @param array $options |
|
126 | - * @return int An unique id, can be used to identified which call it is. |
|
127 | - * @link https://secure.php.net/manual/en/yar-concurrent-client.call.php |
|
128 | - */ |
|
129 | - public static function call($uri, $method, $parameters, callable $callback = null, callable $error_callback, array $options) {} |
|
130 | - |
|
131 | - /** |
|
132 | - * Send all calls |
|
133 | - * @param callable $callback |
|
134 | - * If this callback is set, then Yar will call this callback after all calls are sent and before any response return, with a $callinfo NULL. |
|
135 | - * Then, if user didn't specify callback when registering concurrent call, this callback will be used to handle response, otherwise, the callback specified while registering will be used. |
|
136 | - * @param callable $error_callback |
|
137 | - * If this callback is set, then Yar will call this callback while error occurred. |
|
138 | - * @return bool |
|
139 | - * @link https://secure.php.net/manual/en/yar-concurrent-client.loop.php |
|
140 | - */ |
|
141 | - public static function loop($callback = null, $error_callback = null) {} |
|
142 | - |
|
143 | - /** |
|
144 | - * Clean all registered calls |
|
145 | - * Clean all registered calls |
|
146 | - * @return bool |
|
147 | - * @link https://secure.php.net/manual/en/yar-concurrent-client.reset.php |
|
148 | - */ |
|
149 | - public static function reset() {} |
|
112 | + protected static $_callstack; |
|
113 | + protected static $_callback; |
|
114 | + protected static $_error_callback; |
|
115 | + |
|
116 | + protected static $_start; |
|
117 | + |
|
118 | + /** |
|
119 | + * Register a concurrent call |
|
120 | + * @param string $uri The RPC server URI(http, tcp) |
|
121 | + * @param string $method Service name(aka the method name) |
|
122 | + * @param array $parameters Parameters |
|
123 | + * @param callable $callback A function callback, which will be called while the response return. |
|
124 | + * @param callable $error_callback A function callback, which will be called while the response return. |
|
125 | + * @param array $options |
|
126 | + * @return int An unique id, can be used to identified which call it is. |
|
127 | + * @link https://secure.php.net/manual/en/yar-concurrent-client.call.php |
|
128 | + */ |
|
129 | + public static function call($uri, $method, $parameters, callable $callback = null, callable $error_callback, array $options) {} |
|
130 | + |
|
131 | + /** |
|
132 | + * Send all calls |
|
133 | + * @param callable $callback |
|
134 | + * If this callback is set, then Yar will call this callback after all calls are sent and before any response return, with a $callinfo NULL. |
|
135 | + * Then, if user didn't specify callback when registering concurrent call, this callback will be used to handle response, otherwise, the callback specified while registering will be used. |
|
136 | + * @param callable $error_callback |
|
137 | + * If this callback is set, then Yar will call this callback while error occurred. |
|
138 | + * @return bool |
|
139 | + * @link https://secure.php.net/manual/en/yar-concurrent-client.loop.php |
|
140 | + */ |
|
141 | + public static function loop($callback = null, $error_callback = null) {} |
|
142 | + |
|
143 | + /** |
|
144 | + * Clean all registered calls |
|
145 | + * Clean all registered calls |
|
146 | + * @return bool |
|
147 | + * @link https://secure.php.net/manual/en/yar-concurrent-client.reset.php |
|
148 | + */ |
|
149 | + public static function reset() {} |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | */ |
158 | 158 | class Yar_Server_Exception extends Exception |
159 | 159 | { |
160 | - protected $_type; |
|
161 | - |
|
162 | - /** |
|
163 | - * Retrieve exception's type |
|
164 | - * Get the exception original type threw by server |
|
165 | - * @return string |
|
166 | - * @link https://secure.php.net/manual/en/yar-server-exception.gettype.php |
|
167 | - */ |
|
168 | - public function getType() {} |
|
160 | + protected $_type; |
|
161 | + |
|
162 | + /** |
|
163 | + * Retrieve exception's type |
|
164 | + * Get the exception original type threw by server |
|
165 | + * @return string |
|
166 | + * @link https://secure.php.net/manual/en/yar-server-exception.gettype.php |
|
167 | + */ |
|
168 | + public function getType() {} |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -176,12 +176,12 @@ discard block |
||
176 | 176 | */ |
177 | 177 | class Yar_Client_Exception extends Exception |
178 | 178 | { |
179 | - /** |
|
180 | - * Retrieve exception's type |
|
181 | - * @return string "Yar_Exception_Client". |
|
182 | - * @link https://secure.php.net/manual/en/yar-client-exception.gettype.php |
|
183 | - */ |
|
184 | - public function getType() {} |
|
179 | + /** |
|
180 | + * Retrieve exception's type |
|
181 | + * @return string "Yar_Exception_Client". |
|
182 | + * @link https://secure.php.net/manual/en/yar-client-exception.gettype.php |
|
183 | + */ |
|
184 | + public function getType() {} |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | class Yar_Server_Request_Exception extends Yar_Server_Exception {} |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | * @author [email protected] |
36 | 36 | * @link https://secure.php.net/manual/en/class.yar-server.php |
37 | 37 | */ |
38 | -class Yar_Server |
|
39 | -{ |
|
38 | +class Yar_Server { |
|
40 | 39 | protected $_executor; |
41 | 40 | |
42 | 41 | /** |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | public function handle() {} |
63 | 62 | } |
64 | 63 | |
65 | -class Yar_Client |
|
66 | -{ |
|
64 | +class Yar_Client { |
|
67 | 65 | protected $_protocol; |
68 | 66 | protected $_uri; |
69 | 67 | protected $_options; |
@@ -107,8 +105,7 @@ discard block |
||
107 | 105 | public function getOpt($type) {} |
108 | 106 | } |
109 | 107 | |
110 | -class Yar_Concurrent_Client |
|
111 | -{ |
|
108 | +class Yar_Concurrent_Client { |
|
112 | 109 | protected static $_callstack; |
113 | 110 | protected static $_callback; |
114 | 111 | protected static $_error_callback; |
@@ -155,8 +152,7 @@ discard block |
||
155 | 152 | * @author [email protected] |
156 | 153 | * @link https://secure.php.net/manual/en/class.yar-server-exception.php |
157 | 154 | */ |
158 | -class Yar_Server_Exception extends Exception |
|
159 | -{ |
|
155 | +class Yar_Server_Exception extends Exception { |
|
160 | 156 | protected $_type; |
161 | 157 | |
162 | 158 | /** |
@@ -174,8 +170,7 @@ discard block |
||
174 | 170 | * @author [email protected] |
175 | 171 | * @link https://secure.php.net/manual/en/class.yar-client-exception.php |
176 | 172 | */ |
177 | -class Yar_Client_Exception extends Exception |
|
178 | -{ |
|
173 | +class Yar_Client_Exception extends Exception { |
|
179 | 174 | /** |
180 | 175 | * Retrieve exception's type |
181 | 176 | * @return string "Yar_Exception_Client". |
@@ -4,321 +4,321 @@ discard block |
||
4 | 4 | |
5 | 5 | class MemcachePool |
6 | 6 | { |
7 | - /** |
|
8 | - * (PECL memcache >= 0.2.0)<br/> |
|
9 | - * Open memcached server connection |
|
10 | - * @link https://php.net/manual/en/memcache.connect.php |
|
11 | - * @param string $host <p> |
|
12 | - * Point to the host where memcached is listening for connections. This parameter |
|
13 | - * may also specify other transports like <em>unix:///path/to/memcached.sock</em> |
|
14 | - * to use UNIX domain sockets, in this case <b>port</b> must also |
|
15 | - * be set to <em>0</em>. |
|
16 | - * </p> |
|
17 | - * @param int $port [optional] <p> |
|
18 | - * Point to the port where memcached is listening for connections. Set this |
|
19 | - * parameter to <em>0</em> when using UNIX domain sockets. |
|
20 | - * </p> |
|
21 | - * <p> |
|
22 | - * Please note: <b>port</b> defaults to |
|
23 | - * {@link https://php.net/manual/en/memcache.ini.php#ini.memcache.default-port memcache.default_port} |
|
24 | - * if not specified. For this reason it is wise to specify the port |
|
25 | - * explicitly in this method call. |
|
26 | - * </p> |
|
27 | - * @param int $timeout [optional] <p>Value in seconds which will be used for connecting to the daemon. Think twice before changing the default value of 1 second - you can lose all the advantages of caching if your connection is too slow.</p> |
|
28 | - * @return bool <p>Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.</p> |
|
29 | - */ |
|
30 | - public function connect($host, $port, $timeout = 1) {} |
|
31 | - |
|
32 | - /** |
|
33 | - * (PECL memcache >= 2.0.0)<br/> |
|
34 | - * Add a memcached server to connection pool |
|
35 | - * @link https://php.net/manual/en/memcache.addserver.php |
|
36 | - * @param string $host <p> |
|
37 | - * Point to the host where memcached is listening for connections. This parameter |
|
38 | - * may also specify other transports like unix:///path/to/memcached.sock |
|
39 | - * to use UNIX domain sockets, in this case <i>port</i> must also |
|
40 | - * be set to 0. |
|
41 | - * </p> |
|
42 | - * @param int $port [optional] <p> |
|
43 | - * Point to the port where memcached is listening for connections. |
|
44 | - * Set this |
|
45 | - * parameter to 0 when using UNIX domain sockets. |
|
46 | - * </p> |
|
47 | - * <p> |
|
48 | - * Please note: <i>port</i> defaults to |
|
49 | - * memcache.default_port |
|
50 | - * if not specified. For this reason it is wise to specify the port |
|
51 | - * explicitly in this method call. |
|
52 | - * </p> |
|
53 | - * @param bool $persistent [optional] <p> |
|
54 | - * Controls the use of a persistent connection. Default to <b>TRUE</b>. |
|
55 | - * </p> |
|
56 | - * @param int $weight [optional] <p> |
|
57 | - * Number of buckets to create for this server which in turn control its |
|
58 | - * probability of it being selected. The probability is relative to the |
|
59 | - * total weight of all servers. |
|
60 | - * </p> |
|
61 | - * @param int $timeout [optional] <p> |
|
62 | - * Value in seconds which will be used for connecting to the daemon. Think |
|
63 | - * twice before changing the default value of 1 second - you can lose all |
|
64 | - * the advantages of caching if your connection is too slow. |
|
65 | - * </p> |
|
66 | - * @param int $retry_interval [optional] <p> |
|
67 | - * Controls how often a failed server will be retried, the default value |
|
68 | - * is 15 seconds. Setting this parameter to -1 disables automatic retry. |
|
69 | - * Neither this nor the <i>persistent</i> parameter has any |
|
70 | - * effect when the extension is loaded dynamically via <b>dl</b>. |
|
71 | - * </p> |
|
72 | - * <p> |
|
73 | - * Each failed connection struct has its own timeout and before it has expired |
|
74 | - * the struct will be skipped when selecting backends to serve a request. Once |
|
75 | - * expired the connection will be successfully reconnected or marked as failed |
|
76 | - * for another <i>retry_interval</i> seconds. The typical |
|
77 | - * effect is that each web server child will retry the connection about every |
|
78 | - * <i>retry_interval</i> seconds when serving a page. |
|
79 | - * </p> |
|
80 | - * @param bool $status [optional] <p> |
|
81 | - * Controls if the server should be flagged as online. Setting this parameter |
|
82 | - * to <b>FALSE</b> and <i>retry_interval</i> to -1 allows a failed |
|
83 | - * server to be kept in the pool so as not to affect the key distribution |
|
84 | - * algorithm. Requests for this server will then failover or fail immediately |
|
85 | - * depending on the <i>memcache.allow_failover</i> setting. |
|
86 | - * Default to <b>TRUE</b>, meaning the server should be considered online. |
|
87 | - * </p> |
|
88 | - * @param callable $failure_callback [optional] <p> |
|
89 | - * Allows the user to specify a callback function to run upon encountering an |
|
90 | - * error. The callback is run before failover is attempted. The function takes |
|
91 | - * two parameters, the hostname and port of the failed server. |
|
92 | - * </p> |
|
93 | - * @param int $timeoutms [optional] <p> |
|
94 | - * </p> |
|
95 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
96 | - */ |
|
97 | - public function addServer($host, $port = 11211, $persistent = true, $weight = null, $timeout = 1, $retry_interval = 15, $status = true, callable $failure_callback = null, $timeoutms = null) {} |
|
98 | - |
|
99 | - /** |
|
100 | - * (PECL memcache >= 2.1.0)<br/> |
|
101 | - * Changes server parameters and status at runtime |
|
102 | - * @link https://secure.php.net/manual/en/memcache.setserverparams.php |
|
103 | - * @param string $host <p>Point to the host where memcached is listening for connections.</p>. |
|
104 | - * @param int $port [optional] <p> |
|
105 | - * Point to the port where memcached is listening for connections. |
|
106 | - * </p> |
|
107 | - * @param int $timeout [optional] <p> |
|
108 | - * Value in seconds which will be used for connecting to the daemon. Think twice before changing the default value of 1 second - you can lose all the advantages of caching if your connection is too slow. |
|
109 | - * </p> |
|
110 | - * @param int $retry_interval [optional] <p> |
|
111 | - * Controls how often a failed server will be retried, the default value |
|
112 | - * is 15 seconds. Setting this parameter to -1 disables automatic retry. |
|
113 | - * Neither this nor the <b>persistent</b> parameter has any |
|
114 | - * effect when the extension is loaded dynamically via {@link https://secure.php.net/manual/en/function.dl.php dl()}. |
|
115 | - * </p> |
|
116 | - * @param bool $status [optional] <p> |
|
117 | - * Controls if the server should be flagged as online. Setting this parameter |
|
118 | - * to <b>FALSE</b> and <b>retry_interval</b> to -1 allows a failed |
|
119 | - * server to be kept in the pool so as not to affect the key distribution |
|
120 | - * algorithm. Requests for this server will then failover or fail immediately |
|
121 | - * depending on the <b>memcache.allow_failover</b> setting. |
|
122 | - * Default to <b>TRUE</b>, meaning the server should be considered online. |
|
123 | - * </p> |
|
124 | - * @param callable $failure_callback [optional] <p> |
|
125 | - * Allows the user to specify a callback function to run upon encountering an error. The callback is run before failover is attempted. |
|
126 | - * The function takes two parameters, the hostname and port of the failed server. |
|
127 | - * </p> |
|
128 | - * @return bool <p>Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.</p> |
|
129 | - */ |
|
130 | - public function setServerParams($host, $port = 11211, $timeout = 1, $retry_interval = 15, $status = true, callable $failure_callback = null) {} |
|
131 | - |
|
132 | - public function setFailureCallback() {} |
|
133 | - |
|
134 | - /** |
|
135 | - * (PECL memcache >= 2.1.0)<br/> |
|
136 | - * Returns server status |
|
137 | - * @link https://php.net/manual/en/memcache.getserverstatus.php |
|
138 | - * @param string $host Point to the host where memcached is listening for connections. |
|
139 | - * @param int $port Point to the port where memcached is listening for connections. |
|
140 | - * @return int Returns a the servers status. 0 if server is failed, non-zero otherwise |
|
141 | - */ |
|
142 | - public function getServerStatus($host, $port = 11211) {} |
|
143 | - |
|
144 | - public function findServer() {} |
|
145 | - |
|
146 | - /** |
|
147 | - * (PECL memcache >= 0.2.0)<br/> |
|
148 | - * Return version of the server |
|
149 | - * @link https://php.net/manual/en/memcache.getversion.php |
|
150 | - * @return string|false Returns a string of server version number or <b>FALSE</b> on failure. |
|
151 | - */ |
|
152 | - public function getVersion() {} |
|
153 | - |
|
154 | - /** |
|
155 | - * (PECL memcache >= 2.0.0)<br/> |
|
156 | - * Add an item to the server. If the key already exists, the value will not be added and <b>FALSE</b> will be returned. |
|
157 | - * @link https://php.net/manual/en/memcache.add.php |
|
158 | - * @param string $key The key that will be associated with the item. |
|
159 | - * @param mixed $var The variable to store. Strings and integers are stored as is, other types are stored serialized. |
|
160 | - * @param int $flag [optional] <p> |
|
161 | - * Use <b>MEMCACHE_COMPRESSED</b> to store the item |
|
162 | - * compressed (uses zlib). |
|
163 | - * </p> |
|
164 | - * @param int $expire [optional] <p>Expiration time of the item. |
|
165 | - * If it's equal to zero, the item will never expire. |
|
166 | - * You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).</p> |
|
167 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. Returns <b>FALSE</b> if such key already exist. For the rest Memcache::add() behaves similarly to Memcache::set(). |
|
168 | - */ |
|
169 | - public function add($key, $var, $flag = null, $expire = null) {} |
|
170 | - |
|
171 | - /** |
|
172 | - * (PECL memcache >= 0.2.0)<br/> |
|
173 | - * Stores an item var with key on the memcached server. Parameter expire is expiration time in seconds. |
|
174 | - * If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, |
|
175 | - * it could be deleted from the cache to make place for other items). |
|
176 | - * You can use MEMCACHE_COMPRESSED constant as flag value if you want to use on-the-fly compression (uses zlib). |
|
177 | - * @link https://php.net/manual/en/memcache.set.php |
|
178 | - * @param string $key The key that will be associated with the item. |
|
179 | - * @param mixed $var The variable to store. Strings and integers are stored as is, other types are stored serialized. |
|
180 | - * @param int $flag [optional] Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib). |
|
181 | - * @param int $expire [optional] Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days). |
|
182 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
183 | - */ |
|
184 | - public function set($key, $var, $flag = null, $expire = null) {} |
|
185 | - |
|
186 | - /** |
|
187 | - * (PECL memcache >= 0.2.0)<br/> |
|
188 | - * Replace value of the existing item |
|
189 | - * @link https://php.net/manual/en/memcache.replace.php |
|
190 | - * @param string $key <p>The key that will be associated with the item.</p> |
|
191 | - * @param mixed $var <p>The variable to store. Strings and integers are stored as is, other types are stored serialized.</p> |
|
192 | - * @param int $flag [optional] <p>Use <b>MEMCACHE_COMPRESSED</b> to store the item compressed (uses zlib).</p> |
|
193 | - * @param int $expire [optional] <p>Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).</p> |
|
194 | - * @return bool Returns TRUE on success or FALSE on failure. |
|
195 | - */ |
|
196 | - public function replace($key, $var, $flag = null, $expire = null) {} |
|
197 | - |
|
198 | - public function cas() {} |
|
199 | - |
|
200 | - public function append() {} |
|
201 | - |
|
202 | - /** |
|
203 | - * @return string |
|
204 | - */ |
|
205 | - public function prepend() {} |
|
206 | - |
|
207 | - /** |
|
208 | - * (PECL memcache >= 0.2.0)<br/> |
|
209 | - * Retrieve item from the server |
|
210 | - * @link https://php.net/manual/en/memcache.get.php |
|
211 | - * @param string|array $key <p> |
|
212 | - * The key or array of keys to fetch. |
|
213 | - * </p> |
|
214 | - * @param int|array &$flags [optional] <p> |
|
215 | - * If present, flags fetched along with the values will be written to this parameter. These |
|
216 | - * flags are the same as the ones given to for example {@link https://php.net/manual/en/memcache.set.php Memcache::set()}. |
|
217 | - * The lowest byte of the int is reserved for pecl/memcache internal usage (e.g. to indicate |
|
218 | - * compression and serialization status). |
|
219 | - * </p> |
|
220 | - * @return string|array|false <p> |
|
221 | - * Returns the string associated with the <b>key</b> or |
|
222 | - * an array of found key-value pairs when <b>key</b> is an {@link https://php.net/manual/en/language.types.array.php array}. |
|
223 | - * Returns <b>FALSE</b> on failure, <b>key</b> is not found or |
|
224 | - * <b>key</b> is an empty {@link https://php.net/manual/en/language.types.array.php array}. |
|
225 | - * </p> |
|
226 | - */ |
|
227 | - public function get($key, &$flags = null) {} |
|
228 | - |
|
229 | - /** |
|
230 | - * (PECL memcache >= 0.2.0)<br/> |
|
231 | - * Delete item from the server |
|
232 | - * https://secure.php.net/manual/en/memcache.delete.php |
|
233 | - * @param string $key The key associated with the item to delete. |
|
234 | - * @param int $timeout [optional] This deprecated parameter is not supported, and defaults to 0 seconds. Do not use this parameter. |
|
235 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
236 | - */ |
|
237 | - public function delete($key, $timeout = 0) {} |
|
238 | - |
|
239 | - /** |
|
240 | - * (PECL memcache >= 0.2.0)<br/> |
|
241 | - * Get statistics of the server |
|
242 | - * @link https://php.net/manual/en/memcache.getstats.php |
|
243 | - * @param string $type [optional] <p> |
|
244 | - * The type of statistics to fetch. |
|
245 | - * Valid values are {reset, malloc, maps, cachedump, slabs, items, sizes}. |
|
246 | - * According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".</p> |
|
247 | - * @param int $slabid [optional] <p> |
|
248 | - * Used in conjunction with <b>type</b> set to |
|
249 | - * cachedump to identify the slab to dump from. The cachedump |
|
250 | - * command ties up the server and is strictly to be used for |
|
251 | - * debugging purposes. |
|
252 | - * </p> |
|
253 | - * @param int $limit [optional] <p> |
|
254 | - * Used in conjunction with <b>type</b> set to cachedump to limit the number of entries to dump. |
|
255 | - * </p> |
|
256 | - * @return array|false Returns an associative array of server statistics or <b>FALSE</b> on failure. |
|
257 | - */ |
|
258 | - public function getStats($type = null, $slabid = null, $limit = 100) {} |
|
259 | - |
|
260 | - /** |
|
261 | - * (PECL memcache >= 2.0.0)<br/> |
|
262 | - * Get statistics from all servers in pool |
|
263 | - * @link https://php.net/manual/en/memcache.getextendedstats.php |
|
264 | - * @param string $type [optional] <p>The type of statistics to fetch. Valid values are {reset, malloc, maps, cachedump, slabs, items, sizes}. According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".</p> |
|
265 | - * @param int $slabid [optional] <p> |
|
266 | - * Used in conjunction with <b>type</b> set to |
|
267 | - * cachedump to identify the slab to dump from. The cachedump |
|
268 | - * command ties up the server and is strictly to be used for |
|
269 | - * debugging purposes. |
|
270 | - * </p> |
|
271 | - * @param int $limit Used in conjunction with type set to cachedump to limit the number of entries to dump. |
|
272 | - * @return array|false Returns a two-dimensional associative array of server statistics or <b>FALSE</b> |
|
273 | - * Returns a two-dimensional associative array of server statistics or <b>FALSE</b> |
|
274 | - * on failure. |
|
275 | - */ |
|
276 | - public function getExtendedStats($type = null, $slabid = null, $limit = 100) {} |
|
277 | - |
|
278 | - /** |
|
279 | - * (PECL memcache >= 2.0.0)<br/> |
|
280 | - * Enable automatic compression of large values |
|
281 | - * @link https://php.net/manual/en/memcache.setcompressthreshold.php |
|
282 | - * @param int $thresold <p>Controls the minimum value length before attempting to compress automatically.</p> |
|
283 | - * @param float $min_saving [optional] <p>Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.</p> |
|
284 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
285 | - */ |
|
286 | - public function setCompressThreshold($thresold, $min_saving = 0.2) {} |
|
287 | - /** |
|
288 | - * (PECL memcache >= 0.2.0)<br/> |
|
289 | - * Increment item's value |
|
290 | - * @link https://php.net/manual/en/memcache.increment.php |
|
291 | - * @param string $key Key of the item to increment. |
|
292 | - * @param int $value [optional] increment the item by <b>value</b> |
|
293 | - * @return int|false Returns new items value on success or <b>FALSE</b> on failure. |
|
294 | - */ |
|
295 | - public function increment($key, $value = 1) {} |
|
296 | - |
|
297 | - /** |
|
298 | - * (PECL memcache >= 0.2.0)<br/> |
|
299 | - * Decrement item's value |
|
300 | - * @link https://php.net/manual/en/memcache.decrement.php |
|
301 | - * @param string $key Key of the item do decrement. |
|
302 | - * @param int $value Decrement the item by <b>value</b>. |
|
303 | - * @return int|false Returns item's new value on success or <b>FALSE</b> on failure. |
|
304 | - */ |
|
305 | - public function decrement($key, $value = 1) {} |
|
306 | - |
|
307 | - /** |
|
308 | - * (PECL memcache >= 0.4.0)<br/> |
|
309 | - * Close memcached server connection |
|
310 | - * @link https://php.net/manual/en/memcache.close.php |
|
311 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
312 | - */ |
|
313 | - public function close() {} |
|
314 | - |
|
315 | - /** |
|
316 | - * (PECL memcache >= 1.0.0)<br/> |
|
317 | - * Flush all existing items at the server |
|
318 | - * @link https://php.net/manual/en/memcache.flush.php |
|
319 | - * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
320 | - */ |
|
321 | - public function flush() {} |
|
7 | + /** |
|
8 | + * (PECL memcache >= 0.2.0)<br/> |
|
9 | + * Open memcached server connection |
|
10 | + * @link https://php.net/manual/en/memcache.connect.php |
|
11 | + * @param string $host <p> |
|
12 | + * Point to the host where memcached is listening for connections. This parameter |
|
13 | + * may also specify other transports like <em>unix:///path/to/memcached.sock</em> |
|
14 | + * to use UNIX domain sockets, in this case <b>port</b> must also |
|
15 | + * be set to <em>0</em>. |
|
16 | + * </p> |
|
17 | + * @param int $port [optional] <p> |
|
18 | + * Point to the port where memcached is listening for connections. Set this |
|
19 | + * parameter to <em>0</em> when using UNIX domain sockets. |
|
20 | + * </p> |
|
21 | + * <p> |
|
22 | + * Please note: <b>port</b> defaults to |
|
23 | + * {@link https://php.net/manual/en/memcache.ini.php#ini.memcache.default-port memcache.default_port} |
|
24 | + * if not specified. For this reason it is wise to specify the port |
|
25 | + * explicitly in this method call. |
|
26 | + * </p> |
|
27 | + * @param int $timeout [optional] <p>Value in seconds which will be used for connecting to the daemon. Think twice before changing the default value of 1 second - you can lose all the advantages of caching if your connection is too slow.</p> |
|
28 | + * @return bool <p>Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.</p> |
|
29 | + */ |
|
30 | + public function connect($host, $port, $timeout = 1) {} |
|
31 | + |
|
32 | + /** |
|
33 | + * (PECL memcache >= 2.0.0)<br/> |
|
34 | + * Add a memcached server to connection pool |
|
35 | + * @link https://php.net/manual/en/memcache.addserver.php |
|
36 | + * @param string $host <p> |
|
37 | + * Point to the host where memcached is listening for connections. This parameter |
|
38 | + * may also specify other transports like unix:///path/to/memcached.sock |
|
39 | + * to use UNIX domain sockets, in this case <i>port</i> must also |
|
40 | + * be set to 0. |
|
41 | + * </p> |
|
42 | + * @param int $port [optional] <p> |
|
43 | + * Point to the port where memcached is listening for connections. |
|
44 | + * Set this |
|
45 | + * parameter to 0 when using UNIX domain sockets. |
|
46 | + * </p> |
|
47 | + * <p> |
|
48 | + * Please note: <i>port</i> defaults to |
|
49 | + * memcache.default_port |
|
50 | + * if not specified. For this reason it is wise to specify the port |
|
51 | + * explicitly in this method call. |
|
52 | + * </p> |
|
53 | + * @param bool $persistent [optional] <p> |
|
54 | + * Controls the use of a persistent connection. Default to <b>TRUE</b>. |
|
55 | + * </p> |
|
56 | + * @param int $weight [optional] <p> |
|
57 | + * Number of buckets to create for this server which in turn control its |
|
58 | + * probability of it being selected. The probability is relative to the |
|
59 | + * total weight of all servers. |
|
60 | + * </p> |
|
61 | + * @param int $timeout [optional] <p> |
|
62 | + * Value in seconds which will be used for connecting to the daemon. Think |
|
63 | + * twice before changing the default value of 1 second - you can lose all |
|
64 | + * the advantages of caching if your connection is too slow. |
|
65 | + * </p> |
|
66 | + * @param int $retry_interval [optional] <p> |
|
67 | + * Controls how often a failed server will be retried, the default value |
|
68 | + * is 15 seconds. Setting this parameter to -1 disables automatic retry. |
|
69 | + * Neither this nor the <i>persistent</i> parameter has any |
|
70 | + * effect when the extension is loaded dynamically via <b>dl</b>. |
|
71 | + * </p> |
|
72 | + * <p> |
|
73 | + * Each failed connection struct has its own timeout and before it has expired |
|
74 | + * the struct will be skipped when selecting backends to serve a request. Once |
|
75 | + * expired the connection will be successfully reconnected or marked as failed |
|
76 | + * for another <i>retry_interval</i> seconds. The typical |
|
77 | + * effect is that each web server child will retry the connection about every |
|
78 | + * <i>retry_interval</i> seconds when serving a page. |
|
79 | + * </p> |
|
80 | + * @param bool $status [optional] <p> |
|
81 | + * Controls if the server should be flagged as online. Setting this parameter |
|
82 | + * to <b>FALSE</b> and <i>retry_interval</i> to -1 allows a failed |
|
83 | + * server to be kept in the pool so as not to affect the key distribution |
|
84 | + * algorithm. Requests for this server will then failover or fail immediately |
|
85 | + * depending on the <i>memcache.allow_failover</i> setting. |
|
86 | + * Default to <b>TRUE</b>, meaning the server should be considered online. |
|
87 | + * </p> |
|
88 | + * @param callable $failure_callback [optional] <p> |
|
89 | + * Allows the user to specify a callback function to run upon encountering an |
|
90 | + * error. The callback is run before failover is attempted. The function takes |
|
91 | + * two parameters, the hostname and port of the failed server. |
|
92 | + * </p> |
|
93 | + * @param int $timeoutms [optional] <p> |
|
94 | + * </p> |
|
95 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
96 | + */ |
|
97 | + public function addServer($host, $port = 11211, $persistent = true, $weight = null, $timeout = 1, $retry_interval = 15, $status = true, callable $failure_callback = null, $timeoutms = null) {} |
|
98 | + |
|
99 | + /** |
|
100 | + * (PECL memcache >= 2.1.0)<br/> |
|
101 | + * Changes server parameters and status at runtime |
|
102 | + * @link https://secure.php.net/manual/en/memcache.setserverparams.php |
|
103 | + * @param string $host <p>Point to the host where memcached is listening for connections.</p>. |
|
104 | + * @param int $port [optional] <p> |
|
105 | + * Point to the port where memcached is listening for connections. |
|
106 | + * </p> |
|
107 | + * @param int $timeout [optional] <p> |
|
108 | + * Value in seconds which will be used for connecting to the daemon. Think twice before changing the default value of 1 second - you can lose all the advantages of caching if your connection is too slow. |
|
109 | + * </p> |
|
110 | + * @param int $retry_interval [optional] <p> |
|
111 | + * Controls how often a failed server will be retried, the default value |
|
112 | + * is 15 seconds. Setting this parameter to -1 disables automatic retry. |
|
113 | + * Neither this nor the <b>persistent</b> parameter has any |
|
114 | + * effect when the extension is loaded dynamically via {@link https://secure.php.net/manual/en/function.dl.php dl()}. |
|
115 | + * </p> |
|
116 | + * @param bool $status [optional] <p> |
|
117 | + * Controls if the server should be flagged as online. Setting this parameter |
|
118 | + * to <b>FALSE</b> and <b>retry_interval</b> to -1 allows a failed |
|
119 | + * server to be kept in the pool so as not to affect the key distribution |
|
120 | + * algorithm. Requests for this server will then failover or fail immediately |
|
121 | + * depending on the <b>memcache.allow_failover</b> setting. |
|
122 | + * Default to <b>TRUE</b>, meaning the server should be considered online. |
|
123 | + * </p> |
|
124 | + * @param callable $failure_callback [optional] <p> |
|
125 | + * Allows the user to specify a callback function to run upon encountering an error. The callback is run before failover is attempted. |
|
126 | + * The function takes two parameters, the hostname and port of the failed server. |
|
127 | + * </p> |
|
128 | + * @return bool <p>Returns <b>TRUE</b> on success or <b>FALSE</b> on failure.</p> |
|
129 | + */ |
|
130 | + public function setServerParams($host, $port = 11211, $timeout = 1, $retry_interval = 15, $status = true, callable $failure_callback = null) {} |
|
131 | + |
|
132 | + public function setFailureCallback() {} |
|
133 | + |
|
134 | + /** |
|
135 | + * (PECL memcache >= 2.1.0)<br/> |
|
136 | + * Returns server status |
|
137 | + * @link https://php.net/manual/en/memcache.getserverstatus.php |
|
138 | + * @param string $host Point to the host where memcached is listening for connections. |
|
139 | + * @param int $port Point to the port where memcached is listening for connections. |
|
140 | + * @return int Returns a the servers status. 0 if server is failed, non-zero otherwise |
|
141 | + */ |
|
142 | + public function getServerStatus($host, $port = 11211) {} |
|
143 | + |
|
144 | + public function findServer() {} |
|
145 | + |
|
146 | + /** |
|
147 | + * (PECL memcache >= 0.2.0)<br/> |
|
148 | + * Return version of the server |
|
149 | + * @link https://php.net/manual/en/memcache.getversion.php |
|
150 | + * @return string|false Returns a string of server version number or <b>FALSE</b> on failure. |
|
151 | + */ |
|
152 | + public function getVersion() {} |
|
153 | + |
|
154 | + /** |
|
155 | + * (PECL memcache >= 2.0.0)<br/> |
|
156 | + * Add an item to the server. If the key already exists, the value will not be added and <b>FALSE</b> will be returned. |
|
157 | + * @link https://php.net/manual/en/memcache.add.php |
|
158 | + * @param string $key The key that will be associated with the item. |
|
159 | + * @param mixed $var The variable to store. Strings and integers are stored as is, other types are stored serialized. |
|
160 | + * @param int $flag [optional] <p> |
|
161 | + * Use <b>MEMCACHE_COMPRESSED</b> to store the item |
|
162 | + * compressed (uses zlib). |
|
163 | + * </p> |
|
164 | + * @param int $expire [optional] <p>Expiration time of the item. |
|
165 | + * If it's equal to zero, the item will never expire. |
|
166 | + * You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).</p> |
|
167 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. Returns <b>FALSE</b> if such key already exist. For the rest Memcache::add() behaves similarly to Memcache::set(). |
|
168 | + */ |
|
169 | + public function add($key, $var, $flag = null, $expire = null) {} |
|
170 | + |
|
171 | + /** |
|
172 | + * (PECL memcache >= 0.2.0)<br/> |
|
173 | + * Stores an item var with key on the memcached server. Parameter expire is expiration time in seconds. |
|
174 | + * If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, |
|
175 | + * it could be deleted from the cache to make place for other items). |
|
176 | + * You can use MEMCACHE_COMPRESSED constant as flag value if you want to use on-the-fly compression (uses zlib). |
|
177 | + * @link https://php.net/manual/en/memcache.set.php |
|
178 | + * @param string $key The key that will be associated with the item. |
|
179 | + * @param mixed $var The variable to store. Strings and integers are stored as is, other types are stored serialized. |
|
180 | + * @param int $flag [optional] Use MEMCACHE_COMPRESSED to store the item compressed (uses zlib). |
|
181 | + * @param int $expire [optional] Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days). |
|
182 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
183 | + */ |
|
184 | + public function set($key, $var, $flag = null, $expire = null) {} |
|
185 | + |
|
186 | + /** |
|
187 | + * (PECL memcache >= 0.2.0)<br/> |
|
188 | + * Replace value of the existing item |
|
189 | + * @link https://php.net/manual/en/memcache.replace.php |
|
190 | + * @param string $key <p>The key that will be associated with the item.</p> |
|
191 | + * @param mixed $var <p>The variable to store. Strings and integers are stored as is, other types are stored serialized.</p> |
|
192 | + * @param int $flag [optional] <p>Use <b>MEMCACHE_COMPRESSED</b> to store the item compressed (uses zlib).</p> |
|
193 | + * @param int $expire [optional] <p>Expiration time of the item. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).</p> |
|
194 | + * @return bool Returns TRUE on success or FALSE on failure. |
|
195 | + */ |
|
196 | + public function replace($key, $var, $flag = null, $expire = null) {} |
|
197 | + |
|
198 | + public function cas() {} |
|
199 | + |
|
200 | + public function append() {} |
|
201 | + |
|
202 | + /** |
|
203 | + * @return string |
|
204 | + */ |
|
205 | + public function prepend() {} |
|
206 | + |
|
207 | + /** |
|
208 | + * (PECL memcache >= 0.2.0)<br/> |
|
209 | + * Retrieve item from the server |
|
210 | + * @link https://php.net/manual/en/memcache.get.php |
|
211 | + * @param string|array $key <p> |
|
212 | + * The key or array of keys to fetch. |
|
213 | + * </p> |
|
214 | + * @param int|array &$flags [optional] <p> |
|
215 | + * If present, flags fetched along with the values will be written to this parameter. These |
|
216 | + * flags are the same as the ones given to for example {@link https://php.net/manual/en/memcache.set.php Memcache::set()}. |
|
217 | + * The lowest byte of the int is reserved for pecl/memcache internal usage (e.g. to indicate |
|
218 | + * compression and serialization status). |
|
219 | + * </p> |
|
220 | + * @return string|array|false <p> |
|
221 | + * Returns the string associated with the <b>key</b> or |
|
222 | + * an array of found key-value pairs when <b>key</b> is an {@link https://php.net/manual/en/language.types.array.php array}. |
|
223 | + * Returns <b>FALSE</b> on failure, <b>key</b> is not found or |
|
224 | + * <b>key</b> is an empty {@link https://php.net/manual/en/language.types.array.php array}. |
|
225 | + * </p> |
|
226 | + */ |
|
227 | + public function get($key, &$flags = null) {} |
|
228 | + |
|
229 | + /** |
|
230 | + * (PECL memcache >= 0.2.0)<br/> |
|
231 | + * Delete item from the server |
|
232 | + * https://secure.php.net/manual/en/memcache.delete.php |
|
233 | + * @param string $key The key associated with the item to delete. |
|
234 | + * @param int $timeout [optional] This deprecated parameter is not supported, and defaults to 0 seconds. Do not use this parameter. |
|
235 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
236 | + */ |
|
237 | + public function delete($key, $timeout = 0) {} |
|
238 | + |
|
239 | + /** |
|
240 | + * (PECL memcache >= 0.2.0)<br/> |
|
241 | + * Get statistics of the server |
|
242 | + * @link https://php.net/manual/en/memcache.getstats.php |
|
243 | + * @param string $type [optional] <p> |
|
244 | + * The type of statistics to fetch. |
|
245 | + * Valid values are {reset, malloc, maps, cachedump, slabs, items, sizes}. |
|
246 | + * According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".</p> |
|
247 | + * @param int $slabid [optional] <p> |
|
248 | + * Used in conjunction with <b>type</b> set to |
|
249 | + * cachedump to identify the slab to dump from. The cachedump |
|
250 | + * command ties up the server and is strictly to be used for |
|
251 | + * debugging purposes. |
|
252 | + * </p> |
|
253 | + * @param int $limit [optional] <p> |
|
254 | + * Used in conjunction with <b>type</b> set to cachedump to limit the number of entries to dump. |
|
255 | + * </p> |
|
256 | + * @return array|false Returns an associative array of server statistics or <b>FALSE</b> on failure. |
|
257 | + */ |
|
258 | + public function getStats($type = null, $slabid = null, $limit = 100) {} |
|
259 | + |
|
260 | + /** |
|
261 | + * (PECL memcache >= 2.0.0)<br/> |
|
262 | + * Get statistics from all servers in pool |
|
263 | + * @link https://php.net/manual/en/memcache.getextendedstats.php |
|
264 | + * @param string $type [optional] <p>The type of statistics to fetch. Valid values are {reset, malloc, maps, cachedump, slabs, items, sizes}. According to the memcached protocol spec these additional arguments "are subject to change for the convenience of memcache developers".</p> |
|
265 | + * @param int $slabid [optional] <p> |
|
266 | + * Used in conjunction with <b>type</b> set to |
|
267 | + * cachedump to identify the slab to dump from. The cachedump |
|
268 | + * command ties up the server and is strictly to be used for |
|
269 | + * debugging purposes. |
|
270 | + * </p> |
|
271 | + * @param int $limit Used in conjunction with type set to cachedump to limit the number of entries to dump. |
|
272 | + * @return array|false Returns a two-dimensional associative array of server statistics or <b>FALSE</b> |
|
273 | + * Returns a two-dimensional associative array of server statistics or <b>FALSE</b> |
|
274 | + * on failure. |
|
275 | + */ |
|
276 | + public function getExtendedStats($type = null, $slabid = null, $limit = 100) {} |
|
277 | + |
|
278 | + /** |
|
279 | + * (PECL memcache >= 2.0.0)<br/> |
|
280 | + * Enable automatic compression of large values |
|
281 | + * @link https://php.net/manual/en/memcache.setcompressthreshold.php |
|
282 | + * @param int $thresold <p>Controls the minimum value length before attempting to compress automatically.</p> |
|
283 | + * @param float $min_saving [optional] <p>Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings.</p> |
|
284 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
285 | + */ |
|
286 | + public function setCompressThreshold($thresold, $min_saving = 0.2) {} |
|
287 | + /** |
|
288 | + * (PECL memcache >= 0.2.0)<br/> |
|
289 | + * Increment item's value |
|
290 | + * @link https://php.net/manual/en/memcache.increment.php |
|
291 | + * @param string $key Key of the item to increment. |
|
292 | + * @param int $value [optional] increment the item by <b>value</b> |
|
293 | + * @return int|false Returns new items value on success or <b>FALSE</b> on failure. |
|
294 | + */ |
|
295 | + public function increment($key, $value = 1) {} |
|
296 | + |
|
297 | + /** |
|
298 | + * (PECL memcache >= 0.2.0)<br/> |
|
299 | + * Decrement item's value |
|
300 | + * @link https://php.net/manual/en/memcache.decrement.php |
|
301 | + * @param string $key Key of the item do decrement. |
|
302 | + * @param int $value Decrement the item by <b>value</b>. |
|
303 | + * @return int|false Returns item's new value on success or <b>FALSE</b> on failure. |
|
304 | + */ |
|
305 | + public function decrement($key, $value = 1) {} |
|
306 | + |
|
307 | + /** |
|
308 | + * (PECL memcache >= 0.4.0)<br/> |
|
309 | + * Close memcached server connection |
|
310 | + * @link https://php.net/manual/en/memcache.close.php |
|
311 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
312 | + */ |
|
313 | + public function close() {} |
|
314 | + |
|
315 | + /** |
|
316 | + * (PECL memcache >= 1.0.0)<br/> |
|
317 | + * Flush all existing items at the server |
|
318 | + * @link https://php.net/manual/en/memcache.flush.php |
|
319 | + * @return bool Returns <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
320 | + */ |
|
321 | + public function flush() {} |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -327,28 +327,28 @@ discard block |
||
327 | 327 | */ |
328 | 328 | class Memcache extends MemcachePool |
329 | 329 | { |
330 | - /** |
|
331 | - * (PECL memcache >= 0.4.0)<br/> |
|
332 | - * Open memcached server persistent connection |
|
333 | - * @link https://php.net/manual/en/memcache.pconnect.php |
|
334 | - * @param string $host <p> |
|
335 | - * Point to the host where memcached is listening for connections. This parameter |
|
336 | - * may also specify other transports like unix:///path/to/memcached.sock |
|
337 | - * to use UNIX domain sockets, in this case <i>port</i> must also |
|
338 | - * be set to 0. |
|
339 | - * </p> |
|
340 | - * @param int $port [optional] <p> |
|
341 | - * Point to the port where memcached is listening for connections. Set this |
|
342 | - * parameter to 0 when using UNIX domain sockets. |
|
343 | - * </p> |
|
344 | - * @param int $timeout [optional] <p> |
|
345 | - * Value in seconds which will be used for connecting to the daemon. Think |
|
346 | - * twice before changing the default value of 1 second - you can lose all |
|
347 | - * the advantages of caching if your connection is too slow. |
|
348 | - * </p> |
|
349 | - * @return mixed a Memcache object or <b>FALSE</b> on failure. |
|
350 | - */ |
|
351 | - public function pconnect($host, $port, $timeout = 1) {} |
|
330 | + /** |
|
331 | + * (PECL memcache >= 0.4.0)<br/> |
|
332 | + * Open memcached server persistent connection |
|
333 | + * @link https://php.net/manual/en/memcache.pconnect.php |
|
334 | + * @param string $host <p> |
|
335 | + * Point to the host where memcached is listening for connections. This parameter |
|
336 | + * may also specify other transports like unix:///path/to/memcached.sock |
|
337 | + * to use UNIX domain sockets, in this case <i>port</i> must also |
|
338 | + * be set to 0. |
|
339 | + * </p> |
|
340 | + * @param int $port [optional] <p> |
|
341 | + * Point to the port where memcached is listening for connections. Set this |
|
342 | + * parameter to 0 when using UNIX domain sockets. |
|
343 | + * </p> |
|
344 | + * @param int $timeout [optional] <p> |
|
345 | + * Value in seconds which will be used for connecting to the daemon. Think |
|
346 | + * twice before changing the default value of 1 second - you can lose all |
|
347 | + * the advantages of caching if your connection is too slow. |
|
348 | + * </p> |
|
349 | + * @return mixed a Memcache object or <b>FALSE</b> on failure. |
|
350 | + */ |
|
351 | + public function pconnect($host, $port, $timeout = 1) {} |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | // string $host [, int $port [, int $timeout ]] |
@@ -2,8 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // Start of memcache v.3.0.8 |
4 | 4 | |
5 | -class MemcachePool |
|
6 | -{ |
|
5 | +class MemcachePool { |
|
7 | 6 | /** |
8 | 7 | * (PECL memcache >= 0.2.0)<br/> |
9 | 8 | * Open memcached server connection |
@@ -325,8 +324,7 @@ discard block |
||
325 | 324 | * Represents a connection to a set of memcache servers. |
326 | 325 | * @link https://php.net/manual/en/class.memcache.php |
327 | 326 | */ |
328 | -class Memcache extends MemcachePool |
|
329 | -{ |
|
327 | +class Memcache extends MemcachePool { |
|
330 | 328 | /** |
331 | 329 | * (PECL memcache >= 0.4.0)<br/> |
332 | 330 | * Open memcached server persistent connection |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * those headers. If no data can be returned, |
78 | 78 | * <b>exif_read_data</b> will return <b>FALSE</b>. |
79 | 79 | */ |
80 | -function exif_read_data($file, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false): array|false {} |
|
80 | +function exif_read_data($file, ?string $required_sections, bool $as_arrays = false, bool $read_thumbnail = false): array | false {} |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * Alias of <b>exif_read_data</b> |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param $thumbnail [optional] |
89 | 89 | * @removed 8.0 |
90 | 90 | */ |
91 | -#[Deprecated(replacement: "exif_read_data(%parametersList%)", since: "7.2")] |
|
91 | +#[Deprecated(replacement : "exif_read_data(%parametersList%)", since : "7.2")] |
|
92 | 92 | function read_exif_data($filename, $sections = null, $arrays = false, $thumbnail = false) {} |
93 | 93 | |
94 | 94 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return string|false the header name, or <b>FALSE</b> if <i>index</i> is |
101 | 101 | * not a defined EXIF tag id. |
102 | 102 | */ |
103 | -function exif_tagname(int $index): string|false {} |
|
103 | +function exif_tagname(int $index): string | false {} |
|
104 | 104 | |
105 | 105 | /** |
106 | 106 | * Retrieve the embedded thumbnail of a TIFF or JPEG image |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @return string|false the embedded thumbnail, or <b>FALSE</b> if the image contains no |
124 | 124 | * thumbnail. |
125 | 125 | */ |
126 | -function exif_thumbnail($file, &$width, &$height, &$image_type): string|false {} |
|
126 | +function exif_thumbnail($file, &$width, &$height, &$image_type): string | false {} |
|
127 | 127 | |
128 | 128 | /** |
129 | 129 | * Determine the type of an image |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * and return <b>FALSE</b> if it is unable to read enough bytes from the file to |
140 | 140 | * determine the image type. |
141 | 141 | */ |
142 | -function exif_imagetype(string $filename): int|false {} |
|
142 | +function exif_imagetype(string $filename): int | false {} |
|
143 | 143 | |
144 | 144 | define('EXIF_USE_MBSTRING', 1); |
145 | 145 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * </p> |
34 | 34 | * @return string|false the uncompressed data, or <b>FALSE</b> on error. |
35 | 35 | */ |
36 | -function bzread($bz, int $length = 1024): string|false {} |
|
36 | +function bzread($bz, int $length = 1024): string | false {} |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Binary safe bzip2 file write |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * </p> |
53 | 53 | * @return int|false the number of bytes written, or <b>FALSE</b> on error. |
54 | 54 | */ |
55 | -function bzwrite($bz, string $data, ?int $length): int|false {} |
|
55 | +function bzwrite($bz, string $data, ?int $length): int | false {} |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Force a write of all buffered data |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @return string|int The compressed string, or an error number if an error occurred. |
138 | 138 | */ |
139 | 139 | #[Pure] |
140 | -function bzcompress(string $data, int $block_size = 4, int $work_factor = 0): string|int {} |
|
140 | +function bzcompress(string $data, int $block_size = 4, int $work_factor = 0): string | int {} |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Decompresses bzip2 encoded data |
@@ -157,4 +157,4 @@ discard block |
||
157 | 157 | * @return string|int|false The decompressed string, or an error number if an error occurred. |
158 | 158 | */ |
159 | 159 | #[Pure] |
160 | -function bzdecompress(string $data, bool $use_less_memory = false): string|int|false {} |
|
160 | +function bzdecompress(string $data, bool $use_less_memory = false): string | int | false {} |
@@ -6,154 +6,154 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | namespace { |
9 | - /** |
|
10 | - * Minimal compress level value |
|
11 | - */ |
|
12 | - define('ZSTD_COMPRESS_LEVEL_MIN', 1); |
|
13 | - |
|
14 | - /** |
|
15 | - * Maximal compress level value |
|
16 | - */ |
|
17 | - define('ZSTD_COMPRESS_LEVEL_MAX', 22); |
|
18 | - |
|
19 | - /** |
|
20 | - * Default compress level value |
|
21 | - */ |
|
22 | - define('ZSTD_COMPRESS_LEVEL_DEFAULT', 3); |
|
23 | - |
|
24 | - /** |
|
25 | - * libzstd version number |
|
26 | - */ |
|
27 | - define('LIBZSTD_VERSION_NUMBER', 10405); |
|
28 | - |
|
29 | - /** |
|
30 | - * libzstd version string |
|
31 | - */ |
|
32 | - define('LIBZSTD_VERSION_STRING', '1.4.5'); |
|
33 | - |
|
34 | - /** |
|
35 | - * Zstandard compression. |
|
36 | - * |
|
37 | - * @param string $data The string to compress. |
|
38 | - * @param int $level The level of compression (1-22). (Defaults to 3, 0 for no compression). |
|
39 | - * A value smaller than 0 means a faster compression level. (Zstandard library 1.3.4 or later) |
|
40 | - * |
|
41 | - * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
42 | - */ |
|
43 | - function zstd_compress(string $data, int $level = 3): string|false {} |
|
44 | - |
|
45 | - /** |
|
46 | - * Zstandard decompression. |
|
47 | - * |
|
48 | - * @param string $data The compressed string. |
|
49 | - * |
|
50 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
51 | - */ |
|
52 | - function zstd_uncompress(string $data): string|false {} |
|
53 | - |
|
54 | - /** |
|
55 | - * Zstandard compression using a digested dictionary. |
|
56 | - * |
|
57 | - * @param string $data The string to compress. |
|
58 | - * @param string $dict The Dictionary data. |
|
59 | - * |
|
60 | - * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
61 | - */ |
|
62 | - function zstd_compress_dict(string $data, string $dict): string|false {} |
|
63 | - |
|
64 | - /** |
|
65 | - * Zstandard decompression using a digested dictionary. |
|
66 | - * An alias of {@see zstd_compress_dict} |
|
67 | - * |
|
68 | - * @param string $data The string to compress. |
|
69 | - * @param string $dict The Dictionary data. |
|
70 | - * |
|
71 | - * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
72 | - */ |
|
73 | - function zstd_compress_usingcdict(string $data, string $dict): string|false {} |
|
74 | - |
|
75 | - /** |
|
76 | - * Zstandard decompression using a digested dictionary. |
|
77 | - * |
|
78 | - * @param string $data The compressed string. |
|
79 | - * @param string $dict The Dictionary data. |
|
80 | - * |
|
81 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
82 | - */ |
|
83 | - function zstd_uncompress_dict(string $data, string $dict): string|false {} |
|
84 | - |
|
85 | - /** |
|
86 | - * Zstandard decompression using a digested dictionary. |
|
87 | - * An alias of {@see zstd_compress_dict} |
|
88 | - * |
|
89 | - * @param string $data The compressed string. |
|
90 | - * @param string $dict The Dictionary data. |
|
91 | - * |
|
92 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
93 | - */ |
|
94 | - function zstd_decompress_dict(string $data, string $dict): string|false {} |
|
95 | - |
|
96 | - /** |
|
97 | - * Zstandard decompression using a digested dictionary. |
|
98 | - * An alias of {@see zstd_compress_dict} |
|
99 | - * |
|
100 | - * @param string $data The compressed string. |
|
101 | - * @param string $dict The Dictionary data. |
|
102 | - * |
|
103 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
104 | - */ |
|
105 | - function zstd_uncompress_usingcdict(string $data, string $dict): string|false {} |
|
106 | - |
|
107 | - /** |
|
108 | - * Zstandard decompression using a digested dictionary. |
|
109 | - * An alias of {@see zstd_compress_dict} |
|
110 | - * |
|
111 | - * @param string $data The compressed string. |
|
112 | - * @param string $dict The Dictionary data. |
|
113 | - * |
|
114 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
115 | - */ |
|
116 | - function zstd_decompress_usingcdict(string $data, string $dict): string|false {} |
|
9 | + /** |
|
10 | + * Minimal compress level value |
|
11 | + */ |
|
12 | + define('ZSTD_COMPRESS_LEVEL_MIN', 1); |
|
13 | + |
|
14 | + /** |
|
15 | + * Maximal compress level value |
|
16 | + */ |
|
17 | + define('ZSTD_COMPRESS_LEVEL_MAX', 22); |
|
18 | + |
|
19 | + /** |
|
20 | + * Default compress level value |
|
21 | + */ |
|
22 | + define('ZSTD_COMPRESS_LEVEL_DEFAULT', 3); |
|
23 | + |
|
24 | + /** |
|
25 | + * libzstd version number |
|
26 | + */ |
|
27 | + define('LIBZSTD_VERSION_NUMBER', 10405); |
|
28 | + |
|
29 | + /** |
|
30 | + * libzstd version string |
|
31 | + */ |
|
32 | + define('LIBZSTD_VERSION_STRING', '1.4.5'); |
|
33 | + |
|
34 | + /** |
|
35 | + * Zstandard compression. |
|
36 | + * |
|
37 | + * @param string $data The string to compress. |
|
38 | + * @param int $level The level of compression (1-22). (Defaults to 3, 0 for no compression). |
|
39 | + * A value smaller than 0 means a faster compression level. (Zstandard library 1.3.4 or later) |
|
40 | + * |
|
41 | + * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
42 | + */ |
|
43 | + function zstd_compress(string $data, int $level = 3): string|false {} |
|
44 | + |
|
45 | + /** |
|
46 | + * Zstandard decompression. |
|
47 | + * |
|
48 | + * @param string $data The compressed string. |
|
49 | + * |
|
50 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
51 | + */ |
|
52 | + function zstd_uncompress(string $data): string|false {} |
|
53 | + |
|
54 | + /** |
|
55 | + * Zstandard compression using a digested dictionary. |
|
56 | + * |
|
57 | + * @param string $data The string to compress. |
|
58 | + * @param string $dict The Dictionary data. |
|
59 | + * |
|
60 | + * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
61 | + */ |
|
62 | + function zstd_compress_dict(string $data, string $dict): string|false {} |
|
63 | + |
|
64 | + /** |
|
65 | + * Zstandard decompression using a digested dictionary. |
|
66 | + * An alias of {@see zstd_compress_dict} |
|
67 | + * |
|
68 | + * @param string $data The string to compress. |
|
69 | + * @param string $dict The Dictionary data. |
|
70 | + * |
|
71 | + * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
72 | + */ |
|
73 | + function zstd_compress_usingcdict(string $data, string $dict): string|false {} |
|
74 | + |
|
75 | + /** |
|
76 | + * Zstandard decompression using a digested dictionary. |
|
77 | + * |
|
78 | + * @param string $data The compressed string. |
|
79 | + * @param string $dict The Dictionary data. |
|
80 | + * |
|
81 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
82 | + */ |
|
83 | + function zstd_uncompress_dict(string $data, string $dict): string|false {} |
|
84 | + |
|
85 | + /** |
|
86 | + * Zstandard decompression using a digested dictionary. |
|
87 | + * An alias of {@see zstd_compress_dict} |
|
88 | + * |
|
89 | + * @param string $data The compressed string. |
|
90 | + * @param string $dict The Dictionary data. |
|
91 | + * |
|
92 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
93 | + */ |
|
94 | + function zstd_decompress_dict(string $data, string $dict): string|false {} |
|
95 | + |
|
96 | + /** |
|
97 | + * Zstandard decompression using a digested dictionary. |
|
98 | + * An alias of {@see zstd_compress_dict} |
|
99 | + * |
|
100 | + * @param string $data The compressed string. |
|
101 | + * @param string $dict The Dictionary data. |
|
102 | + * |
|
103 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
104 | + */ |
|
105 | + function zstd_uncompress_usingcdict(string $data, string $dict): string|false {} |
|
106 | + |
|
107 | + /** |
|
108 | + * Zstandard decompression using a digested dictionary. |
|
109 | + * An alias of {@see zstd_compress_dict} |
|
110 | + * |
|
111 | + * @param string $data The compressed string. |
|
112 | + * @param string $dict The Dictionary data. |
|
113 | + * |
|
114 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
115 | + */ |
|
116 | + function zstd_decompress_usingcdict(string $data, string $dict): string|false {} |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | namespace Zstd { |
120 | - /** |
|
121 | - * Zstandard compression. |
|
122 | - * |
|
123 | - * @param string $data The string to compress. |
|
124 | - * @param int $level The level of compression (1-22). (Defaults to 3, 0 for no compression). |
|
125 | - * A value smaller than 0 means a faster compression level. (Zstandard library 1.3.4 or later) |
|
126 | - * |
|
127 | - * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
128 | - */ |
|
129 | - function compress(string $data, int $level = 3): string|false {} |
|
130 | - |
|
131 | - /** |
|
132 | - * Zstandard decompression. |
|
133 | - * |
|
134 | - * @param string $data The compressed string. |
|
135 | - * |
|
136 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
137 | - */ |
|
138 | - function uncompress(string $data): string|false {} |
|
139 | - |
|
140 | - /** |
|
141 | - * Zstandard compression using a digested dictionary. |
|
142 | - * |
|
143 | - * @param string $data The string to compress. |
|
144 | - * @param string $dict The Dictionary data. |
|
145 | - * |
|
146 | - * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
147 | - */ |
|
148 | - function compress_dict(string $data, string $dict): string|false {} |
|
149 | - |
|
150 | - /** |
|
151 | - * Zstandard decompression using a digested dictionary. |
|
152 | - * |
|
153 | - * @param string $data The compressed string. |
|
154 | - * @param string $dict The Dictionary data. |
|
155 | - * |
|
156 | - * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
157 | - */ |
|
158 | - function uncompress_dict(string $data, string $dict): string|false {} |
|
120 | + /** |
|
121 | + * Zstandard compression. |
|
122 | + * |
|
123 | + * @param string $data The string to compress. |
|
124 | + * @param int $level The level of compression (1-22). (Defaults to 3, 0 for no compression). |
|
125 | + * A value smaller than 0 means a faster compression level. (Zstandard library 1.3.4 or later) |
|
126 | + * |
|
127 | + * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
128 | + */ |
|
129 | + function compress(string $data, int $level = 3): string|false {} |
|
130 | + |
|
131 | + /** |
|
132 | + * Zstandard decompression. |
|
133 | + * |
|
134 | + * @param string $data The compressed string. |
|
135 | + * |
|
136 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
137 | + */ |
|
138 | + function uncompress(string $data): string|false {} |
|
139 | + |
|
140 | + /** |
|
141 | + * Zstandard compression using a digested dictionary. |
|
142 | + * |
|
143 | + * @param string $data The string to compress. |
|
144 | + * @param string $dict The Dictionary data. |
|
145 | + * |
|
146 | + * @return string|false Returns the compressed data or FALSE if an error occurred. |
|
147 | + */ |
|
148 | + function compress_dict(string $data, string $dict): string|false {} |
|
149 | + |
|
150 | + /** |
|
151 | + * Zstandard decompression using a digested dictionary. |
|
152 | + * |
|
153 | + * @param string $data The compressed string. |
|
154 | + * @param string $dict The Dictionary data. |
|
155 | + * |
|
156 | + * @return string|false Returns the decompressed data or FALSE if an error occurred. |
|
157 | + */ |
|
158 | + function uncompress_dict(string $data, string $dict): string|false {} |
|
159 | 159 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | * @return string|false Returns the compressed data or FALSE if an error occurred. |
42 | 42 | */ |
43 | - function zstd_compress(string $data, int $level = 3): string|false {} |
|
43 | + function zstd_compress(string $data, int $level = 3): string | false {} |
|
44 | 44 | |
45 | 45 | /** |
46 | 46 | * Zstandard decompression. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
51 | 51 | */ |
52 | - function zstd_uncompress(string $data): string|false {} |
|
52 | + function zstd_uncompress(string $data): string | false {} |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * Zstandard compression using a digested dictionary. |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * |
60 | 60 | * @return string|false Returns the compressed data or FALSE if an error occurred. |
61 | 61 | */ |
62 | - function zstd_compress_dict(string $data, string $dict): string|false {} |
|
62 | + function zstd_compress_dict(string $data, string $dict): string | false {} |
|
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Zstandard decompression using a digested dictionary. |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * |
71 | 71 | * @return string|false Returns the compressed data or FALSE if an error occurred. |
72 | 72 | */ |
73 | - function zstd_compress_usingcdict(string $data, string $dict): string|false {} |
|
73 | + function zstd_compress_usingcdict(string $data, string $dict): string | false {} |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Zstandard decompression using a digested dictionary. |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
82 | 82 | */ |
83 | - function zstd_uncompress_dict(string $data, string $dict): string|false {} |
|
83 | + function zstd_uncompress_dict(string $data, string $dict): string | false {} |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Zstandard decompression using a digested dictionary. |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * |
92 | 92 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
93 | 93 | */ |
94 | - function zstd_decompress_dict(string $data, string $dict): string|false {} |
|
94 | + function zstd_decompress_dict(string $data, string $dict): string | false {} |
|
95 | 95 | |
96 | 96 | /** |
97 | 97 | * Zstandard decompression using a digested dictionary. |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | * |
103 | 103 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
104 | 104 | */ |
105 | - function zstd_uncompress_usingcdict(string $data, string $dict): string|false {} |
|
105 | + function zstd_uncompress_usingcdict(string $data, string $dict): string | false {} |
|
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Zstandard decompression using a digested dictionary. |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
115 | 115 | */ |
116 | - function zstd_decompress_usingcdict(string $data, string $dict): string|false {} |
|
116 | + function zstd_decompress_usingcdict(string $data, string $dict): string | false {} |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | namespace Zstd { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return string|false Returns the compressed data or FALSE if an error occurred. |
128 | 128 | */ |
129 | - function compress(string $data, int $level = 3): string|false {} |
|
129 | + function compress(string $data, int $level = 3): string | false {} |
|
130 | 130 | |
131 | 131 | /** |
132 | 132 | * Zstandard decompression. |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
137 | 137 | */ |
138 | - function uncompress(string $data): string|false {} |
|
138 | + function uncompress(string $data): string | false {} |
|
139 | 139 | |
140 | 140 | /** |
141 | 141 | * Zstandard compression using a digested dictionary. |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * |
146 | 146 | * @return string|false Returns the compressed data or FALSE if an error occurred. |
147 | 147 | */ |
148 | - function compress_dict(string $data, string $dict): string|false {} |
|
148 | + function compress_dict(string $data, string $dict): string | false {} |
|
149 | 149 | |
150 | 150 | /** |
151 | 151 | * Zstandard decompression using a digested dictionary. |
@@ -155,5 +155,5 @@ discard block |
||
155 | 155 | * |
156 | 156 | * @return string|false Returns the decompressed data or FALSE if an error occurred. |
157 | 157 | */ |
158 | - function uncompress_dict(string $data, string $dict): string|false {} |
|
158 | + function uncompress_dict(string $data, string $dict): string | false {} |
|
159 | 159 | } |
@@ -9,379 +9,379 @@ discard block |
||
9 | 9 | */ |
10 | 10 | final class Ev |
11 | 11 | { |
12 | - /** |
|
13 | - * Flag passed to create a loop: The default flags value |
|
14 | - */ |
|
15 | - public const FLAG_AUTO = 0; |
|
16 | - |
|
17 | - /** |
|
18 | - * Flag passed to create a loop: If this flag used(or the program runs setuid or setgid), libev won't look at the |
|
19 | - * environment variable LIBEV_FLAGS. Otherwise(by default), LIBEV_FLAGS will override the flags completely if it is |
|
20 | - * found. Useful for performance tests and searching for bugs. |
|
21 | - */ |
|
22 | - public const FLAG_NOENV = 16777216; |
|
23 | - |
|
24 | - /** |
|
25 | - * Flag passed to create a loop: Makes libev check for a fork in each iteration, instead of calling EvLoop::fork() |
|
26 | - * manually. This works by calling getpid() on every iteration of the loop, and thus this might slow down the event |
|
27 | - * loop with lots of loop iterations, but usually is not noticeable. This flag setting cannot be overridden or |
|
28 | - * specified in the LIBEV_FLAGS environment variable. |
|
29 | - */ |
|
30 | - public const FLAG_FORKCHECK = 33554432; |
|
31 | - |
|
32 | - /** |
|
33 | - * Flag passed to create a loop: When this flag is specified, libev won't attempt to use the inotify API for its |
|
34 | - * ev_stat watchers. The flag can be useful to conserve inotify file descriptors, as otherwise each loop using |
|
35 | - * ev_stat watchers consumes one inotify handle. |
|
36 | - */ |
|
37 | - public const FLAG_NOINOTIFY = 1048576; |
|
38 | - |
|
39 | - /** |
|
40 | - * Flag passed to create a loop: When this flag is specified, libev will attempt to use the signalfd API for its |
|
41 | - * ev_signal (and ev_child ) watchers. This API delivers signals synchronously, which makes it both faster and might |
|
42 | - * make it possible to get the queued signal data. It can also simplify signal handling with threads, as long as |
|
43 | - * signals are properly blocked in threads. Signalfd will not be used by default. |
|
44 | - */ |
|
45 | - public const FLAG_SIGNALFD = 2097152; |
|
46 | - |
|
47 | - /** |
|
48 | - * Flag passed to create a loop: When this flag is specified, libev will avoid to modify the signal mask. |
|
49 | - * Specifically, this means having to make sure signals are unblocked before receiving them. |
|
50 | - * |
|
51 | - * This behaviour is useful for custom signal handling, or handling signals only in specific threads. |
|
52 | - */ |
|
53 | - public const FLAG_NOSIGMASK = 4194304; |
|
54 | - |
|
55 | - /** |
|
56 | - * Flag passed to Ev::run() or EvLoop::run(): Means that event loop will look for new events, will handle those |
|
57 | - * events and any already outstanding ones, but will not wait and block the process in case there are no events and |
|
58 | - * will return after one iteration of the loop. This is sometimes useful to poll and handle new events while doing |
|
59 | - * lengthy calculations, to keep the program responsive. |
|
60 | - */ |
|
61 | - public const RUN_NOWAIT = 1; |
|
62 | - |
|
63 | - /** |
|
64 | - * Flag passed to Ev::run() or EvLoop::run(): Means that event loop will look for new events (waiting if necessary) |
|
65 | - * and will handle those and any already outstanding ones. It will block the process until at least one new event |
|
66 | - * arrives (which could be an event internal to libev itself, so there is no guarantee that a user-registered |
|
67 | - * callback will be called), and will return after one iteration of the loop. |
|
68 | - */ |
|
69 | - public const RUN_ONCE = 2; |
|
70 | - |
|
71 | - /** |
|
72 | - * Flag passed to Ev::stop() or EvLoop::stop(): Cancel the break operation. |
|
73 | - */ |
|
74 | - public const BREAK_CANCEL = 0; |
|
75 | - |
|
76 | - /** |
|
77 | - * Flag passed to Ev::stop() or EvLoop::stop(): Makes the innermost Ev::run() or EvLoop::run() call return. |
|
78 | - */ |
|
79 | - public const BREAK_ONE = 1; |
|
80 | - |
|
81 | - /** |
|
82 | - * Flag passed to Ev::stop() or EvLoop::stop(): Makes all nested Ev::run() or EvLoop::run() calls return. |
|
83 | - */ |
|
84 | - public const BREAK_ALL = 2; |
|
85 | - |
|
86 | - /** |
|
87 | - * Lowest allowed watcher priority. |
|
88 | - */ |
|
89 | - public const MINPRI = -2; |
|
90 | - |
|
91 | - /** |
|
92 | - * Highest allowed watcher priority. |
|
93 | - */ |
|
94 | - public const MAXPRI = 2; |
|
95 | - |
|
96 | - /** |
|
97 | - * Event bitmask: The file descriptor in the EvIo watcher has become readable. |
|
98 | - */ |
|
99 | - public const READ = 1; |
|
100 | - |
|
101 | - /** |
|
102 | - * Event bitmask: The file descriptor in the EvIo watcher has become writable. |
|
103 | - */ |
|
104 | - public const WRITE = 2; |
|
105 | - |
|
106 | - /** |
|
107 | - * Event bitmask: EvTimer watcher has been timed out. |
|
108 | - */ |
|
109 | - public const TIMER = 256; |
|
110 | - |
|
111 | - /** |
|
112 | - * Event bitmask: EvPeriodic watcher has been timed out. |
|
113 | - */ |
|
114 | - public const PERIODIC = 512; |
|
115 | - |
|
116 | - /** |
|
117 | - * Event bitmask: A signal specified in EvSignal::__construct() has been received. |
|
118 | - */ |
|
119 | - public const SIGNAL = 1024; |
|
120 | - |
|
121 | - /** |
|
122 | - * Event bitmask: The pid specified in EvChild::__construct() has received a status change. |
|
123 | - */ |
|
124 | - public const CHILD = 2048; |
|
125 | - |
|
126 | - /** |
|
127 | - * Event bitmask: The path specified in EvStat watcher changed its attributes. |
|
128 | - */ |
|
129 | - public const STAT = 4096; |
|
130 | - |
|
131 | - /** |
|
132 | - * Event bitmask: EvIdle watcher works when there is nothing to do with other watchers. |
|
133 | - */ |
|
134 | - public const IDLE = 8192; |
|
135 | - |
|
136 | - /** |
|
137 | - * Event bitmask: All EvPrepare watchers are invoked just before Ev::run() starts. Thus, EvPrepare watchers are the |
|
138 | - * last watchers invoked before the event loop sleeps or polls for new events. |
|
139 | - */ |
|
140 | - public const PREPARE = 16384; |
|
141 | - |
|
142 | - /** |
|
143 | - * Event bitmask: All EvCheck watchers are queued just after Ev::run() has gathered the new events, but before it |
|
144 | - * queues any callbacks for any received events. Thus, EvCheck watchers will be invoked before any other watchers |
|
145 | - * of the same or lower priority within an event loop iteration. |
|
146 | - */ |
|
147 | - public const CHECK = 32768; |
|
148 | - |
|
149 | - /** |
|
150 | - * Event bitmask: The embedded event loop specified in the EvEmbed watcher needs attention. |
|
151 | - */ |
|
152 | - public const EMBED = 65536; |
|
153 | - |
|
154 | - /** |
|
155 | - * Event bitmask: Not ever sent(or otherwise used) by libev itself, but can be freely used by libev users to signal |
|
156 | - * watchers (e.g. via EvWatcher::feed() ). |
|
157 | - */ |
|
158 | - public const CUSTOM = 16777216; |
|
159 | - |
|
160 | - /** |
|
161 | - * Event bitmask: An unspecified error has occurred, the watcher has been stopped. This might happen because the |
|
162 | - * watcher could not be properly started because libev ran out of memory, a file descriptor was found to be closed |
|
163 | - * or any other problem. Libev considers these application bugs. |
|
164 | - */ |
|
165 | - public const ERROR = -2147483648; |
|
166 | - |
|
167 | - /** |
|
168 | - * select(2) backend |
|
169 | - */ |
|
170 | - public const BACKEND_SELECT = 1; |
|
171 | - |
|
172 | - /** |
|
173 | - * poll(2) backend |
|
174 | - */ |
|
175 | - public const BACKEND_POLL = 2; |
|
176 | - |
|
177 | - /** |
|
178 | - * Linux-specific epoll(7) backend for both pre- and post-2.6.9 kernels |
|
179 | - */ |
|
180 | - public const BACKEND_EPOLL = 4; |
|
181 | - |
|
182 | - /** |
|
183 | - * kqueue backend used on most BSD systems. EvEmbed watcher could be used to embed one loop(with kqueue backend) |
|
184 | - * into another. For instance, one can try to create an event loop with kqueue backend and use it for sockets only. |
|
185 | - */ |
|
186 | - public const BACKEND_KQUEUE = 8; |
|
187 | - |
|
188 | - /** |
|
189 | - * Solaris 8 backend. This is not implemented yet. |
|
190 | - */ |
|
191 | - public const BACKEND_DEVPOLL = 16; |
|
192 | - |
|
193 | - /** |
|
194 | - * Solaris 10 event port mechanism with a good scaling. |
|
195 | - */ |
|
196 | - public const BACKEND_PORT = 32; |
|
197 | - |
|
198 | - /** |
|
199 | - * Try all backends(even currupted ones). It's not recommended to use it explicitly. Bitwise operators should be |
|
200 | - * applied here(e.g. Ev::BACKEND_ALL & ~ Ev::BACKEND_KQUEUE ) Use Ev::recommendedBackends() , or don't specify any |
|
201 | - * backends at all. |
|
202 | - */ |
|
203 | - public const BACKEND_ALL = 255; |
|
204 | - |
|
205 | - /** |
|
206 | - * Not a backend, but a mask to select all backend bits from flags value to mask out any backends(e.g. when |
|
207 | - * modifying the LIBEV_FLAGS environment variable). |
|
208 | - */ |
|
209 | - public const BACKEND_MASK = 65535; |
|
210 | - |
|
211 | - /* Methods */ |
|
212 | - |
|
213 | - /** |
|
214 | - * Returns an integer describing the backend used by libev. |
|
215 | - * |
|
216 | - * Returns an integer describing the backend used by libev. See Ev::BACKEND_* flags |
|
217 | - * |
|
218 | - * @return int Bit mask describing the backend used by libev, see Ev::BACKEND_* flags. |
|
219 | - */ |
|
220 | - final public static function backend() {} |
|
221 | - |
|
222 | - /** |
|
223 | - * Returns recursion depth |
|
224 | - * |
|
225 | - * The number of times Ev::run() was entered minus the number of times Ev::run() was exited normally, in other |
|
226 | - * words, the recursion depth. Outside Ev::run() , this number is 0 . In a callback, this number is 1 , unless |
|
227 | - * Ev::run() was invoked recursively (or from another thread), in which case it is higher. |
|
228 | - * |
|
229 | - * @return int Recursion depth of the default loop. |
|
230 | - */ |
|
231 | - final public static function depth() {} |
|
232 | - |
|
233 | - /** |
|
234 | - * Returns the set of backends that are embeddable in other event loops. |
|
235 | - * |
|
236 | - * @return int Bit mask which can contain Ev::BACKEND_* flags combined using bitwise OR operator. |
|
237 | - */ |
|
238 | - final public static function embeddableBackends() {} |
|
239 | - |
|
240 | - /** |
|
241 | - * Feed signal event into Ev |
|
242 | - * |
|
243 | - * Simulates a signal receive. It is safe to call this function at any time, from any context, including signal |
|
244 | - * handlers or random threads. Its main use is to customise signal handling in the process. |
|
245 | - * |
|
246 | - * Unlike Ev::feedSignalEvent() , this works regardless of which loop has registered the signal. |
|
247 | - * |
|
248 | - * @param int $signum Signal number. See signal(7) man page for details. You can use constants exported by pcntl |
|
249 | - * extension. |
|
250 | - */ |
|
251 | - final public static function feedSignal(int $signum) {} |
|
252 | - |
|
253 | - /** |
|
254 | - * Feed signal event into the default loop |
|
255 | - * |
|
256 | - * Feed signal event into the default loop. Ev will react to this call as if the signal specified by signal had |
|
257 | - * occurred. |
|
258 | - * |
|
259 | - * @param int $signum Signal number. See signal(7) man page for details. See also constants exported by pcntl |
|
260 | - * extension. |
|
261 | - */ |
|
262 | - final public static function feedSignalEvent(int $signum) {} |
|
263 | - |
|
264 | - /** |
|
265 | - * Return the number of times the default event loop has polled for new events. |
|
266 | - * |
|
267 | - * Return the number of times the event loop has polled for new events. Sometimes useful as a generation counter. |
|
268 | - * |
|
269 | - * @return int Number of polls of the default event loop. |
|
270 | - */ |
|
271 | - final public static function iteration() {} |
|
272 | - |
|
273 | - /** |
|
274 | - * Returns the time when the last iteration of the default event loop has started. |
|
275 | - * |
|
276 | - * Returns the time when the last iteration of the default event loop has started. This is the time that timers |
|
277 | - * (EvTimer and EvPeriodic) are based on, and referring to it is usually faster then calling Ev::time(). |
|
278 | - * |
|
279 | - * @return float Number of seconds(fractional) representing the time when the last iteration of the default event |
|
280 | - * loop has started. |
|
281 | - */ |
|
282 | - final public static function now() {} |
|
283 | - |
|
284 | - /** |
|
285 | - * Establishes the current time by querying the kernel, updating the time returned by Ev::now in the progress. |
|
286 | - * |
|
287 | - * Establishes the current time by querying the kernel, updating the time returned by Ev::now() in the progress. |
|
288 | - * This is a costly operation and is usually done automatically within Ev::run(). |
|
289 | - * |
|
290 | - * This method is rarely useful, but when some event callback runs for a very long time without entering the event |
|
291 | - * loop, updating libev's consideration of the current time is a good idea. |
|
292 | - */ |
|
293 | - final public static function nowUpdate() {} |
|
294 | - |
|
295 | - /** |
|
296 | - * Returns a bit mask of recommended backends for current platform. |
|
297 | - * |
|
298 | - * Returns the set of all backends compiled into this binary of libev and also recommended for this platform, |
|
299 | - * meaning it will work for most file descriptor types. This set is often smaller than the one returned by |
|
300 | - * Ev::supportedBackends(), as for example kqueue is broken on most BSD systems and will not be auto-detected |
|
301 | - * unless it is requested explicitly. This is the set of backends that libev will probe with no backends specified |
|
302 | - * explicitly. |
|
303 | - * |
|
304 | - * @return int Bit mask which can contain Ev::BACKEND_* flags combined using bitwise OR operator. |
|
305 | - */ |
|
306 | - final public static function recommendedBackends() {} |
|
307 | - |
|
308 | - /** |
|
309 | - * Resume previously suspended default event loop. |
|
310 | - * |
|
311 | - * Ev::suspend() and Ev::resume() methods suspend and resume a loop correspondingly. |
|
312 | - * |
|
313 | - * All timer watchers will be delayed by the time spend between suspend and resume , and all periodic watchers will |
|
314 | - * be rescheduled(that is, they will lose any events that would have occurred while suspended). |
|
315 | - * |
|
316 | - * After calling Ev::suspend() it is not allowed to call any function on the given loop other than Ev::resume(). |
|
317 | - * Also it is not allowed to call Ev::resume() without a previous call to Ev::suspend(). |
|
318 | - * |
|
319 | - * Calling suspend / resume has the side effect of updating the event loop time (see Ev::nowUpdate()). |
|
320 | - */ |
|
321 | - final public static function resume() {} |
|
322 | - |
|
323 | - /** |
|
324 | - * Begin checking for events and calling callbacks for the default loop. |
|
325 | - * |
|
326 | - * Begin checking for events and calling callbacks for the default loop . Returns when a callback calls Ev::stop() |
|
327 | - * method, or the flags are nonzero(in which case the return value is true) or when there are no active watchers |
|
328 | - * which reference the loop( EvWatcher::keepalive() is TRUE), in which case the return value will be FALSE. The |
|
329 | - * return value can generally be interpreted as if TRUE, there is more work left to do. |
|
330 | - * |
|
331 | - * @param int $flags One of the Ev::FLAG_* flags |
|
332 | - */ |
|
333 | - final public static function run(int $flags = self::FLAG_AUTO) {} |
|
334 | - |
|
335 | - /** |
|
336 | - * Block the process for the given number of seconds. |
|
337 | - * |
|
338 | - * @param float $seconds Fractional number of seconds |
|
339 | - */ |
|
340 | - final public static function sleep(float $seconds) {} |
|
341 | - |
|
342 | - /** |
|
343 | - * Stops the default event loop |
|
344 | - * |
|
345 | - * @param int $how One of the Ev::BREAK_* constants |
|
346 | - */ |
|
347 | - final public static function stop(int $how = self::BREAK_ONE) {} |
|
348 | - |
|
349 | - /** |
|
350 | - * Returns the set of backends supported by current libev configuration. |
|
351 | - * |
|
352 | - * @return int Bit mask which can contain Ev::BACKEND_* flags combined using bitwise OR operator. |
|
353 | - */ |
|
354 | - final public static function supportedBackends() {} |
|
355 | - |
|
356 | - /** |
|
357 | - * Suspend the default event loop. |
|
358 | - * |
|
359 | - * Ev::suspend() and Ev::resume() methods suspend and resume the default loop correspondingly. |
|
360 | - * |
|
361 | - * All timer watchers will be delayed by the time spend between suspend and resume , and all periodic watchers will |
|
362 | - * be rescheduled(that is, they will lose any events that would have occurred while suspended). |
|
363 | - * |
|
364 | - * After calling Ev::suspend() it is not allowed to call any function on the given loop other than Ev::resume(). |
|
365 | - * Also it is not allowed to call Ev::resume() without a previous call to Ev::suspend(). |
|
366 | - */ |
|
367 | - final public static function suspend() {} |
|
368 | - |
|
369 | - /** |
|
370 | - * Returns the current time in fractional seconds since the epoch. |
|
371 | - * |
|
372 | - * Returns the current time in fractional seconds since the epoch. Consider using Ev::now() |
|
373 | - * |
|
374 | - * @return float The current time in fractional seconds since the epoch. |
|
375 | - */ |
|
376 | - final public static function time() {} |
|
377 | - |
|
378 | - /** |
|
379 | - * Performs internal consistency checks (for debugging). |
|
380 | - * |
|
381 | - * Performs internal consistency checks (for debugging libev) and abort the program if any data structures were |
|
382 | - * found to be corrupted. |
|
383 | - */ |
|
384 | - final public static function verify() {} |
|
12 | + /** |
|
13 | + * Flag passed to create a loop: The default flags value |
|
14 | + */ |
|
15 | + public const FLAG_AUTO = 0; |
|
16 | + |
|
17 | + /** |
|
18 | + * Flag passed to create a loop: If this flag used(or the program runs setuid or setgid), libev won't look at the |
|
19 | + * environment variable LIBEV_FLAGS. Otherwise(by default), LIBEV_FLAGS will override the flags completely if it is |
|
20 | + * found. Useful for performance tests and searching for bugs. |
|
21 | + */ |
|
22 | + public const FLAG_NOENV = 16777216; |
|
23 | + |
|
24 | + /** |
|
25 | + * Flag passed to create a loop: Makes libev check for a fork in each iteration, instead of calling EvLoop::fork() |
|
26 | + * manually. This works by calling getpid() on every iteration of the loop, and thus this might slow down the event |
|
27 | + * loop with lots of loop iterations, but usually is not noticeable. This flag setting cannot be overridden or |
|
28 | + * specified in the LIBEV_FLAGS environment variable. |
|
29 | + */ |
|
30 | + public const FLAG_FORKCHECK = 33554432; |
|
31 | + |
|
32 | + /** |
|
33 | + * Flag passed to create a loop: When this flag is specified, libev won't attempt to use the inotify API for its |
|
34 | + * ev_stat watchers. The flag can be useful to conserve inotify file descriptors, as otherwise each loop using |
|
35 | + * ev_stat watchers consumes one inotify handle. |
|
36 | + */ |
|
37 | + public const FLAG_NOINOTIFY = 1048576; |
|
38 | + |
|
39 | + /** |
|
40 | + * Flag passed to create a loop: When this flag is specified, libev will attempt to use the signalfd API for its |
|
41 | + * ev_signal (and ev_child ) watchers. This API delivers signals synchronously, which makes it both faster and might |
|
42 | + * make it possible to get the queued signal data. It can also simplify signal handling with threads, as long as |
|
43 | + * signals are properly blocked in threads. Signalfd will not be used by default. |
|
44 | + */ |
|
45 | + public const FLAG_SIGNALFD = 2097152; |
|
46 | + |
|
47 | + /** |
|
48 | + * Flag passed to create a loop: When this flag is specified, libev will avoid to modify the signal mask. |
|
49 | + * Specifically, this means having to make sure signals are unblocked before receiving them. |
|
50 | + * |
|
51 | + * This behaviour is useful for custom signal handling, or handling signals only in specific threads. |
|
52 | + */ |
|
53 | + public const FLAG_NOSIGMASK = 4194304; |
|
54 | + |
|
55 | + /** |
|
56 | + * Flag passed to Ev::run() or EvLoop::run(): Means that event loop will look for new events, will handle those |
|
57 | + * events and any already outstanding ones, but will not wait and block the process in case there are no events and |
|
58 | + * will return after one iteration of the loop. This is sometimes useful to poll and handle new events while doing |
|
59 | + * lengthy calculations, to keep the program responsive. |
|
60 | + */ |
|
61 | + public const RUN_NOWAIT = 1; |
|
62 | + |
|
63 | + /** |
|
64 | + * Flag passed to Ev::run() or EvLoop::run(): Means that event loop will look for new events (waiting if necessary) |
|
65 | + * and will handle those and any already outstanding ones. It will block the process until at least one new event |
|
66 | + * arrives (which could be an event internal to libev itself, so there is no guarantee that a user-registered |
|
67 | + * callback will be called), and will return after one iteration of the loop. |
|
68 | + */ |
|
69 | + public const RUN_ONCE = 2; |
|
70 | + |
|
71 | + /** |
|
72 | + * Flag passed to Ev::stop() or EvLoop::stop(): Cancel the break operation. |
|
73 | + */ |
|
74 | + public const BREAK_CANCEL = 0; |
|
75 | + |
|
76 | + /** |
|
77 | + * Flag passed to Ev::stop() or EvLoop::stop(): Makes the innermost Ev::run() or EvLoop::run() call return. |
|
78 | + */ |
|
79 | + public const BREAK_ONE = 1; |
|
80 | + |
|
81 | + /** |
|
82 | + * Flag passed to Ev::stop() or EvLoop::stop(): Makes all nested Ev::run() or EvLoop::run() calls return. |
|
83 | + */ |
|
84 | + public const BREAK_ALL = 2; |
|
85 | + |
|
86 | + /** |
|
87 | + * Lowest allowed watcher priority. |
|
88 | + */ |
|
89 | + public const MINPRI = -2; |
|
90 | + |
|
91 | + /** |
|
92 | + * Highest allowed watcher priority. |
|
93 | + */ |
|
94 | + public const MAXPRI = 2; |
|
95 | + |
|
96 | + /** |
|
97 | + * Event bitmask: The file descriptor in the EvIo watcher has become readable. |
|
98 | + */ |
|
99 | + public const READ = 1; |
|
100 | + |
|
101 | + /** |
|
102 | + * Event bitmask: The file descriptor in the EvIo watcher has become writable. |
|
103 | + */ |
|
104 | + public const WRITE = 2; |
|
105 | + |
|
106 | + /** |
|
107 | + * Event bitmask: EvTimer watcher has been timed out. |
|
108 | + */ |
|
109 | + public const TIMER = 256; |
|
110 | + |
|
111 | + /** |
|
112 | + * Event bitmask: EvPeriodic watcher has been timed out. |
|
113 | + */ |
|
114 | + public const PERIODIC = 512; |
|
115 | + |
|
116 | + /** |
|
117 | + * Event bitmask: A signal specified in EvSignal::__construct() has been received. |
|
118 | + */ |
|
119 | + public const SIGNAL = 1024; |
|
120 | + |
|
121 | + /** |
|
122 | + * Event bitmask: The pid specified in EvChild::__construct() has received a status change. |
|
123 | + */ |
|
124 | + public const CHILD = 2048; |
|
125 | + |
|
126 | + /** |
|
127 | + * Event bitmask: The path specified in EvStat watcher changed its attributes. |
|
128 | + */ |
|
129 | + public const STAT = 4096; |
|
130 | + |
|
131 | + /** |
|
132 | + * Event bitmask: EvIdle watcher works when there is nothing to do with other watchers. |
|
133 | + */ |
|
134 | + public const IDLE = 8192; |
|
135 | + |
|
136 | + /** |
|
137 | + * Event bitmask: All EvPrepare watchers are invoked just before Ev::run() starts. Thus, EvPrepare watchers are the |
|
138 | + * last watchers invoked before the event loop sleeps or polls for new events. |
|
139 | + */ |
|
140 | + public const PREPARE = 16384; |
|
141 | + |
|
142 | + /** |
|
143 | + * Event bitmask: All EvCheck watchers are queued just after Ev::run() has gathered the new events, but before it |
|
144 | + * queues any callbacks for any received events. Thus, EvCheck watchers will be invoked before any other watchers |
|
145 | + * of the same or lower priority within an event loop iteration. |
|
146 | + */ |
|
147 | + public const CHECK = 32768; |
|
148 | + |
|
149 | + /** |
|
150 | + * Event bitmask: The embedded event loop specified in the EvEmbed watcher needs attention. |
|
151 | + */ |
|
152 | + public const EMBED = 65536; |
|
153 | + |
|
154 | + /** |
|
155 | + * Event bitmask: Not ever sent(or otherwise used) by libev itself, but can be freely used by libev users to signal |
|
156 | + * watchers (e.g. via EvWatcher::feed() ). |
|
157 | + */ |
|
158 | + public const CUSTOM = 16777216; |
|
159 | + |
|
160 | + /** |
|
161 | + * Event bitmask: An unspecified error has occurred, the watcher has been stopped. This might happen because the |
|
162 | + * watcher could not be properly started because libev ran out of memory, a file descriptor was found to be closed |
|
163 | + * or any other problem. Libev considers these application bugs. |
|
164 | + */ |
|
165 | + public const ERROR = -2147483648; |
|
166 | + |
|
167 | + /** |
|
168 | + * select(2) backend |
|
169 | + */ |
|
170 | + public const BACKEND_SELECT = 1; |
|
171 | + |
|
172 | + /** |
|
173 | + * poll(2) backend |
|
174 | + */ |
|
175 | + public const BACKEND_POLL = 2; |
|
176 | + |
|
177 | + /** |
|
178 | + * Linux-specific epoll(7) backend for both pre- and post-2.6.9 kernels |
|
179 | + */ |
|
180 | + public const BACKEND_EPOLL = 4; |
|
181 | + |
|
182 | + /** |
|
183 | + * kqueue backend used on most BSD systems. EvEmbed watcher could be used to embed one loop(with kqueue backend) |
|
184 | + * into another. For instance, one can try to create an event loop with kqueue backend and use it for sockets only. |
|
185 | + */ |
|
186 | + public const BACKEND_KQUEUE = 8; |
|
187 | + |
|
188 | + /** |
|
189 | + * Solaris 8 backend. This is not implemented yet. |
|
190 | + */ |
|
191 | + public const BACKEND_DEVPOLL = 16; |
|
192 | + |
|
193 | + /** |
|
194 | + * Solaris 10 event port mechanism with a good scaling. |
|
195 | + */ |
|
196 | + public const BACKEND_PORT = 32; |
|
197 | + |
|
198 | + /** |
|
199 | + * Try all backends(even currupted ones). It's not recommended to use it explicitly. Bitwise operators should be |
|
200 | + * applied here(e.g. Ev::BACKEND_ALL & ~ Ev::BACKEND_KQUEUE ) Use Ev::recommendedBackends() , or don't specify any |
|
201 | + * backends at all. |
|
202 | + */ |
|
203 | + public const BACKEND_ALL = 255; |
|
204 | + |
|
205 | + /** |
|
206 | + * Not a backend, but a mask to select all backend bits from flags value to mask out any backends(e.g. when |
|
207 | + * modifying the LIBEV_FLAGS environment variable). |
|
208 | + */ |
|
209 | + public const BACKEND_MASK = 65535; |
|
210 | + |
|
211 | + /* Methods */ |
|
212 | + |
|
213 | + /** |
|
214 | + * Returns an integer describing the backend used by libev. |
|
215 | + * |
|
216 | + * Returns an integer describing the backend used by libev. See Ev::BACKEND_* flags |
|
217 | + * |
|
218 | + * @return int Bit mask describing the backend used by libev, see Ev::BACKEND_* flags. |
|
219 | + */ |
|
220 | + final public static function backend() {} |
|
221 | + |
|
222 | + /** |
|
223 | + * Returns recursion depth |
|
224 | + * |
|
225 | + * The number of times Ev::run() was entered minus the number of times Ev::run() was exited normally, in other |
|
226 | + * words, the recursion depth. Outside Ev::run() , this number is 0 . In a callback, this number is 1 , unless |
|
227 | + * Ev::run() was invoked recursively (or from another thread), in which case it is higher. |
|
228 | + * |
|
229 | + * @return int Recursion depth of the default loop. |
|
230 | + */ |
|
231 | + final public static function depth() {} |
|
232 | + |
|
233 | + /** |
|
234 | + * Returns the set of backends that are embeddable in other event loops. |
|
235 | + * |
|
236 | + * @return int Bit mask which can contain Ev::BACKEND_* flags combined using bitwise OR operator. |
|
237 | + */ |
|
238 | + final public static function embeddableBackends() {} |
|
239 | + |
|
240 | + /** |
|
241 | + * Feed signal event into Ev |
|
242 | + * |
|
243 | + * Simulates a signal receive. It is safe to call this function at any time, from any context, including signal |
|
244 | + * handlers or random threads. Its main use is to customise signal handling in the process. |
|
245 | + * |
|
246 | + * Unlike Ev::feedSignalEvent() , this works regardless of which loop has registered the signal. |
|
247 | + * |
|
248 | + * @param int $signum Signal number. See signal(7) man page for details. You can use constants exported by pcntl |
|
249 | + * extension. |
|
250 | + */ |
|
251 | + final public static function feedSignal(int $signum) {} |
|
252 | + |
|
253 | + /** |
|
254 | + * Feed signal event into the default loop |
|
255 | + * |
|
256 | + * Feed signal event into the default loop. Ev will react to this call as if the signal specified by signal had |
|
257 | + * occurred. |
|
258 | + * |
|
259 | + * @param int $signum Signal number. See signal(7) man page for details. See also constants exported by pcntl |
|
260 | + * extension. |
|
261 | + */ |
|
262 | + final public static function feedSignalEvent(int $signum) {} |
|
263 | + |
|
264 | + /** |
|
265 | + * Return the number of times the default event loop has polled for new events. |
|
266 | + * |
|
267 | + * Return the number of times the event loop has polled for new events. Sometimes useful as a generation counter. |
|
268 | + * |
|
269 | + * @return int Number of polls of the default event loop. |
|
270 | + */ |
|
271 | + final public static function iteration() {} |
|
272 | + |
|
273 | + /** |
|
274 | + * Returns the time when the last iteration of the default event loop has started. |
|
275 | + * |
|
276 | + * Returns the time when the last iteration of the default event loop has started. This is the time that timers |
|
277 | + * (EvTimer and EvPeriodic) are based on, and referring to it is usually faster then calling Ev::time(). |
|
278 | + * |
|
279 | + * @return float Number of seconds(fractional) representing the time when the last iteration of the default event |
|
280 | + * loop has started. |
|
281 | + */ |
|
282 | + final public static function now() {} |
|
283 | + |
|
284 | + /** |
|
285 | + * Establishes the current time by querying the kernel, updating the time returned by Ev::now in the progress. |
|
286 | + * |
|
287 | + * Establishes the current time by querying the kernel, updating the time returned by Ev::now() in the progress. |
|
288 | + * This is a costly operation and is usually done automatically within Ev::run(). |
|
289 | + * |
|
290 | + * This method is rarely useful, but when some event callback runs for a very long time without entering the event |
|
291 | + * loop, updating libev's consideration of the current time is a good idea. |
|
292 | + */ |
|
293 | + final public static function nowUpdate() {} |
|
294 | + |
|
295 | + /** |
|
296 | + * Returns a bit mask of recommended backends for current platform. |
|
297 | + * |
|
298 | + * Returns the set of all backends compiled into this binary of libev and also recommended for this platform, |
|
299 | + * meaning it will work for most file descriptor types. This set is often smaller than the one returned by |
|
300 | + * Ev::supportedBackends(), as for example kqueue is broken on most BSD systems and will not be auto-detected |
|
301 | + * unless it is requested explicitly. This is the set of backends that libev will probe with no backends specified |
|
302 | + * explicitly. |
|
303 | + * |
|
304 | + * @return int Bit mask which can contain Ev::BACKEND_* flags combined using bitwise OR operator. |
|
305 | + */ |
|
306 | + final public static function recommendedBackends() {} |
|
307 | + |
|
308 | + /** |
|
309 | + * Resume previously suspended default event loop. |
|
310 | + * |
|
311 | + * Ev::suspend() and Ev::resume() methods suspend and resume a loop correspondingly. |
|
312 | + * |
|
313 | + * All timer watchers will be delayed by the time spend between suspend and resume , and all periodic watchers will |
|
314 | + * be rescheduled(that is, they will lose any events that would have occurred while suspended). |
|
315 | + * |
|
316 | + * After calling Ev::suspend() it is not allowed to call any function on the given loop other than Ev::resume(). |
|
317 | + * Also it is not allowed to call Ev::resume() without a previous call to Ev::suspend(). |
|
318 | + * |
|
319 | + * Calling suspend / resume has the side effect of updating the event loop time (see Ev::nowUpdate()). |
|
320 | + */ |
|
321 | + final public static function resume() {} |
|
322 | + |
|
323 | + /** |
|
324 | + * Begin checking for events and calling callbacks for the default loop. |
|
325 | + * |
|
326 | + * Begin checking for events and calling callbacks for the default loop . Returns when a callback calls Ev::stop() |
|
327 | + * method, or the flags are nonzero(in which case the return value is true) or when there are no active watchers |
|
328 | + * which reference the loop( EvWatcher::keepalive() is TRUE), in which case the return value will be FALSE. The |
|
329 | + * return value can generally be interpreted as if TRUE, there is more work left to do. |
|
330 | + * |
|
331 | + * @param int $flags One of the Ev::FLAG_* flags |
|
332 | + */ |
|
333 | + final public static function run(int $flags = self::FLAG_AUTO) {} |
|
334 | + |
|
335 | + /** |
|
336 | + * Block the process for the given number of seconds. |
|
337 | + * |
|
338 | + * @param float $seconds Fractional number of seconds |
|
339 | + */ |
|
340 | + final public static function sleep(float $seconds) {} |
|
341 | + |
|
342 | + /** |
|
343 | + * Stops the default event loop |
|
344 | + * |
|
345 | + * @param int $how One of the Ev::BREAK_* constants |
|
346 | + */ |
|
347 | + final public static function stop(int $how = self::BREAK_ONE) {} |
|
348 | + |
|
349 | + /** |
|
350 | + * Returns the set of backends supported by current libev configuration. |
|
351 | + * |
|
352 | + * @return int Bit mask which can contain Ev::BACKEND_* flags combined using bitwise OR operator. |
|
353 | + */ |
|
354 | + final public static function supportedBackends() {} |
|
355 | + |
|
356 | + /** |
|
357 | + * Suspend the default event loop. |
|
358 | + * |
|
359 | + * Ev::suspend() and Ev::resume() methods suspend and resume the default loop correspondingly. |
|
360 | + * |
|
361 | + * All timer watchers will be delayed by the time spend between suspend and resume , and all periodic watchers will |
|
362 | + * be rescheduled(that is, they will lose any events that would have occurred while suspended). |
|
363 | + * |
|
364 | + * After calling Ev::suspend() it is not allowed to call any function on the given loop other than Ev::resume(). |
|
365 | + * Also it is not allowed to call Ev::resume() without a previous call to Ev::suspend(). |
|
366 | + */ |
|
367 | + final public static function suspend() {} |
|
368 | + |
|
369 | + /** |
|
370 | + * Returns the current time in fractional seconds since the epoch. |
|
371 | + * |
|
372 | + * Returns the current time in fractional seconds since the epoch. Consider using Ev::now() |
|
373 | + * |
|
374 | + * @return float The current time in fractional seconds since the epoch. |
|
375 | + */ |
|
376 | + final public static function time() {} |
|
377 | + |
|
378 | + /** |
|
379 | + * Performs internal consistency checks (for debugging). |
|
380 | + * |
|
381 | + * Performs internal consistency checks (for debugging libev) and abort the program if any data structures were |
|
382 | + * found to be corrupted. |
|
383 | + */ |
|
384 | + final public static function verify() {} |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -389,111 +389,111 @@ discard block |
||
389 | 389 | */ |
390 | 390 | abstract class EvWatcher |
391 | 391 | { |
392 | - /** |
|
393 | - * @var bool TRUE if the watcher is active. FALSE otherwise. |
|
394 | - */ |
|
395 | - #[Immutable] |
|
396 | - public $is_active; |
|
397 | - |
|
398 | - /** |
|
399 | - * @var bool TRUE if the watcher is pending, i.e. it has outstanding events, but its callback |
|
400 | - * has not yet been invoked. FALSE otherwise. As long, as a watcher is pending (but not active), one must not |
|
401 | - * change its priority. |
|
402 | - */ |
|
403 | - #[Immutable] |
|
404 | - public $is_pending; |
|
405 | - |
|
406 | - /** |
|
407 | - * Abstract constructor of a watcher object |
|
408 | - */ |
|
409 | - abstract public function __construct(); |
|
410 | - |
|
411 | - /** |
|
412 | - * @var mixed Custom user data associated with the watcher |
|
413 | - */ |
|
414 | - public $data; |
|
415 | - |
|
416 | - /** |
|
417 | - * @var int Number between Ev::MINPRi and Ev::MAXPRI. Pending watchers with higher priority will be invoked before |
|
418 | - * watchers with lower priority, but priority will not keep watchers from being executed (except for EvIdle |
|
419 | - * watchers). EvIdle watchers provide functionality to suppress invocation when higher priority events are |
|
420 | - * pending. |
|
421 | - */ |
|
422 | - public $priority; |
|
423 | - |
|
424 | - /** |
|
425 | - * Clear watcher pending status. |
|
426 | - * |
|
427 | - * If the watcher is pending, this method clears its pending status and returns its revents bitset (as if its |
|
428 | - * callback was invoked). If the watcher isn't pending it does nothing and returns 0. |
|
429 | - * |
|
430 | - * Sometimes it can be useful to "poll" a watcher instead of waiting for its callback to be invoked, which can be |
|
431 | - * accomplished with this function. |
|
432 | - * |
|
433 | - * @return int In case if the watcher is pending, returns revents bitset as if the watcher callback had been |
|
434 | - * invoked. Otherwise returns 0 . |
|
435 | - */ |
|
436 | - public function clear() {} |
|
437 | - |
|
438 | - /** |
|
439 | - * Feeds the given revents set into the event loop. |
|
440 | - * |
|
441 | - * Feeds the given revents set into the event loop, as if the specified event had happened for the watcher. |
|
442 | - * |
|
443 | - * @param int $revents Bit mask of watcher received events. |
|
444 | - */ |
|
445 | - public function feed(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $revents) {} |
|
446 | - |
|
447 | - /** |
|
448 | - * Returns the loop responsible for the watcher. |
|
449 | - * |
|
450 | - * @return EvLoop Event loop object responsible for the watcher. |
|
451 | - */ |
|
452 | - public function getLoop() {} |
|
453 | - |
|
454 | - /** |
|
455 | - * Invokes the watcher callback with the given received events bit mask. |
|
456 | - * |
|
457 | - * @param int $revents Bit mask of watcher received events. |
|
458 | - */ |
|
459 | - public function invoke(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $revents) {} |
|
460 | - |
|
461 | - /** |
|
462 | - * Configures whether to keep the loop from returning. |
|
463 | - * |
|
464 | - * Configures whether to keep the loop from returning. With keepalive value set to FALSE the watcher won't keep |
|
465 | - * Ev::run() / EvLoop::run() from returning even though the watcher is active. |
|
466 | - * |
|
467 | - * Watchers have keepalive value TRUE by default. |
|
468 | - * |
|
469 | - * Clearing keepalive status is useful when returning from Ev::run() / EvLoop::run() just because of the watcher |
|
470 | - * is undesirable. It could be a long running UDP socket watcher or so. |
|
471 | - * |
|
472 | - * @param bool $value With keepalive value set to FALSE the watcher won't keep Ev::run() / EvLoop::run() from |
|
473 | - * returning even though the watcher is active. |
|
474 | - */ |
|
475 | - public function keepalive(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $value = true) {} |
|
476 | - |
|
477 | - /** |
|
478 | - * Sets new callback for the watcher. |
|
479 | - * |
|
480 | - * @param callable $callback void callback ([ object $watcher = NULL [, int $revents = NULL ]] ) |
|
481 | - */ |
|
482 | - public function setCallback(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback) {} |
|
483 | - |
|
484 | - /** |
|
485 | - * Starts the watcher. |
|
486 | - * |
|
487 | - * Marks the watcher as active. Note that only active watchers will receive events. |
|
488 | - */ |
|
489 | - public function start() {} |
|
490 | - |
|
491 | - /** |
|
492 | - * Stops the watcher. |
|
493 | - * |
|
494 | - * Marks the watcher as inactive. Note that only active watchers will receive events. |
|
495 | - */ |
|
496 | - public function stop() {} |
|
392 | + /** |
|
393 | + * @var bool TRUE if the watcher is active. FALSE otherwise. |
|
394 | + */ |
|
395 | + #[Immutable] |
|
396 | + public $is_active; |
|
397 | + |
|
398 | + /** |
|
399 | + * @var bool TRUE if the watcher is pending, i.e. it has outstanding events, but its callback |
|
400 | + * has not yet been invoked. FALSE otherwise. As long, as a watcher is pending (but not active), one must not |
|
401 | + * change its priority. |
|
402 | + */ |
|
403 | + #[Immutable] |
|
404 | + public $is_pending; |
|
405 | + |
|
406 | + /** |
|
407 | + * Abstract constructor of a watcher object |
|
408 | + */ |
|
409 | + abstract public function __construct(); |
|
410 | + |
|
411 | + /** |
|
412 | + * @var mixed Custom user data associated with the watcher |
|
413 | + */ |
|
414 | + public $data; |
|
415 | + |
|
416 | + /** |
|
417 | + * @var int Number between Ev::MINPRi and Ev::MAXPRI. Pending watchers with higher priority will be invoked before |
|
418 | + * watchers with lower priority, but priority will not keep watchers from being executed (except for EvIdle |
|
419 | + * watchers). EvIdle watchers provide functionality to suppress invocation when higher priority events are |
|
420 | + * pending. |
|
421 | + */ |
|
422 | + public $priority; |
|
423 | + |
|
424 | + /** |
|
425 | + * Clear watcher pending status. |
|
426 | + * |
|
427 | + * If the watcher is pending, this method clears its pending status and returns its revents bitset (as if its |
|
428 | + * callback was invoked). If the watcher isn't pending it does nothing and returns 0. |
|
429 | + * |
|
430 | + * Sometimes it can be useful to "poll" a watcher instead of waiting for its callback to be invoked, which can be |
|
431 | + * accomplished with this function. |
|
432 | + * |
|
433 | + * @return int In case if the watcher is pending, returns revents bitset as if the watcher callback had been |
|
434 | + * invoked. Otherwise returns 0 . |
|
435 | + */ |
|
436 | + public function clear() {} |
|
437 | + |
|
438 | + /** |
|
439 | + * Feeds the given revents set into the event loop. |
|
440 | + * |
|
441 | + * Feeds the given revents set into the event loop, as if the specified event had happened for the watcher. |
|
442 | + * |
|
443 | + * @param int $revents Bit mask of watcher received events. |
|
444 | + */ |
|
445 | + public function feed(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $revents) {} |
|
446 | + |
|
447 | + /** |
|
448 | + * Returns the loop responsible for the watcher. |
|
449 | + * |
|
450 | + * @return EvLoop Event loop object responsible for the watcher. |
|
451 | + */ |
|
452 | + public function getLoop() {} |
|
453 | + |
|
454 | + /** |
|
455 | + * Invokes the watcher callback with the given received events bit mask. |
|
456 | + * |
|
457 | + * @param int $revents Bit mask of watcher received events. |
|
458 | + */ |
|
459 | + public function invoke(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $revents) {} |
|
460 | + |
|
461 | + /** |
|
462 | + * Configures whether to keep the loop from returning. |
|
463 | + * |
|
464 | + * Configures whether to keep the loop from returning. With keepalive value set to FALSE the watcher won't keep |
|
465 | + * Ev::run() / EvLoop::run() from returning even though the watcher is active. |
|
466 | + * |
|
467 | + * Watchers have keepalive value TRUE by default. |
|
468 | + * |
|
469 | + * Clearing keepalive status is useful when returning from Ev::run() / EvLoop::run() just because of the watcher |
|
470 | + * is undesirable. It could be a long running UDP socket watcher or so. |
|
471 | + * |
|
472 | + * @param bool $value With keepalive value set to FALSE the watcher won't keep Ev::run() / EvLoop::run() from |
|
473 | + * returning even though the watcher is active. |
|
474 | + */ |
|
475 | + public function keepalive(#[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $value = true) {} |
|
476 | + |
|
477 | + /** |
|
478 | + * Sets new callback for the watcher. |
|
479 | + * |
|
480 | + * @param callable $callback void callback ([ object $watcher = NULL [, int $revents = NULL ]] ) |
|
481 | + */ |
|
482 | + public function setCallback(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback) {} |
|
483 | + |
|
484 | + /** |
|
485 | + * Starts the watcher. |
|
486 | + * |
|
487 | + * Marks the watcher as active. Note that only active watchers will receive events. |
|
488 | + */ |
|
489 | + public function start() {} |
|
490 | + |
|
491 | + /** |
|
492 | + * Stops the watcher. |
|
493 | + * |
|
494 | + * Marks the watcher as inactive. Note that only active watchers will receive events. |
|
495 | + */ |
|
496 | + public function stop() {} |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | /** |
@@ -519,24 +519,24 @@ discard block |
||
519 | 519 | */ |
520 | 520 | final class EvCheck extends EvWatcher |
521 | 521 | { |
522 | - /** |
|
523 | - * @param callable $callback |
|
524 | - * @param mixed $data |
|
525 | - * @param int $priority |
|
526 | - */ |
|
527 | - public function __construct( |
|
528 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
529 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
530 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
531 | - ) {} |
|
532 | - |
|
533 | - /** |
|
534 | - * @param callable $callback |
|
535 | - * @param mixed $data |
|
536 | - * @param int $priority |
|
537 | - * @return EvCheck |
|
538 | - */ |
|
539 | - final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
522 | + /** |
|
523 | + * @param callable $callback |
|
524 | + * @param mixed $data |
|
525 | + * @param int $priority |
|
526 | + */ |
|
527 | + public function __construct( |
|
528 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
529 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
530 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
531 | + ) {} |
|
532 | + |
|
533 | + /** |
|
534 | + * @param callable $callback |
|
535 | + * @param mixed $data |
|
536 | + * @param int $priority |
|
537 | + * @return EvCheck |
|
538 | + */ |
|
539 | + final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
540 | 540 | } |
541 | 541 | |
542 | 542 | /** |
@@ -552,84 +552,84 @@ discard block |
||
552 | 552 | */ |
553 | 553 | final class EvChild extends EvWatcher |
554 | 554 | { |
555 | - /** |
|
556 | - * @var int The process ID this watcher watches out for, or 0, meaning any process ID. |
|
557 | - */ |
|
558 | - #[Immutable] |
|
559 | - public $pid; |
|
560 | - |
|
561 | - /** |
|
562 | - * @var int The process ID that detected a status change. |
|
563 | - */ |
|
564 | - #[Immutable] |
|
565 | - public $rpid; |
|
566 | - |
|
567 | - /** |
|
568 | - * @var int The process exit status caused by rpid. |
|
569 | - */ |
|
570 | - #[Immutable] |
|
571 | - public $rstatus; |
|
572 | - |
|
573 | - /** |
|
574 | - * Constructs the EvChild watcher object. |
|
575 | - * |
|
576 | - * Call the callback when a status change for process ID pid (or any PID if pid is 0) has been received (a status |
|
577 | - * change happens when the process terminates or is killed, or, when trace is TRUE, additionally when it is stopped |
|
578 | - * or continued). In other words, when the process receives a SIGCHLD, Ev will fetch the outstanding exit/wait |
|
579 | - * status for all changed/zombie children and call the callback. |
|
580 | - * |
|
581 | - * It is valid to install a child watcher after an EvChild has exited but before the event loop has started its next |
|
582 | - * iteration. For example, first one calls fork , then the new child process might exit, and only then an EvChild |
|
583 | - * watcher is installed in the parent for the new PID . |
|
584 | - * |
|
585 | - * You can access both exit/tracing status and pid by using the rstatus and rpid properties of the watcher object. |
|
586 | - * |
|
587 | - * The number of PID watchers per PID is unlimited. All of them will be called. |
|
588 | - * |
|
589 | - * The EvChild::createStopped() method doesn't start(activate) the newly created watcher. |
|
590 | - * |
|
591 | - * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). |
|
592 | - * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally |
|
593 | - * activate the watcher when the process is stopped or continued. |
|
594 | - * @param callable $callback |
|
595 | - * @param mixed $data |
|
596 | - * @param int $priority |
|
597 | - */ |
|
598 | - public function __construct( |
|
599 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pid, |
|
600 | - #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $trace, |
|
601 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
602 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
603 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
604 | - ) {} |
|
605 | - |
|
606 | - /** |
|
607 | - * Create instance of a stopped EvCheck watcher. |
|
608 | - * |
|
609 | - * The same as EvChild::__construct() , but doesn't start the watcher automatically. |
|
610 | - * |
|
611 | - * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). |
|
612 | - * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally |
|
613 | - * activate the watcher when the process is stopped or continued. |
|
614 | - * @param callable $callback |
|
615 | - * @param mixed $data |
|
616 | - * @param int $priority |
|
617 | - * |
|
618 | - * @return EvChild |
|
619 | - */ |
|
620 | - final public static function createStopped(int $pid, bool $trace, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
621 | - |
|
622 | - /** |
|
623 | - * Configures the watcher |
|
624 | - * |
|
625 | - * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). |
|
626 | - * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally |
|
627 | - * activate the watcher when the process is stopped or continued. |
|
628 | - */ |
|
629 | - public function set( |
|
630 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pid, |
|
631 | - #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $trace |
|
632 | - ) {} |
|
555 | + /** |
|
556 | + * @var int The process ID this watcher watches out for, or 0, meaning any process ID. |
|
557 | + */ |
|
558 | + #[Immutable] |
|
559 | + public $pid; |
|
560 | + |
|
561 | + /** |
|
562 | + * @var int The process ID that detected a status change. |
|
563 | + */ |
|
564 | + #[Immutable] |
|
565 | + public $rpid; |
|
566 | + |
|
567 | + /** |
|
568 | + * @var int The process exit status caused by rpid. |
|
569 | + */ |
|
570 | + #[Immutable] |
|
571 | + public $rstatus; |
|
572 | + |
|
573 | + /** |
|
574 | + * Constructs the EvChild watcher object. |
|
575 | + * |
|
576 | + * Call the callback when a status change for process ID pid (or any PID if pid is 0) has been received (a status |
|
577 | + * change happens when the process terminates or is killed, or, when trace is TRUE, additionally when it is stopped |
|
578 | + * or continued). In other words, when the process receives a SIGCHLD, Ev will fetch the outstanding exit/wait |
|
579 | + * status for all changed/zombie children and call the callback. |
|
580 | + * |
|
581 | + * It is valid to install a child watcher after an EvChild has exited but before the event loop has started its next |
|
582 | + * iteration. For example, first one calls fork , then the new child process might exit, and only then an EvChild |
|
583 | + * watcher is installed in the parent for the new PID . |
|
584 | + * |
|
585 | + * You can access both exit/tracing status and pid by using the rstatus and rpid properties of the watcher object. |
|
586 | + * |
|
587 | + * The number of PID watchers per PID is unlimited. All of them will be called. |
|
588 | + * |
|
589 | + * The EvChild::createStopped() method doesn't start(activate) the newly created watcher. |
|
590 | + * |
|
591 | + * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). |
|
592 | + * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally |
|
593 | + * activate the watcher when the process is stopped or continued. |
|
594 | + * @param callable $callback |
|
595 | + * @param mixed $data |
|
596 | + * @param int $priority |
|
597 | + */ |
|
598 | + public function __construct( |
|
599 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pid, |
|
600 | + #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $trace, |
|
601 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
602 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
603 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
604 | + ) {} |
|
605 | + |
|
606 | + /** |
|
607 | + * Create instance of a stopped EvCheck watcher. |
|
608 | + * |
|
609 | + * The same as EvChild::__construct() , but doesn't start the watcher automatically. |
|
610 | + * |
|
611 | + * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). |
|
612 | + * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally |
|
613 | + * activate the watcher when the process is stopped or continued. |
|
614 | + * @param callable $callback |
|
615 | + * @param mixed $data |
|
616 | + * @param int $priority |
|
617 | + * |
|
618 | + * @return EvChild |
|
619 | + */ |
|
620 | + final public static function createStopped(int $pid, bool $trace, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
621 | + |
|
622 | + /** |
|
623 | + * Configures the watcher |
|
624 | + * |
|
625 | + * @param int $pid Wait for status changes of process PID(or any process if PID is specified as 0 ). |
|
626 | + * @param bool $trace If FALSE, only activate the watcher when the process terminates. Otherwise(TRUE) additionally |
|
627 | + * activate the watcher when the process is stopped or continued. |
|
628 | + */ |
|
629 | + public function set( |
|
630 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $pid, |
|
631 | + #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $trace |
|
632 | + ) {} |
|
633 | 633 | } |
634 | 634 | |
635 | 635 | /** |
@@ -639,61 +639,61 @@ discard block |
||
639 | 639 | */ |
640 | 640 | final class EvEmbed extends EvWatcher |
641 | 641 | { |
642 | - /** |
|
643 | - * @var EvLoop The embedded loop |
|
644 | - */ |
|
645 | - #[Immutable] |
|
646 | - public $embed; |
|
647 | - |
|
648 | - /** |
|
649 | - * Constructs the EvEmbed object. |
|
650 | - * |
|
651 | - * This is a rather advanced watcher type that lets to embed one event loop into another(currently only IO events |
|
652 | - * are supported in the embedded loop, other types of watchers might be handled in a delayed or incorrect fashion |
|
653 | - * and must not be used). |
|
654 | - * |
|
655 | - * See the libev documentation for details. |
|
656 | - * |
|
657 | - * This watcher is most useful on BSD systems without working kqueue to still be able to handle a large number of |
|
658 | - * sockets. |
|
659 | - * |
|
660 | - * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). |
|
661 | - * @param callable $callback |
|
662 | - * @param mixed $data |
|
663 | - * @param int $priority |
|
664 | - */ |
|
665 | - public function __construct( |
|
666 | - EvLoop $other, |
|
667 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
668 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
669 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
670 | - ) {} |
|
671 | - |
|
672 | - /** |
|
673 | - * Configures the watcher. |
|
674 | - * |
|
675 | - * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). |
|
676 | - */ |
|
677 | - public function set(EvLoop $other) {} |
|
678 | - |
|
679 | - /** |
|
680 | - * Make a single, non-blocking sweep over the embedded loop. |
|
681 | - */ |
|
682 | - public function sweep() {} |
|
683 | - |
|
684 | - /** |
|
685 | - * Create stopped EvEmbed watcher object |
|
686 | - * |
|
687 | - * The same as EvEmbed::__construct() , but doesn't start the watcher automatically. |
|
688 | - * |
|
689 | - * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). |
|
690 | - * @param callable $callback |
|
691 | - * @param mixed $data |
|
692 | - * @param int $priority |
|
693 | - * |
|
694 | - * @return EvEmbed |
|
695 | - */ |
|
696 | - final public static function createStopped(EvLoop $other, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
642 | + /** |
|
643 | + * @var EvLoop The embedded loop |
|
644 | + */ |
|
645 | + #[Immutable] |
|
646 | + public $embed; |
|
647 | + |
|
648 | + /** |
|
649 | + * Constructs the EvEmbed object. |
|
650 | + * |
|
651 | + * This is a rather advanced watcher type that lets to embed one event loop into another(currently only IO events |
|
652 | + * are supported in the embedded loop, other types of watchers might be handled in a delayed or incorrect fashion |
|
653 | + * and must not be used). |
|
654 | + * |
|
655 | + * See the libev documentation for details. |
|
656 | + * |
|
657 | + * This watcher is most useful on BSD systems without working kqueue to still be able to handle a large number of |
|
658 | + * sockets. |
|
659 | + * |
|
660 | + * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). |
|
661 | + * @param callable $callback |
|
662 | + * @param mixed $data |
|
663 | + * @param int $priority |
|
664 | + */ |
|
665 | + public function __construct( |
|
666 | + EvLoop $other, |
|
667 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
668 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
669 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
670 | + ) {} |
|
671 | + |
|
672 | + /** |
|
673 | + * Configures the watcher. |
|
674 | + * |
|
675 | + * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). |
|
676 | + */ |
|
677 | + public function set(EvLoop $other) {} |
|
678 | + |
|
679 | + /** |
|
680 | + * Make a single, non-blocking sweep over the embedded loop. |
|
681 | + */ |
|
682 | + public function sweep() {} |
|
683 | + |
|
684 | + /** |
|
685 | + * Create stopped EvEmbed watcher object |
|
686 | + * |
|
687 | + * The same as EvEmbed::__construct() , but doesn't start the watcher automatically. |
|
688 | + * |
|
689 | + * @param EvLoop $other The loop to embed, this loop must be embeddable(see Ev::embeddableBackends()). |
|
690 | + * @param callable $callback |
|
691 | + * @param mixed $data |
|
692 | + * @param int $priority |
|
693 | + * |
|
694 | + * @return EvEmbed |
|
695 | + */ |
|
696 | + final public static function createStopped(EvLoop $other, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
697 | 697 | } |
698 | 698 | |
699 | 699 | /** |
@@ -720,63 +720,63 @@ discard block |
||
720 | 720 | */ |
721 | 721 | final class EvIo extends EvWatcher |
722 | 722 | { |
723 | - /** |
|
724 | - * @var resource A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
725 | - */ |
|
726 | - #[Immutable] |
|
727 | - public $fd; |
|
728 | - |
|
729 | - /** |
|
730 | - * @var int Ev::READ and/or Ev::WRITE. See the bit masks. |
|
731 | - */ |
|
732 | - #[Immutable] |
|
733 | - #[ExpectedValues(flags: [Ev::READ, Ev::WRITE])] |
|
734 | - public $events; |
|
735 | - |
|
736 | - /** |
|
737 | - * Constructs EvIo watcher object. |
|
738 | - * |
|
739 | - * Constructs EvIo watcher object and starts the watcher automatically. |
|
740 | - * |
|
741 | - * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
742 | - * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. |
|
743 | - * @param callable $callback |
|
744 | - * @param mixed $data |
|
745 | - * @param int $priority |
|
746 | - */ |
|
747 | - public function __construct( |
|
748 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd, |
|
749 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events, |
|
750 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
751 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
752 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
753 | - ) {} |
|
754 | - |
|
755 | - /** |
|
756 | - * Configures the watcher. |
|
757 | - * |
|
758 | - * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
759 | - * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. |
|
760 | - */ |
|
761 | - public function set( |
|
762 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd, |
|
763 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events |
|
764 | - ) {} |
|
765 | - |
|
766 | - /** |
|
767 | - * Create stopped EvIo watcher object. |
|
768 | - * |
|
769 | - * The same as EvIo::__construct() , but doesn't start the watcher automatically. |
|
770 | - * |
|
771 | - * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
772 | - * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. |
|
773 | - * @param callable $callback |
|
774 | - * @param mixed $data |
|
775 | - * @param int $priority |
|
776 | - * |
|
777 | - * @return EvIo |
|
778 | - */ |
|
779 | - final public static function createStopped(mixed $fd, int $events, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
723 | + /** |
|
724 | + * @var resource A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
725 | + */ |
|
726 | + #[Immutable] |
|
727 | + public $fd; |
|
728 | + |
|
729 | + /** |
|
730 | + * @var int Ev::READ and/or Ev::WRITE. See the bit masks. |
|
731 | + */ |
|
732 | + #[Immutable] |
|
733 | + #[ExpectedValues(flags: [Ev::READ, Ev::WRITE])] |
|
734 | + public $events; |
|
735 | + |
|
736 | + /** |
|
737 | + * Constructs EvIo watcher object. |
|
738 | + * |
|
739 | + * Constructs EvIo watcher object and starts the watcher automatically. |
|
740 | + * |
|
741 | + * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
742 | + * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. |
|
743 | + * @param callable $callback |
|
744 | + * @param mixed $data |
|
745 | + * @param int $priority |
|
746 | + */ |
|
747 | + public function __construct( |
|
748 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd, |
|
749 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events, |
|
750 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
751 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
752 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
753 | + ) {} |
|
754 | + |
|
755 | + /** |
|
756 | + * Configures the watcher. |
|
757 | + * |
|
758 | + * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
759 | + * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. |
|
760 | + */ |
|
761 | + public function set( |
|
762 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $fd, |
|
763 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $events |
|
764 | + ) {} |
|
765 | + |
|
766 | + /** |
|
767 | + * Create stopped EvIo watcher object. |
|
768 | + * |
|
769 | + * The same as EvIo::__construct() , but doesn't start the watcher automatically. |
|
770 | + * |
|
771 | + * @param resource $fd A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
|
772 | + * @param int $events Ev::READ and/or Ev::WRITE. See the bit masks. |
|
773 | + * @param callable $callback |
|
774 | + * @param mixed $data |
|
775 | + * @param int $priority |
|
776 | + * |
|
777 | + * @return EvIo |
|
778 | + */ |
|
779 | + final public static function createStopped(mixed $fd, int $events, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
780 | 780 | } |
781 | 781 | |
782 | 782 | /** |
@@ -800,99 +800,99 @@ discard block |
||
800 | 800 | */ |
801 | 801 | final class EvPeriodic extends EvWatcher |
802 | 802 | { |
803 | - /** |
|
804 | - * @var float When repeating, this contains the offset value, otherwise this is the absolute point in time (the |
|
805 | - * offset value passed to EvPeriodic::set(), although libev might modify this value for better numerical |
|
806 | - * stability). |
|
807 | - */ |
|
808 | - public $offset; |
|
809 | - |
|
810 | - /** |
|
811 | - * @var float The current interval value. Can be modified any time, but changes only take effect when the periodic |
|
812 | - * timer fires or EvPeriodic::again() is being called. |
|
813 | - */ |
|
814 | - public $interval; |
|
815 | - |
|
816 | - /** |
|
817 | - * Constructs EvPeriodic watcher object. |
|
818 | - * |
|
819 | - * Constructs EvPeriodic watcher object and starts it automatically. EvPeriodic::createStopped() method creates |
|
820 | - * stopped periodic watcher. |
|
821 | - * |
|
822 | - * @param float $offset When repeating, this contains the offset value, otherwise this is the absolute point in |
|
823 | - * time (the offset value passed to EvPeriodic::set(), although libev might modify this value for better |
|
824 | - * numerical stability). |
|
825 | - * @param float $interval The current interval value. Can be modified any time, but changes only take effect when |
|
826 | - * the periodic timer fires or EvPeriodic::again() is being called. |
|
827 | - * @param null|callable $reschedule_cb If set, tt must return the next time to trigger, based on the passed time value |
|
828 | - * (that is, the lowest time value larger than or equal to the second argument). It will usually be called just |
|
829 | - * before the callback will be triggered, but might be called at other times, too. |
|
830 | - * @param callable $callback |
|
831 | - * @param mixed $data |
|
832 | - * @param int $priority |
|
833 | - */ |
|
834 | - public function __construct( |
|
835 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset, |
|
836 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, |
|
837 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb, |
|
838 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
839 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
840 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
841 | - ) {} |
|
842 | - |
|
843 | - /** |
|
844 | - * Simply stops and restarts the periodic watcher again. |
|
845 | - * |
|
846 | - * Simply stops and restarts the periodic watcher again. This is only useful when attributes are changed. |
|
847 | - * |
|
848 | - * @return void |
|
849 | - */ |
|
850 | - public function again() {} |
|
851 | - |
|
852 | - /** |
|
853 | - * Returns the absolute time that this watcher is supposed to trigger next. |
|
854 | - * |
|
855 | - * When the watcher is active, returns the absolute time that this watcher is supposed to trigger next. This is not |
|
856 | - * the same as the offset argument to EvPeriodic::set() or EvPeriodic::__construct(), but indeed works even in |
|
857 | - * interval mode. |
|
858 | - * |
|
859 | - * @return float Rhe absolute time this watcher is supposed to trigger next in seconds. |
|
860 | - */ |
|
861 | - public function at() {} |
|
862 | - |
|
863 | - /** |
|
864 | - * Create a stopped EvPeriodic watcher |
|
865 | - * |
|
866 | - * Create EvPeriodic object. Unlike EvPeriodic::__construct() this method doesn't start the watcher automatically. |
|
867 | - * |
|
868 | - * @param float $offset When repeating, this contains the offset value, otherwise this is the absolute point in |
|
869 | - * time (the offset value passed to EvPeriodic::set(), although libev might modify this value for better |
|
870 | - * numerical stability). |
|
871 | - * @param float $interval The current interval value. Can be modified any time, but changes only take effect when |
|
872 | - * the periodic timer fires or EvPeriodic::again() is being called. |
|
873 | - * @param null|callable $reschedule_cb If set, tt must return the next time to trigger, based on the passed time value |
|
874 | - * (that is, the lowest time value larger than or equal to the second argument). It will usually be called just |
|
875 | - * before the callback will be triggered, but might be called at other times, too. |
|
876 | - * @param callable $callback |
|
877 | - * @param mixed $data |
|
878 | - * @param int $priority |
|
879 | - * |
|
880 | - * @return EvPeriodic |
|
881 | - */ |
|
882 | - final public static function createStopped(float $offset, float $interval, mixed $reschedule_cb, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
883 | - |
|
884 | - /** |
|
885 | - * Configures the watcher |
|
886 | - * @param float $offset The same meaning as for {@see EvPeriodic::__construct} |
|
887 | - * @param float $interval The same meaning as for {@see EvPeriodic::__construct} |
|
888 | - * @param null|callable $reschedule_cb The same meaning as for {@see EvPeriodic::__construct} |
|
889 | - * @return void |
|
890 | - */ |
|
891 | - public function set( |
|
892 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset, |
|
893 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, |
|
894 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb = null |
|
895 | - ) {} |
|
803 | + /** |
|
804 | + * @var float When repeating, this contains the offset value, otherwise this is the absolute point in time (the |
|
805 | + * offset value passed to EvPeriodic::set(), although libev might modify this value for better numerical |
|
806 | + * stability). |
|
807 | + */ |
|
808 | + public $offset; |
|
809 | + |
|
810 | + /** |
|
811 | + * @var float The current interval value. Can be modified any time, but changes only take effect when the periodic |
|
812 | + * timer fires or EvPeriodic::again() is being called. |
|
813 | + */ |
|
814 | + public $interval; |
|
815 | + |
|
816 | + /** |
|
817 | + * Constructs EvPeriodic watcher object. |
|
818 | + * |
|
819 | + * Constructs EvPeriodic watcher object and starts it automatically. EvPeriodic::createStopped() method creates |
|
820 | + * stopped periodic watcher. |
|
821 | + * |
|
822 | + * @param float $offset When repeating, this contains the offset value, otherwise this is the absolute point in |
|
823 | + * time (the offset value passed to EvPeriodic::set(), although libev might modify this value for better |
|
824 | + * numerical stability). |
|
825 | + * @param float $interval The current interval value. Can be modified any time, but changes only take effect when |
|
826 | + * the periodic timer fires or EvPeriodic::again() is being called. |
|
827 | + * @param null|callable $reschedule_cb If set, tt must return the next time to trigger, based on the passed time value |
|
828 | + * (that is, the lowest time value larger than or equal to the second argument). It will usually be called just |
|
829 | + * before the callback will be triggered, but might be called at other times, too. |
|
830 | + * @param callable $callback |
|
831 | + * @param mixed $data |
|
832 | + * @param int $priority |
|
833 | + */ |
|
834 | + public function __construct( |
|
835 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset, |
|
836 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, |
|
837 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb, |
|
838 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
839 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
840 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
841 | + ) {} |
|
842 | + |
|
843 | + /** |
|
844 | + * Simply stops and restarts the periodic watcher again. |
|
845 | + * |
|
846 | + * Simply stops and restarts the periodic watcher again. This is only useful when attributes are changed. |
|
847 | + * |
|
848 | + * @return void |
|
849 | + */ |
|
850 | + public function again() {} |
|
851 | + |
|
852 | + /** |
|
853 | + * Returns the absolute time that this watcher is supposed to trigger next. |
|
854 | + * |
|
855 | + * When the watcher is active, returns the absolute time that this watcher is supposed to trigger next. This is not |
|
856 | + * the same as the offset argument to EvPeriodic::set() or EvPeriodic::__construct(), but indeed works even in |
|
857 | + * interval mode. |
|
858 | + * |
|
859 | + * @return float Rhe absolute time this watcher is supposed to trigger next in seconds. |
|
860 | + */ |
|
861 | + public function at() {} |
|
862 | + |
|
863 | + /** |
|
864 | + * Create a stopped EvPeriodic watcher |
|
865 | + * |
|
866 | + * Create EvPeriodic object. Unlike EvPeriodic::__construct() this method doesn't start the watcher automatically. |
|
867 | + * |
|
868 | + * @param float $offset When repeating, this contains the offset value, otherwise this is the absolute point in |
|
869 | + * time (the offset value passed to EvPeriodic::set(), although libev might modify this value for better |
|
870 | + * numerical stability). |
|
871 | + * @param float $interval The current interval value. Can be modified any time, but changes only take effect when |
|
872 | + * the periodic timer fires or EvPeriodic::again() is being called. |
|
873 | + * @param null|callable $reschedule_cb If set, tt must return the next time to trigger, based on the passed time value |
|
874 | + * (that is, the lowest time value larger than or equal to the second argument). It will usually be called just |
|
875 | + * before the callback will be triggered, but might be called at other times, too. |
|
876 | + * @param callable $callback |
|
877 | + * @param mixed $data |
|
878 | + * @param int $priority |
|
879 | + * |
|
880 | + * @return EvPeriodic |
|
881 | + */ |
|
882 | + final public static function createStopped(float $offset, float $interval, mixed $reschedule_cb, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
883 | + |
|
884 | + /** |
|
885 | + * Configures the watcher |
|
886 | + * @param float $offset The same meaning as for {@see EvPeriodic::__construct} |
|
887 | + * @param float $interval The same meaning as for {@see EvPeriodic::__construct} |
|
888 | + * @param null|callable $reschedule_cb The same meaning as for {@see EvPeriodic::__construct} |
|
889 | + * @return void |
|
890 | + */ |
|
891 | + public function set( |
|
892 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $offset, |
|
893 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, |
|
894 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $reschedule_cb = null |
|
895 | + ) {} |
|
896 | 896 | } |
897 | 897 | |
898 | 898 | /** |
@@ -918,35 +918,35 @@ discard block |
||
918 | 918 | */ |
919 | 919 | final class EvPrepare extends EvWatcher |
920 | 920 | { |
921 | - /** |
|
922 | - * Constructs EvPrepare watcher object. |
|
923 | - * |
|
924 | - * Constructs EvPrepare watcher object and starts the watcher automatically. If you need a stopped watcher, consider |
|
925 | - * using EvPrepare::createStopped(). |
|
926 | - * |
|
927 | - * @param callable $callback |
|
928 | - * @param mixed $data |
|
929 | - * @param int $priority |
|
930 | - */ |
|
931 | - public function __construct( |
|
932 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
933 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
934 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
935 | - ) {} |
|
936 | - |
|
937 | - /** |
|
938 | - * Creates a stopped instance of EvPrepare watcher. |
|
939 | - * |
|
940 | - * Creates a stopped instance of EvPrepare watcher. Unlike EvPrepare::__construct(), this method doesn't start the |
|
941 | - * watcher automatically. |
|
942 | - * |
|
943 | - * @param callable $callback |
|
944 | - * @param mixed $data |
|
945 | - * @param int $priority |
|
946 | - * |
|
947 | - * @return EvPrepare |
|
948 | - */ |
|
949 | - final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
921 | + /** |
|
922 | + * Constructs EvPrepare watcher object. |
|
923 | + * |
|
924 | + * Constructs EvPrepare watcher object and starts the watcher automatically. If you need a stopped watcher, consider |
|
925 | + * using EvPrepare::createStopped(). |
|
926 | + * |
|
927 | + * @param callable $callback |
|
928 | + * @param mixed $data |
|
929 | + * @param int $priority |
|
930 | + */ |
|
931 | + public function __construct( |
|
932 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
933 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
934 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
935 | + ) {} |
|
936 | + |
|
937 | + /** |
|
938 | + * Creates a stopped instance of EvPrepare watcher. |
|
939 | + * |
|
940 | + * Creates a stopped instance of EvPrepare watcher. Unlike EvPrepare::__construct(), this method doesn't start the |
|
941 | + * watcher automatically. |
|
942 | + * |
|
943 | + * @param callable $callback |
|
944 | + * @param mixed $data |
|
945 | + * @param int $priority |
|
946 | + * |
|
947 | + * @return EvPrepare |
|
948 | + */ |
|
949 | + final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
950 | 950 | } |
951 | 951 | |
952 | 952 | /** |
@@ -966,48 +966,48 @@ discard block |
||
966 | 966 | */ |
967 | 967 | final class EvSignal extends EvWatcher |
968 | 968 | { |
969 | - /** |
|
970 | - * @var int Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
971 | - */ |
|
972 | - #[Immutable] |
|
973 | - public $signum; |
|
974 | - |
|
975 | - /** |
|
976 | - * Constructs EvSignal watcher object |
|
977 | - * |
|
978 | - * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
979 | - * @param callable $callback |
|
980 | - * @param mixed $data |
|
981 | - * @param int $priority |
|
982 | - */ |
|
983 | - public function __construct( |
|
984 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $signum, |
|
985 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
986 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
987 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
988 | - ) {} |
|
989 | - |
|
990 | - /** |
|
991 | - * Configures the watcher. |
|
992 | - * |
|
993 | - * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
994 | - */ |
|
995 | - public function set(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $signum) {} |
|
996 | - |
|
997 | - /** |
|
998 | - * Creates a stopped instance of EvSignal watcher. |
|
999 | - * |
|
1000 | - * Creates a stopped instance of EvSignal watcher. Unlike EvPrepare::__construct(), this method doesn't start the |
|
1001 | - * watcher automatically. |
|
1002 | - * |
|
1003 | - * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
1004 | - * @param callable $callback |
|
1005 | - * @param mixed $data |
|
1006 | - * @param int $priority |
|
1007 | - * |
|
1008 | - * @return EvSignal |
|
1009 | - */ |
|
1010 | - final public static function createStopped(int $signum, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
969 | + /** |
|
970 | + * @var int Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
971 | + */ |
|
972 | + #[Immutable] |
|
973 | + public $signum; |
|
974 | + |
|
975 | + /** |
|
976 | + * Constructs EvSignal watcher object |
|
977 | + * |
|
978 | + * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
979 | + * @param callable $callback |
|
980 | + * @param mixed $data |
|
981 | + * @param int $priority |
|
982 | + */ |
|
983 | + public function __construct( |
|
984 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $signum, |
|
985 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
986 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
987 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
988 | + ) {} |
|
989 | + |
|
990 | + /** |
|
991 | + * Configures the watcher. |
|
992 | + * |
|
993 | + * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
994 | + */ |
|
995 | + public function set(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $signum) {} |
|
996 | + |
|
997 | + /** |
|
998 | + * Creates a stopped instance of EvSignal watcher. |
|
999 | + * |
|
1000 | + * Creates a stopped instance of EvSignal watcher. Unlike EvPrepare::__construct(), this method doesn't start the |
|
1001 | + * watcher automatically. |
|
1002 | + * |
|
1003 | + * @param int $signum Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
|
1004 | + * @param callable $callback |
|
1005 | + * @param mixed $data |
|
1006 | + * @param int $priority |
|
1007 | + * |
|
1008 | + * @return EvSignal |
|
1009 | + */ |
|
1010 | + final public static function createStopped(int $signum, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1011 | 1011 | } |
1012 | 1012 | |
1013 | 1013 | /** |
@@ -1034,86 +1034,86 @@ discard block |
||
1034 | 1034 | */ |
1035 | 1035 | final class EvStat extends EvWatcher |
1036 | 1036 | { |
1037 | - /** |
|
1038 | - * @var float Hint on how quickly a change is expected to be detected and should normally be |
|
1039 | - * specified as 0.0 to let libev choose a suitable value. |
|
1040 | - */ |
|
1041 | - #[Immutable] |
|
1042 | - public $interval; |
|
1043 | - |
|
1044 | - /** |
|
1045 | - * @var string The path to wait for status changes on. |
|
1046 | - */ |
|
1047 | - #[Immutable] |
|
1048 | - public $path; |
|
1049 | - |
|
1050 | - /** |
|
1051 | - * Constructs EvStat watcher object. |
|
1052 | - * |
|
1053 | - * Constructs EvStat watcher object and starts the watcher automatically. |
|
1054 | - * |
|
1055 | - * @param string $path The path to wait for status changes on. |
|
1056 | - * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified |
|
1057 | - * as 0.0 to let libev choose a suitable value. |
|
1058 | - * @param callable $callback |
|
1059 | - * @param mixed $data |
|
1060 | - * @param int $priority |
|
1061 | - */ |
|
1062 | - public function __construct( |
|
1063 | - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, |
|
1064 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, |
|
1065 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
1066 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
1067 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
1068 | - ) {} |
|
1069 | - |
|
1070 | - /** |
|
1071 | - * @return array The values most recently detect by Ev (without actual stat'ing). See stat(2) man page for details. |
|
1072 | - */ |
|
1073 | - public function attr() {} |
|
1074 | - |
|
1075 | - /** |
|
1076 | - * @return array Just like EvStat::attr() , but returns the previous set of values. |
|
1077 | - */ |
|
1078 | - public function prev() {} |
|
1079 | - |
|
1080 | - /** |
|
1081 | - * Configures the watcher. |
|
1082 | - * |
|
1083 | - * @param string $path The path to wait for status changes on. |
|
1084 | - * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified |
|
1085 | - * as 0.0 to let libev choose a suitable value. |
|
1086 | - */ |
|
1087 | - public function set( |
|
1088 | - #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, |
|
1089 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval |
|
1090 | - ) {} |
|
1091 | - |
|
1092 | - /** |
|
1093 | - * Initiates the stat call. |
|
1094 | - * |
|
1095 | - * Initiates the stat call(updates internal cache). It stats (using lstat) the path specified in the watcher and |
|
1096 | - * sets the internal cache to the values found. |
|
1097 | - * |
|
1098 | - * @return bool TRUE if path exists. Otherwise FALSE. |
|
1099 | - */ |
|
1100 | - public function stat() {} |
|
1101 | - |
|
1102 | - /** |
|
1103 | - * Create a stopped EvStat watcher object. |
|
1104 | - * |
|
1105 | - * Creates EvStat watcher object, but doesn't start it automatically (unlike EvStat::__construct()). |
|
1106 | - * |
|
1107 | - * @param string $path The path to wait for status changes on. |
|
1108 | - * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified |
|
1109 | - * as 0.0 to let libev choose a suitable value. |
|
1110 | - * @param callable $callback |
|
1111 | - * @param mixed $data |
|
1112 | - * @param int $priority |
|
1113 | - * |
|
1114 | - * @return EvStat |
|
1115 | - */ |
|
1116 | - final public static function createStopped(string $path, float $interval, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1037 | + /** |
|
1038 | + * @var float Hint on how quickly a change is expected to be detected and should normally be |
|
1039 | + * specified as 0.0 to let libev choose a suitable value. |
|
1040 | + */ |
|
1041 | + #[Immutable] |
|
1042 | + public $interval; |
|
1043 | + |
|
1044 | + /** |
|
1045 | + * @var string The path to wait for status changes on. |
|
1046 | + */ |
|
1047 | + #[Immutable] |
|
1048 | + public $path; |
|
1049 | + |
|
1050 | + /** |
|
1051 | + * Constructs EvStat watcher object. |
|
1052 | + * |
|
1053 | + * Constructs EvStat watcher object and starts the watcher automatically. |
|
1054 | + * |
|
1055 | + * @param string $path The path to wait for status changes on. |
|
1056 | + * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified |
|
1057 | + * as 0.0 to let libev choose a suitable value. |
|
1058 | + * @param callable $callback |
|
1059 | + * @param mixed $data |
|
1060 | + * @param int $priority |
|
1061 | + */ |
|
1062 | + public function __construct( |
|
1063 | + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, |
|
1064 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval, |
|
1065 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
1066 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
1067 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
1068 | + ) {} |
|
1069 | + |
|
1070 | + /** |
|
1071 | + * @return array The values most recently detect by Ev (without actual stat'ing). See stat(2) man page for details. |
|
1072 | + */ |
|
1073 | + public function attr() {} |
|
1074 | + |
|
1075 | + /** |
|
1076 | + * @return array Just like EvStat::attr() , but returns the previous set of values. |
|
1077 | + */ |
|
1078 | + public function prev() {} |
|
1079 | + |
|
1080 | + /** |
|
1081 | + * Configures the watcher. |
|
1082 | + * |
|
1083 | + * @param string $path The path to wait for status changes on. |
|
1084 | + * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified |
|
1085 | + * as 0.0 to let libev choose a suitable value. |
|
1086 | + */ |
|
1087 | + public function set( |
|
1088 | + #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $path, |
|
1089 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $interval |
|
1090 | + ) {} |
|
1091 | + |
|
1092 | + /** |
|
1093 | + * Initiates the stat call. |
|
1094 | + * |
|
1095 | + * Initiates the stat call(updates internal cache). It stats (using lstat) the path specified in the watcher and |
|
1096 | + * sets the internal cache to the values found. |
|
1097 | + * |
|
1098 | + * @return bool TRUE if path exists. Otherwise FALSE. |
|
1099 | + */ |
|
1100 | + public function stat() {} |
|
1101 | + |
|
1102 | + /** |
|
1103 | + * Create a stopped EvStat watcher object. |
|
1104 | + * |
|
1105 | + * Creates EvStat watcher object, but doesn't start it automatically (unlike EvStat::__construct()). |
|
1106 | + * |
|
1107 | + * @param string $path The path to wait for status changes on. |
|
1108 | + * @param float $interval Hint on how quickly a change is expected to be detected and should normally be specified |
|
1109 | + * as 0.0 to let libev choose a suitable value. |
|
1110 | + * @param callable $callback |
|
1111 | + * @param mixed $data |
|
1112 | + * @param int $priority |
|
1113 | + * |
|
1114 | + * @return EvStat |
|
1115 | + */ |
|
1116 | + final public static function createStopped(string $path, float $interval, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1117 | 1117 | } |
1118 | 1118 | |
1119 | 1119 | /** |
@@ -1138,82 +1138,82 @@ discard block |
||
1138 | 1138 | */ |
1139 | 1139 | final class EvTimer extends EvWatcher |
1140 | 1140 | { |
1141 | - /** |
|
1142 | - * @var float If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it is |
|
1143 | - * positive, then the timer will automatically be configured to trigger again every repeat seconds later, until |
|
1144 | - * stopped manually. |
|
1145 | - */ |
|
1146 | - public $repeat; |
|
1147 | - |
|
1148 | - /** |
|
1149 | - * @var float The remaining time until a timer fires. If the timer is active, then this time is relative to the |
|
1150 | - * current event loop time, otherwise it's the timeout value currently configured. |
|
1151 | - * |
|
1152 | - * That is, after instantiating an EvTimer with an after value of 5.0 and repeat value of 7.0, remaining |
|
1153 | - * returns 5.0. When the timer is started and one second passes, remaining will return 4.0 . When the timer |
|
1154 | - * expires and is restarted, it will return roughly 7.0 (likely slightly less as callback invocation takes some |
|
1155 | - * time too), and so on. |
|
1156 | - */ |
|
1157 | - public $remaining; |
|
1158 | - |
|
1159 | - /** |
|
1160 | - * Constructs an EvTimer watcher object. |
|
1161 | - * |
|
1162 | - * @param float $after Configures the timer to trigger after $after seconds. |
|
1163 | - * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it |
|
1164 | - * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, |
|
1165 | - * until stopped manually. |
|
1166 | - * @param callable $callback |
|
1167 | - * @param mixed $data |
|
1168 | - * @param int $priority |
|
1169 | - */ |
|
1170 | - public function __construct( |
|
1171 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $after, |
|
1172 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $repeat, |
|
1173 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
1174 | - #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
1175 | - #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
1176 | - ) {} |
|
1177 | - |
|
1178 | - /** |
|
1179 | - * Restarts the timer watcher. |
|
1180 | - * |
|
1181 | - * This will act as if the timer timed out and restart it again if it is repeating. The exact semantics are: |
|
1182 | - * |
|
1183 | - * - if the timer is pending, its pending status is cleared. |
|
1184 | - * - if the timer is started but non-repeating, stop it (as if it timed out). |
|
1185 | - * - if the timer is repeating, either start it if necessary (with the repeat value), or reset the running timer to |
|
1186 | - * the repeat value. |
|
1187 | - */ |
|
1188 | - public function again() {} |
|
1189 | - |
|
1190 | - /** |
|
1191 | - * Configures the watcher. |
|
1192 | - * |
|
1193 | - * @param float $after Configures the timer to trigger after $after seconds. |
|
1194 | - * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it |
|
1195 | - * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, |
|
1196 | - * until stopped manually. |
|
1197 | - */ |
|
1198 | - public function set( |
|
1199 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $after, |
|
1200 | - #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $repeat |
|
1201 | - ) {} |
|
1202 | - |
|
1203 | - /** |
|
1204 | - * Creates a stopped EvTimer watcher object. |
|
1205 | - * |
|
1206 | - * @param float $after Configures the timer to trigger after $after seconds. |
|
1207 | - * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it |
|
1208 | - * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, |
|
1209 | - * until stopped manually. |
|
1210 | - * @param callable $callback |
|
1211 | - * @param mixed $data |
|
1212 | - * @param int $priority |
|
1213 | - * |
|
1214 | - * @return EvTimer |
|
1215 | - */ |
|
1216 | - final public static function createStopped(float $after, float $repeat, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1141 | + /** |
|
1142 | + * @var float If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it is |
|
1143 | + * positive, then the timer will automatically be configured to trigger again every repeat seconds later, until |
|
1144 | + * stopped manually. |
|
1145 | + */ |
|
1146 | + public $repeat; |
|
1147 | + |
|
1148 | + /** |
|
1149 | + * @var float The remaining time until a timer fires. If the timer is active, then this time is relative to the |
|
1150 | + * current event loop time, otherwise it's the timeout value currently configured. |
|
1151 | + * |
|
1152 | + * That is, after instantiating an EvTimer with an after value of 5.0 and repeat value of 7.0, remaining |
|
1153 | + * returns 5.0. When the timer is started and one second passes, remaining will return 4.0 . When the timer |
|
1154 | + * expires and is restarted, it will return roughly 7.0 (likely slightly less as callback invocation takes some |
|
1155 | + * time too), and so on. |
|
1156 | + */ |
|
1157 | + public $remaining; |
|
1158 | + |
|
1159 | + /** |
|
1160 | + * Constructs an EvTimer watcher object. |
|
1161 | + * |
|
1162 | + * @param float $after Configures the timer to trigger after $after seconds. |
|
1163 | + * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it |
|
1164 | + * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, |
|
1165 | + * until stopped manually. |
|
1166 | + * @param callable $callback |
|
1167 | + * @param mixed $data |
|
1168 | + * @param int $priority |
|
1169 | + */ |
|
1170 | + public function __construct( |
|
1171 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $after, |
|
1172 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $repeat, |
|
1173 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $callback, |
|
1174 | + #[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $data = null, |
|
1175 | + #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $priority = 0 |
|
1176 | + ) {} |
|
1177 | + |
|
1178 | + /** |
|
1179 | + * Restarts the timer watcher. |
|
1180 | + * |
|
1181 | + * This will act as if the timer timed out and restart it again if it is repeating. The exact semantics are: |
|
1182 | + * |
|
1183 | + * - if the timer is pending, its pending status is cleared. |
|
1184 | + * - if the timer is started but non-repeating, stop it (as if it timed out). |
|
1185 | + * - if the timer is repeating, either start it if necessary (with the repeat value), or reset the running timer to |
|
1186 | + * the repeat value. |
|
1187 | + */ |
|
1188 | + public function again() {} |
|
1189 | + |
|
1190 | + /** |
|
1191 | + * Configures the watcher. |
|
1192 | + * |
|
1193 | + * @param float $after Configures the timer to trigger after $after seconds. |
|
1194 | + * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it |
|
1195 | + * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, |
|
1196 | + * until stopped manually. |
|
1197 | + */ |
|
1198 | + public function set( |
|
1199 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $after, |
|
1200 | + #[LanguageLevelTypeAware(['8.0' => 'float'], default: '')] $repeat |
|
1201 | + ) {} |
|
1202 | + |
|
1203 | + /** |
|
1204 | + * Creates a stopped EvTimer watcher object. |
|
1205 | + * |
|
1206 | + * @param float $after Configures the timer to trigger after $after seconds. |
|
1207 | + * @param float $repeat If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it |
|
1208 | + * is positive, then the timer will automatically be configured to trigger again every repeat seconds later, |
|
1209 | + * until stopped manually. |
|
1210 | + * @param callable $callback |
|
1211 | + * @param mixed $data |
|
1212 | + * @param int $priority |
|
1213 | + * |
|
1214 | + * @return EvTimer |
|
1215 | + */ |
|
1216 | + final public static function createStopped(float $after, float $repeat, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | /** |
@@ -1236,25 +1236,25 @@ discard block |
||
1236 | 1236 | */ |
1237 | 1237 | final class EvIdle extends EvWatcher |
1238 | 1238 | { |
1239 | - /** |
|
1240 | - * Constructs an EvIdle instance. |
|
1241 | - * |
|
1242 | - * @param callable $callback |
|
1243 | - * @param mixed $data |
|
1244 | - * @param int $priority |
|
1245 | - */ |
|
1246 | - public function __construct(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1247 | - |
|
1248 | - /** |
|
1249 | - * Creates a stopped EvIdle instance. |
|
1250 | - * |
|
1251 | - * @param callable $callback |
|
1252 | - * @param mixed $data |
|
1253 | - * @param int $priority |
|
1254 | - * |
|
1255 | - * @return EvIdle |
|
1256 | - */ |
|
1257 | - final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1239 | + /** |
|
1240 | + * Constructs an EvIdle instance. |
|
1241 | + * |
|
1242 | + * @param callable $callback |
|
1243 | + * @param mixed $data |
|
1244 | + * @param int $priority |
|
1245 | + */ |
|
1246 | + public function __construct(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1247 | + |
|
1248 | + /** |
|
1249 | + * Creates a stopped EvIdle instance. |
|
1250 | + * |
|
1251 | + * @param callable $callback |
|
1252 | + * @param mixed $data |
|
1253 | + * @param int $priority |
|
1254 | + * |
|
1255 | + * @return EvIdle |
|
1256 | + */ |
|
1257 | + final public static function createStopped(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | /** |
@@ -1267,25 +1267,25 @@ discard block |
||
1267 | 1267 | */ |
1268 | 1268 | final class EvFork extends EvWatcher |
1269 | 1269 | { |
1270 | - /** |
|
1271 | - * Constructs an EvFork instance. |
|
1272 | - * |
|
1273 | - * @param callable $callback |
|
1274 | - * @param mixed $data |
|
1275 | - * @param int $priority |
|
1276 | - */ |
|
1277 | - public function __construct(EvLoop $loop, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1278 | - |
|
1279 | - /** |
|
1280 | - * Creates a stopped EvFork instance. |
|
1281 | - * |
|
1282 | - * @param callable $callback |
|
1283 | - * @param mixed $data |
|
1284 | - * @param int $priority |
|
1285 | - * |
|
1286 | - * @return EvFork |
|
1287 | - */ |
|
1288 | - final public static function createStopped(EvLoop $loop, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1270 | + /** |
|
1271 | + * Constructs an EvFork instance. |
|
1272 | + * |
|
1273 | + * @param callable $callback |
|
1274 | + * @param mixed $data |
|
1275 | + * @param int $priority |
|
1276 | + */ |
|
1277 | + public function __construct(EvLoop $loop, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1278 | + |
|
1279 | + /** |
|
1280 | + * Creates a stopped EvFork instance. |
|
1281 | + * |
|
1282 | + * @param callable $callback |
|
1283 | + * @param mixed $data |
|
1284 | + * @param int $priority |
|
1285 | + * |
|
1286 | + * @return EvFork |
|
1287 | + */ |
|
1288 | + final public static function createStopped(EvLoop $loop, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1289 | 1289 | } |
1290 | 1290 | |
1291 | 1291 | /** |
@@ -1301,286 +1301,286 @@ discard block |
||
1301 | 1301 | */ |
1302 | 1302 | final class EvLoop |
1303 | 1303 | { |
1304 | - /** |
|
1305 | - * @var int The Ev::BACKEND_* flag indicating the event backend in use. |
|
1306 | - */ |
|
1307 | - #[Immutable] |
|
1308 | - #[ExpectedValues(flags: [Ev::BACKEND_ALL, Ev::BACKEND_DEVPOLL, Ev::BACKEND_EPOLL, Ev::BACKEND_KQUEUE, Ev::BACKEND_MASK, Ev::BACKEND_POLL, Ev::BACKEND_PORT, Ev::BACKEND_SELECT])] |
|
1309 | - public $backend; |
|
1310 | - |
|
1311 | - /** |
|
1312 | - * @var bool TRUE if it is the default event loop. |
|
1313 | - */ |
|
1314 | - #[Immutable] |
|
1315 | - public $is_default_loop; |
|
1316 | - |
|
1317 | - /** |
|
1318 | - * @var mixed Custom data attached to the loop. |
|
1319 | - */ |
|
1320 | - public $data; |
|
1321 | - |
|
1322 | - /** |
|
1323 | - * @var int The current iteration count of the loop. See Ev::iteration(). |
|
1324 | - */ |
|
1325 | - public $iteration; |
|
1326 | - |
|
1327 | - /** |
|
1328 | - * @var int The number of pending watchers. 0 indicates that there are no watchers pending. |
|
1329 | - */ |
|
1330 | - public $pending; |
|
1331 | - |
|
1332 | - /** |
|
1333 | - * @var float Higher io_interval allows libev to spend more time collecting EvIo events, so more events can be |
|
1334 | - * handled per iteration, at the cost of increasing latency. Timeouts (both EvPeriodic and EvTimer) will not be |
|
1335 | - * affected. Setting this to a non-zero value will introduce an additional sleep() call into most loop |
|
1336 | - * iterations. The sleep time ensures that libev will not poll for EvIo events more often than once per this |
|
1337 | - * interval, on average. Many programs can usually benefit by setting the io_interval to a value near 0.1, |
|
1338 | - * which is often enough for interactive servers (not for games). It usually doesn't make much sense to set it |
|
1339 | - * to a lower value than 0.01, as this approaches the timing granularity of most systems. |
|
1340 | - */ |
|
1341 | - public $io_interval; |
|
1342 | - |
|
1343 | - /** |
|
1344 | - * @var float Higher timeout_interval allows libev to spend more time collecting timeouts, at the expense of |
|
1345 | - * increased latency/jitter/inexactness (the watcher callback will be called later). EvIo watchers will not be |
|
1346 | - * affected. Setting this to a non-null value will not introduce any overhead in libev. |
|
1347 | - */ |
|
1348 | - public $timeout_interval; |
|
1349 | - |
|
1350 | - /** |
|
1351 | - * @var int The recursion depth. |
|
1352 | - */ |
|
1353 | - public $depth; |
|
1354 | - |
|
1355 | - /** |
|
1356 | - * @param int $flags |
|
1357 | - * @param mixed $data |
|
1358 | - * @param float $io_interval |
|
1359 | - * @param float $timeout_interval |
|
1360 | - */ |
|
1361 | - public function __construct(int $flags = Ev::FLAG_AUTO, mixed $data = null, float $io_interval = 0.0, float $timeout_interval = 0.0) {} |
|
1362 | - |
|
1363 | - /** |
|
1364 | - * Returns an integer describing the backend used by libev. |
|
1365 | - * |
|
1366 | - * @return int An integer describing the backend used by libev. See Ev::backend(). |
|
1367 | - */ |
|
1368 | - public function backend() {} |
|
1369 | - |
|
1370 | - /** |
|
1371 | - * Creates EvCheck object associated with the current event loop instance. |
|
1372 | - * |
|
1373 | - * @param callable $callback |
|
1374 | - * @param mixed $data |
|
1375 | - * @param int $priority |
|
1376 | - * @return EvCheck |
|
1377 | - */ |
|
1378 | - final public function check(callable $callback, $data = null, $priority = 0) {} |
|
1379 | - |
|
1380 | - /** |
|
1381 | - * Creates EvChild object associated with the current event loop instance; |
|
1382 | - * @link https://www.php.net/manual/en/evloop.child.php |
|
1383 | - * @param int $pid |
|
1384 | - * @param bool $trace |
|
1385 | - * @param callable $callback |
|
1386 | - * @param mixed $data |
|
1387 | - * @param int $priority |
|
1388 | - * @return EvChild |
|
1389 | - */ |
|
1390 | - final public function child(int $pid, bool $trace, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1391 | - |
|
1392 | - /** |
|
1393 | - * Creates EvEmbed object associated with the current event loop instance. |
|
1394 | - * |
|
1395 | - * @param EvLoop $other |
|
1396 | - * @param callable $callback |
|
1397 | - * @param mixed $data |
|
1398 | - * @param int $priority |
|
1399 | - * @return EvEmbed |
|
1400 | - */ |
|
1401 | - final public function embed(EvLoop $other, callable $callback, $data = null, $priority = 0) {} |
|
1402 | - |
|
1403 | - /** |
|
1404 | - * Creates EvFork object associated with the current event loop instance. |
|
1405 | - * |
|
1406 | - * @param callable $callback |
|
1407 | - * @param mixed $data |
|
1408 | - * @param int $priority |
|
1409 | - * @return EvFork |
|
1410 | - */ |
|
1411 | - final public function fork(callable $callback, $data = null, $priority = 0) {} |
|
1412 | - |
|
1413 | - /** |
|
1414 | - * Creates EvIdle object associated with the current event loop instance. |
|
1415 | - * |
|
1416 | - * @param callable $callback |
|
1417 | - * @param null $data |
|
1418 | - * @param int $priority |
|
1419 | - * @return EvIdle |
|
1420 | - */ |
|
1421 | - final public function idle(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1422 | - |
|
1423 | - /** |
|
1424 | - * Invoke all pending watchers while resetting their pending state. |
|
1425 | - */ |
|
1426 | - public function invokePending() {} |
|
1427 | - |
|
1428 | - /** |
|
1429 | - * Creates EvIo object associated with the current event loop instance. |
|
1430 | - * |
|
1431 | - * @param resource $fd |
|
1432 | - * @param int $events |
|
1433 | - * @param callable $callback |
|
1434 | - * @param mixed $data |
|
1435 | - * @param int $priority |
|
1436 | - * @return EvIo |
|
1437 | - */ |
|
1438 | - final public function io(mixed $fd, int $events, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1439 | - |
|
1440 | - /** |
|
1441 | - * Must be called after a fork. |
|
1442 | - * |
|
1443 | - * Must be called after a fork in the child, before entering or continuing the event loop. An alternative is to use |
|
1444 | - * Ev::FLAG_FORKCHECK which calls this function automatically, at some performance loss (refer to the libev |
|
1445 | - * documentation). |
|
1446 | - */ |
|
1447 | - public function loopFork() {} |
|
1448 | - |
|
1449 | - /** |
|
1450 | - * Returns the current "event loop time". |
|
1451 | - * |
|
1452 | - * Returns the current "event loop time", which is the time the event loop received events and started processing |
|
1453 | - * them. This timestamp does not change as long as callbacks are being processed, and this is also the base time |
|
1454 | - * used for relative timers. You can treat it as the timestamp of the event occurring (or more correctly, libev |
|
1455 | - * finding out about it). |
|
1456 | - * |
|
1457 | - * @return float Time of the event loop in (fractional) seconds. |
|
1458 | - */ |
|
1459 | - public function now() {} |
|
1460 | - |
|
1461 | - /** |
|
1462 | - * Establishes the current time by querying the kernel, updating the time returned by Ev::now in the progress. |
|
1463 | - * |
|
1464 | - * Establishes the current time by querying the kernel, updating the time returned by Ev::now() in the progress. |
|
1465 | - * This is a costly operation and is usually done automatically within Ev::run(). |
|
1466 | - * |
|
1467 | - * This method is rarely useful, but when some event callback runs for a very long time without entering the event |
|
1468 | - * loop, updating libev's consideration of the current time is a good idea. |
|
1469 | - */ |
|
1470 | - public function nowUpdate() {} |
|
1471 | - |
|
1472 | - /** |
|
1473 | - * Creates EvPeriodic object associated with the current event loop instance. |
|
1474 | - * |
|
1475 | - * @param float $offset |
|
1476 | - * @param float $interval |
|
1477 | - * @param callable $reschedule_cb |
|
1478 | - * @param callable $callback |
|
1479 | - * @param mixed $data |
|
1480 | - * @param int $priority |
|
1481 | - */ |
|
1482 | - final public function periodic(float $offset, float $interval, mixed $reschedule_cb, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1483 | - |
|
1484 | - /** |
|
1485 | - * Creates EvPrepare object associated with the current event loop instance. |
|
1486 | - * |
|
1487 | - * @param callable $callback |
|
1488 | - * @param mixed $data |
|
1489 | - * @param int $priority |
|
1490 | - */ |
|
1491 | - final public function prepare(callable $callback, $data = null, $priority = 0) {} |
|
1492 | - |
|
1493 | - /** |
|
1494 | - * Resume previously suspended default event loop. |
|
1495 | - * |
|
1496 | - * EvLoop::suspend() and EvLoop::resume() methods suspend and resume a loop correspondingly. |
|
1497 | - */ |
|
1498 | - public function resume() {} |
|
1499 | - |
|
1500 | - /** |
|
1501 | - * Begin checking for events and calling callbacks for the loop. |
|
1502 | - * |
|
1503 | - * Begin checking for events and calling callbacks for the current event loop. Returns when a callback calls |
|
1504 | - * Ev::stop() method, or the flags are nonzero (in which case the return value is true) or when there are no active |
|
1505 | - * watchers which reference the loop (EvWatcher::keepalive() is TRUE), in which case the return value will be FALSE. |
|
1506 | - * The return value can generally be interpreted as if TRUE, there is more work left to do. |
|
1507 | - * |
|
1508 | - * @param int $flags One of the Ev::RUN_* flags. |
|
1509 | - */ |
|
1510 | - public function run(int $flags = Ev::FLAG_AUTO) {} |
|
1511 | - |
|
1512 | - /** |
|
1513 | - * Creates EvSignal object associated with the current event loop instance. |
|
1514 | - * |
|
1515 | - * @param int $signum |
|
1516 | - * @param callable $callback |
|
1517 | - * @param mixed $data |
|
1518 | - * @param int $priority |
|
1519 | - * @return EvSignal |
|
1520 | - */ |
|
1521 | - final public function signal(int $signum, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1522 | - |
|
1523 | - /** |
|
1524 | - * Creates EvStats object associated with the current event loop instance. |
|
1525 | - * |
|
1526 | - * @param string $path |
|
1527 | - * @param float $interval |
|
1528 | - * @param callable $callback |
|
1529 | - * @param mixed $data |
|
1530 | - * @param int $priority |
|
1531 | - * @return EvStat |
|
1532 | - */ |
|
1533 | - final public function stat(string $path, float $interval, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1534 | - |
|
1535 | - /** |
|
1536 | - * Stops the event loop. |
|
1537 | - * |
|
1538 | - * @param int $how One of the Ev::BREAK_* flags. |
|
1539 | - */ |
|
1540 | - public function stop(int $how = Ev::BREAK_ALL) {} |
|
1541 | - |
|
1542 | - /** |
|
1543 | - * Suspend the loop. |
|
1544 | - * |
|
1545 | - * EvLoop::suspend() and EvLoop::resume() methods suspend and resume a loop correspondingly. |
|
1546 | - */ |
|
1547 | - public function suspend() {} |
|
1548 | - |
|
1549 | - /** |
|
1550 | - * Creates EvTimer object associated with the current event loop instance. |
|
1551 | - * |
|
1552 | - * @param float $after |
|
1553 | - * @param float $repeat |
|
1554 | - * @param callable $callback |
|
1555 | - * @param mixed $data |
|
1556 | - * @param int $priority |
|
1557 | - * @return EvTimer |
|
1558 | - */ |
|
1559 | - final public function timer(float $after, float $repeat, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1560 | - |
|
1561 | - /** |
|
1562 | - * Performs internal consistency checks (for debugging). |
|
1563 | - * |
|
1564 | - * Performs internal consistency checks (for debugging libev) and abort the program if any data structures were |
|
1565 | - * found to be corrupted. |
|
1566 | - */ |
|
1567 | - public function verify() {} |
|
1568 | - |
|
1569 | - /** |
|
1570 | - * Returns or creates the default event loop. |
|
1571 | - * |
|
1572 | - * If the default event loop is not created, EvLoop::defaultLoop() creates it with the specified parameters. |
|
1573 | - * Otherwise, it just returns the object representing previously created instance ignoring all the parameters. |
|
1574 | - * |
|
1575 | - * @param int $flags |
|
1576 | - * @param mixed $data |
|
1577 | - * @param float $io_interval |
|
1578 | - * @param float $timeout_interval |
|
1579 | - */ |
|
1580 | - public static function defaultLoop( |
|
1581 | - int $flags = Ev::FLAG_AUTO, |
|
1582 | - mixed $data = null, |
|
1583 | - float $io_interval = 0.0, |
|
1584 | - float $timeout_interval = 0.0 |
|
1585 | - ) {} |
|
1304 | + /** |
|
1305 | + * @var int The Ev::BACKEND_* flag indicating the event backend in use. |
|
1306 | + */ |
|
1307 | + #[Immutable] |
|
1308 | + #[ExpectedValues(flags: [Ev::BACKEND_ALL, Ev::BACKEND_DEVPOLL, Ev::BACKEND_EPOLL, Ev::BACKEND_KQUEUE, Ev::BACKEND_MASK, Ev::BACKEND_POLL, Ev::BACKEND_PORT, Ev::BACKEND_SELECT])] |
|
1309 | + public $backend; |
|
1310 | + |
|
1311 | + /** |
|
1312 | + * @var bool TRUE if it is the default event loop. |
|
1313 | + */ |
|
1314 | + #[Immutable] |
|
1315 | + public $is_default_loop; |
|
1316 | + |
|
1317 | + /** |
|
1318 | + * @var mixed Custom data attached to the loop. |
|
1319 | + */ |
|
1320 | + public $data; |
|
1321 | + |
|
1322 | + /** |
|
1323 | + * @var int The current iteration count of the loop. See Ev::iteration(). |
|
1324 | + */ |
|
1325 | + public $iteration; |
|
1326 | + |
|
1327 | + /** |
|
1328 | + * @var int The number of pending watchers. 0 indicates that there are no watchers pending. |
|
1329 | + */ |
|
1330 | + public $pending; |
|
1331 | + |
|
1332 | + /** |
|
1333 | + * @var float Higher io_interval allows libev to spend more time collecting EvIo events, so more events can be |
|
1334 | + * handled per iteration, at the cost of increasing latency. Timeouts (both EvPeriodic and EvTimer) will not be |
|
1335 | + * affected. Setting this to a non-zero value will introduce an additional sleep() call into most loop |
|
1336 | + * iterations. The sleep time ensures that libev will not poll for EvIo events more often than once per this |
|
1337 | + * interval, on average. Many programs can usually benefit by setting the io_interval to a value near 0.1, |
|
1338 | + * which is often enough for interactive servers (not for games). It usually doesn't make much sense to set it |
|
1339 | + * to a lower value than 0.01, as this approaches the timing granularity of most systems. |
|
1340 | + */ |
|
1341 | + public $io_interval; |
|
1342 | + |
|
1343 | + /** |
|
1344 | + * @var float Higher timeout_interval allows libev to spend more time collecting timeouts, at the expense of |
|
1345 | + * increased latency/jitter/inexactness (the watcher callback will be called later). EvIo watchers will not be |
|
1346 | + * affected. Setting this to a non-null value will not introduce any overhead in libev. |
|
1347 | + */ |
|
1348 | + public $timeout_interval; |
|
1349 | + |
|
1350 | + /** |
|
1351 | + * @var int The recursion depth. |
|
1352 | + */ |
|
1353 | + public $depth; |
|
1354 | + |
|
1355 | + /** |
|
1356 | + * @param int $flags |
|
1357 | + * @param mixed $data |
|
1358 | + * @param float $io_interval |
|
1359 | + * @param float $timeout_interval |
|
1360 | + */ |
|
1361 | + public function __construct(int $flags = Ev::FLAG_AUTO, mixed $data = null, float $io_interval = 0.0, float $timeout_interval = 0.0) {} |
|
1362 | + |
|
1363 | + /** |
|
1364 | + * Returns an integer describing the backend used by libev. |
|
1365 | + * |
|
1366 | + * @return int An integer describing the backend used by libev. See Ev::backend(). |
|
1367 | + */ |
|
1368 | + public function backend() {} |
|
1369 | + |
|
1370 | + /** |
|
1371 | + * Creates EvCheck object associated with the current event loop instance. |
|
1372 | + * |
|
1373 | + * @param callable $callback |
|
1374 | + * @param mixed $data |
|
1375 | + * @param int $priority |
|
1376 | + * @return EvCheck |
|
1377 | + */ |
|
1378 | + final public function check(callable $callback, $data = null, $priority = 0) {} |
|
1379 | + |
|
1380 | + /** |
|
1381 | + * Creates EvChild object associated with the current event loop instance; |
|
1382 | + * @link https://www.php.net/manual/en/evloop.child.php |
|
1383 | + * @param int $pid |
|
1384 | + * @param bool $trace |
|
1385 | + * @param callable $callback |
|
1386 | + * @param mixed $data |
|
1387 | + * @param int $priority |
|
1388 | + * @return EvChild |
|
1389 | + */ |
|
1390 | + final public function child(int $pid, bool $trace, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1391 | + |
|
1392 | + /** |
|
1393 | + * Creates EvEmbed object associated with the current event loop instance. |
|
1394 | + * |
|
1395 | + * @param EvLoop $other |
|
1396 | + * @param callable $callback |
|
1397 | + * @param mixed $data |
|
1398 | + * @param int $priority |
|
1399 | + * @return EvEmbed |
|
1400 | + */ |
|
1401 | + final public function embed(EvLoop $other, callable $callback, $data = null, $priority = 0) {} |
|
1402 | + |
|
1403 | + /** |
|
1404 | + * Creates EvFork object associated with the current event loop instance. |
|
1405 | + * |
|
1406 | + * @param callable $callback |
|
1407 | + * @param mixed $data |
|
1408 | + * @param int $priority |
|
1409 | + * @return EvFork |
|
1410 | + */ |
|
1411 | + final public function fork(callable $callback, $data = null, $priority = 0) {} |
|
1412 | + |
|
1413 | + /** |
|
1414 | + * Creates EvIdle object associated with the current event loop instance. |
|
1415 | + * |
|
1416 | + * @param callable $callback |
|
1417 | + * @param null $data |
|
1418 | + * @param int $priority |
|
1419 | + * @return EvIdle |
|
1420 | + */ |
|
1421 | + final public function idle(mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1422 | + |
|
1423 | + /** |
|
1424 | + * Invoke all pending watchers while resetting their pending state. |
|
1425 | + */ |
|
1426 | + public function invokePending() {} |
|
1427 | + |
|
1428 | + /** |
|
1429 | + * Creates EvIo object associated with the current event loop instance. |
|
1430 | + * |
|
1431 | + * @param resource $fd |
|
1432 | + * @param int $events |
|
1433 | + * @param callable $callback |
|
1434 | + * @param mixed $data |
|
1435 | + * @param int $priority |
|
1436 | + * @return EvIo |
|
1437 | + */ |
|
1438 | + final public function io(mixed $fd, int $events, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1439 | + |
|
1440 | + /** |
|
1441 | + * Must be called after a fork. |
|
1442 | + * |
|
1443 | + * Must be called after a fork in the child, before entering or continuing the event loop. An alternative is to use |
|
1444 | + * Ev::FLAG_FORKCHECK which calls this function automatically, at some performance loss (refer to the libev |
|
1445 | + * documentation). |
|
1446 | + */ |
|
1447 | + public function loopFork() {} |
|
1448 | + |
|
1449 | + /** |
|
1450 | + * Returns the current "event loop time". |
|
1451 | + * |
|
1452 | + * Returns the current "event loop time", which is the time the event loop received events and started processing |
|
1453 | + * them. This timestamp does not change as long as callbacks are being processed, and this is also the base time |
|
1454 | + * used for relative timers. You can treat it as the timestamp of the event occurring (or more correctly, libev |
|
1455 | + * finding out about it). |
|
1456 | + * |
|
1457 | + * @return float Time of the event loop in (fractional) seconds. |
|
1458 | + */ |
|
1459 | + public function now() {} |
|
1460 | + |
|
1461 | + /** |
|
1462 | + * Establishes the current time by querying the kernel, updating the time returned by Ev::now in the progress. |
|
1463 | + * |
|
1464 | + * Establishes the current time by querying the kernel, updating the time returned by Ev::now() in the progress. |
|
1465 | + * This is a costly operation and is usually done automatically within Ev::run(). |
|
1466 | + * |
|
1467 | + * This method is rarely useful, but when some event callback runs for a very long time without entering the event |
|
1468 | + * loop, updating libev's consideration of the current time is a good idea. |
|
1469 | + */ |
|
1470 | + public function nowUpdate() {} |
|
1471 | + |
|
1472 | + /** |
|
1473 | + * Creates EvPeriodic object associated with the current event loop instance. |
|
1474 | + * |
|
1475 | + * @param float $offset |
|
1476 | + * @param float $interval |
|
1477 | + * @param callable $reschedule_cb |
|
1478 | + * @param callable $callback |
|
1479 | + * @param mixed $data |
|
1480 | + * @param int $priority |
|
1481 | + */ |
|
1482 | + final public function periodic(float $offset, float $interval, mixed $reschedule_cb, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1483 | + |
|
1484 | + /** |
|
1485 | + * Creates EvPrepare object associated with the current event loop instance. |
|
1486 | + * |
|
1487 | + * @param callable $callback |
|
1488 | + * @param mixed $data |
|
1489 | + * @param int $priority |
|
1490 | + */ |
|
1491 | + final public function prepare(callable $callback, $data = null, $priority = 0) {} |
|
1492 | + |
|
1493 | + /** |
|
1494 | + * Resume previously suspended default event loop. |
|
1495 | + * |
|
1496 | + * EvLoop::suspend() and EvLoop::resume() methods suspend and resume a loop correspondingly. |
|
1497 | + */ |
|
1498 | + public function resume() {} |
|
1499 | + |
|
1500 | + /** |
|
1501 | + * Begin checking for events and calling callbacks for the loop. |
|
1502 | + * |
|
1503 | + * Begin checking for events and calling callbacks for the current event loop. Returns when a callback calls |
|
1504 | + * Ev::stop() method, or the flags are nonzero (in which case the return value is true) or when there are no active |
|
1505 | + * watchers which reference the loop (EvWatcher::keepalive() is TRUE), in which case the return value will be FALSE. |
|
1506 | + * The return value can generally be interpreted as if TRUE, there is more work left to do. |
|
1507 | + * |
|
1508 | + * @param int $flags One of the Ev::RUN_* flags. |
|
1509 | + */ |
|
1510 | + public function run(int $flags = Ev::FLAG_AUTO) {} |
|
1511 | + |
|
1512 | + /** |
|
1513 | + * Creates EvSignal object associated with the current event loop instance. |
|
1514 | + * |
|
1515 | + * @param int $signum |
|
1516 | + * @param callable $callback |
|
1517 | + * @param mixed $data |
|
1518 | + * @param int $priority |
|
1519 | + * @return EvSignal |
|
1520 | + */ |
|
1521 | + final public function signal(int $signum, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1522 | + |
|
1523 | + /** |
|
1524 | + * Creates EvStats object associated with the current event loop instance. |
|
1525 | + * |
|
1526 | + * @param string $path |
|
1527 | + * @param float $interval |
|
1528 | + * @param callable $callback |
|
1529 | + * @param mixed $data |
|
1530 | + * @param int $priority |
|
1531 | + * @return EvStat |
|
1532 | + */ |
|
1533 | + final public function stat(string $path, float $interval, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1534 | + |
|
1535 | + /** |
|
1536 | + * Stops the event loop. |
|
1537 | + * |
|
1538 | + * @param int $how One of the Ev::BREAK_* flags. |
|
1539 | + */ |
|
1540 | + public function stop(int $how = Ev::BREAK_ALL) {} |
|
1541 | + |
|
1542 | + /** |
|
1543 | + * Suspend the loop. |
|
1544 | + * |
|
1545 | + * EvLoop::suspend() and EvLoop::resume() methods suspend and resume a loop correspondingly. |
|
1546 | + */ |
|
1547 | + public function suspend() {} |
|
1548 | + |
|
1549 | + /** |
|
1550 | + * Creates EvTimer object associated with the current event loop instance. |
|
1551 | + * |
|
1552 | + * @param float $after |
|
1553 | + * @param float $repeat |
|
1554 | + * @param callable $callback |
|
1555 | + * @param mixed $data |
|
1556 | + * @param int $priority |
|
1557 | + * @return EvTimer |
|
1558 | + */ |
|
1559 | + final public function timer(float $after, float $repeat, mixed $callback, mixed $data = null, int $priority = 0) {} |
|
1560 | + |
|
1561 | + /** |
|
1562 | + * Performs internal consistency checks (for debugging). |
|
1563 | + * |
|
1564 | + * Performs internal consistency checks (for debugging libev) and abort the program if any data structures were |
|
1565 | + * found to be corrupted. |
|
1566 | + */ |
|
1567 | + public function verify() {} |
|
1568 | + |
|
1569 | + /** |
|
1570 | + * Returns or creates the default event loop. |
|
1571 | + * |
|
1572 | + * If the default event loop is not created, EvLoop::defaultLoop() creates it with the specified parameters. |
|
1573 | + * Otherwise, it just returns the object representing previously created instance ignoring all the parameters. |
|
1574 | + * |
|
1575 | + * @param int $flags |
|
1576 | + * @param mixed $data |
|
1577 | + * @param float $io_interval |
|
1578 | + * @param float $timeout_interval |
|
1579 | + */ |
|
1580 | + public static function defaultLoop( |
|
1581 | + int $flags = Ev::FLAG_AUTO, |
|
1582 | + mixed $data = null, |
|
1583 | + float $io_interval = 0.0, |
|
1584 | + float $timeout_interval = 0.0 |
|
1585 | + ) {} |
|
1586 | 1586 | } |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * Ev is a singleton providing access to the default loop and to some common operations. |
9 | 9 | */ |
10 | -final class Ev |
|
11 | -{ |
|
10 | +final class Ev { |
|
12 | 11 | /** |
13 | 12 | * Flag passed to create a loop: The default flags value |
14 | 13 | */ |
@@ -387,8 +386,7 @@ discard block |
||
387 | 386 | /** |
388 | 387 | * Class EvWatcher |
389 | 388 | */ |
390 | -abstract class EvWatcher |
|
391 | -{ |
|
389 | +abstract class EvWatcher { |
|
392 | 390 | /** |
393 | 391 | * @var bool TRUE if the watcher is active. FALSE otherwise. |
394 | 392 | */ |
@@ -517,8 +515,7 @@ discard block |
||
517 | 515 | * Also, EvCheck watchers should not activate/feed events. While libev fully supports this, they might get executed |
518 | 516 | * before other EvCheck watchers did their job. |
519 | 517 | */ |
520 | -final class EvCheck extends EvWatcher |
|
521 | -{ |
|
518 | +final class EvCheck extends EvWatcher { |
|
522 | 519 | /** |
523 | 520 | * @param callable $callback |
524 | 521 | * @param mixed $data |
@@ -550,8 +547,7 @@ discard block |
||
550 | 547 | * |
551 | 548 | * It is allowed to register EvChild watchers in the default loop only. |
552 | 549 | */ |
553 | -final class EvChild extends EvWatcher |
|
554 | -{ |
|
550 | +final class EvChild extends EvWatcher { |
|
555 | 551 | /** |
556 | 552 | * @var int The process ID this watcher watches out for, or 0, meaning any process ID. |
557 | 553 | */ |
@@ -637,8 +633,7 @@ discard block |
||
637 | 633 | * |
638 | 634 | * Used to embed one event loop into another. |
639 | 635 | */ |
640 | -final class EvEmbed extends EvWatcher |
|
641 | -{ |
|
636 | +final class EvEmbed extends EvWatcher { |
|
642 | 637 | /** |
643 | 638 | * @var EvLoop The embedded loop |
644 | 639 | */ |
@@ -718,8 +713,7 @@ discard block |
||
718 | 713 | * |
719 | 714 | * Always consider using non-blocking mode. |
720 | 715 | */ |
721 | -final class EvIo extends EvWatcher |
|
722 | -{ |
|
716 | +final class EvIo extends EvWatcher { |
|
723 | 717 | /** |
724 | 718 | * @var resource A stream opened with fopen() or similar functions, numeric file descriptor, or socket. |
725 | 719 | */ |
@@ -798,8 +792,7 @@ discard block |
||
798 | 792 | * are invoked before ones with later time-out values (but this is no longer true when a callback calls EvLoop::run() |
799 | 793 | * recursively). |
800 | 794 | */ |
801 | -final class EvPeriodic extends EvWatcher |
|
802 | -{ |
|
795 | +final class EvPeriodic extends EvWatcher { |
|
803 | 796 | /** |
804 | 797 | * @var float When repeating, this contains the offset value, otherwise this is the absolute point in time (the |
805 | 798 | * offset value passed to EvPeriodic::set(), although libev might modify this value for better numerical |
@@ -916,8 +909,7 @@ discard block |
||
916 | 909 | * Also, EvCheck watchers should not activate/feed events. While libev fully supports this, they might get executed |
917 | 910 | * before other EvCheck watchers did their job. |
918 | 911 | */ |
919 | -final class EvPrepare extends EvWatcher |
|
920 | -{ |
|
912 | +final class EvPrepare extends EvWatcher { |
|
921 | 913 | /** |
922 | 914 | * Constructs EvPrepare watcher object. |
923 | 915 | * |
@@ -964,8 +956,7 @@ discard block |
||
964 | 956 | * system calls should not be unduly interrupted. In case of a problem with system calls getting interrupted by signals, |
965 | 957 | * all the signals can be blocked in an EvCheck watcher and unblocked in a EvPrepare watcher. |
966 | 958 | */ |
967 | -final class EvSignal extends EvWatcher |
|
968 | -{ |
|
959 | +final class EvSignal extends EvWatcher { |
|
969 | 960 | /** |
970 | 961 | * @var int Signal number. See the constants exported by pcntl extension. See also signal(7) man page. |
971 | 962 | */ |
@@ -1032,8 +1023,7 @@ discard block |
||
1032 | 1023 | * This watcher type is not meant for massive numbers of EvStat watchers, as even with OS-supported change |
1033 | 1024 | * notifications, this can be resource-intensive. |
1034 | 1025 | */ |
1035 | -final class EvStat extends EvWatcher |
|
1036 | -{ |
|
1026 | +final class EvStat extends EvWatcher { |
|
1037 | 1027 | /** |
1038 | 1028 | * @var float Hint on how quickly a change is expected to be detected and should normally be |
1039 | 1029 | * specified as 0.0 to let libev choose a suitable value. |
@@ -1136,8 +1126,7 @@ discard block |
||
1136 | 1126 | * the timer (because it takes longer than those 10 seconds to do) the timer will not fire more than once per event loop |
1137 | 1127 | * iteration. |
1138 | 1128 | */ |
1139 | -final class EvTimer extends EvWatcher |
|
1140 | -{ |
|
1129 | +final class EvTimer extends EvWatcher { |
|
1141 | 1130 | /** |
1142 | 1131 | * @var float If repeat is 0.0, then it will automatically be stopped once the timeout is reached. If it is |
1143 | 1132 | * positive, then the timer will automatically be configured to trigger again every repeat seconds later, until |
@@ -1234,8 +1223,7 @@ discard block |
||
1234 | 1223 | * The most noticeable effect is that as long as any idle watchers are active, the process will not block when waiting |
1235 | 1224 | * for new events. |
1236 | 1225 | */ |
1237 | -final class EvIdle extends EvWatcher |
|
1238 | -{ |
|
1226 | +final class EvIdle extends EvWatcher { |
|
1239 | 1227 | /** |
1240 | 1228 | * Constructs an EvIdle instance. |
1241 | 1229 | * |
@@ -1265,8 +1253,7 @@ discard block |
||
1265 | 1253 | * called, and only in the child after the fork. Note that if someone calls EvLoop::fork() in the wrong process, the |
1266 | 1254 | * fork handlers will be invoked, too. |
1267 | 1255 | */ |
1268 | -final class EvFork extends EvWatcher |
|
1269 | -{ |
|
1256 | +final class EvFork extends EvWatcher { |
|
1270 | 1257 | /** |
1271 | 1258 | * Constructs an EvFork instance. |
1272 | 1259 | * |
@@ -1299,8 +1286,7 @@ discard block |
||
1299 | 1286 | * The default event loop is initialized automatically by Ev. It is accessible via methods of the Ev class, or via |
1300 | 1287 | * EvLoop::defaultLoop() method. |
1301 | 1288 | */ |
1302 | -final class EvLoop |
|
1303 | -{ |
|
1289 | +final class EvLoop { |
|
1304 | 1290 | /** |
1305 | 1291 | * @var int The Ev::BACKEND_* flag indicating the event backend in use. |
1306 | 1292 | */ |
@@ -8,275 +8,275 @@ discard block |
||
8 | 8 | */ |
9 | 9 | class SNMP |
10 | 10 | { |
11 | - /** |
|
12 | - * @var int Maximum OID per GET/SET/GETBULK request |
|
13 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.max-oids |
|
14 | - */ |
|
15 | - public $max_oids; |
|
11 | + /** |
|
12 | + * @var int Maximum OID per GET/SET/GETBULK request |
|
13 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.max-oids |
|
14 | + */ |
|
15 | + public $max_oids; |
|
16 | 16 | |
17 | - /** |
|
18 | - * @var int Controls the method how the SNMP values will be returned |
|
19 | - * <dl> |
|
20 | - * <dt>SNMP_VALUE_LIBRARY</dt><dd>The return values will be as returned by the Net-SNMP library.</dd> |
|
21 | - * <dt>SNMP_VALUE_PLAIN</dt><dd>The return values will be the plain value without the SNMP type hint.</dd> |
|
22 | - * <dt>SNMP_VALUE_OBJECT</dt><dd>The return values will be objects with the properties "value" and "type", where the latter is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The way "value" is returned is based on which one of SNMP_VALUE_LIBRARY, SNMP_VALUE_PLAIN is set</dd> |
|
23 | - * <dl> |
|
24 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.max-oids |
|
25 | - */ |
|
26 | - public $valueretrieval; |
|
17 | + /** |
|
18 | + * @var int Controls the method how the SNMP values will be returned |
|
19 | + * <dl> |
|
20 | + * <dt>SNMP_VALUE_LIBRARY</dt><dd>The return values will be as returned by the Net-SNMP library.</dd> |
|
21 | + * <dt>SNMP_VALUE_PLAIN</dt><dd>The return values will be the plain value without the SNMP type hint.</dd> |
|
22 | + * <dt>SNMP_VALUE_OBJECT</dt><dd>The return values will be objects with the properties "value" and "type", where the latter is one of the SNMP_OCTET_STR, SNMP_COUNTER etc. constants. The way "value" is returned is based on which one of SNMP_VALUE_LIBRARY, SNMP_VALUE_PLAIN is set</dd> |
|
23 | + * <dl> |
|
24 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.max-oids |
|
25 | + */ |
|
26 | + public $valueretrieval; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @var bool Value of quick_print within the NET-SNMP library |
|
30 | - * <p>Sets the value of quick_print within the NET-SNMP library. When this is set (1), the SNMP library will return 'quick printed' values. This means that just the value will be printed. When quick_print is not enabled (default) the UCD SNMP library prints extra information including the type of the value (i.e. IpAddress or OID). Additionally, if quick_print is not enabled, the library prints additional hex values for all strings of three characters or less. |
|
31 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.quick-print |
|
32 | - */ |
|
33 | - public $quick_print; |
|
28 | + /** |
|
29 | + * @var bool Value of quick_print within the NET-SNMP library |
|
30 | + * <p>Sets the value of quick_print within the NET-SNMP library. When this is set (1), the SNMP library will return 'quick printed' values. This means that just the value will be printed. When quick_print is not enabled (default) the UCD SNMP library prints extra information including the type of the value (i.e. IpAddress or OID). Additionally, if quick_print is not enabled, the library prints additional hex values for all strings of three characters or less. |
|
31 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.quick-print |
|
32 | + */ |
|
33 | + public $quick_print; |
|
34 | 34 | |
35 | - /** |
|
36 | - * @var bool Controls the way enum values are printed |
|
37 | - * <p>Parameter toggles if walk/get etc. should automatically lookup enum values in the MIB and return them together with their human readable string. |
|
38 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.enum-print |
|
39 | - */ |
|
40 | - public $enum_print; |
|
35 | + /** |
|
36 | + * @var bool Controls the way enum values are printed |
|
37 | + * <p>Parameter toggles if walk/get etc. should automatically lookup enum values in the MIB and return them together with their human readable string. |
|
38 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.enum-print |
|
39 | + */ |
|
40 | + public $enum_print; |
|
41 | 41 | |
42 | - /** |
|
43 | - * @var int Controls OID output format |
|
44 | - * <p>OID .1.3.6.1.2.1.1.3.0 representation for various oid_output_format values |
|
45 | - * <dl> |
|
46 | - * <dt>SNMP_OID_OUTPUT_FULL</dt><dd>.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance</dd> |
|
47 | - * <dt>SNMP_OID_OUTPUT_NUMERIC</dt><dd>.1.3.6.1.2.1.1.3.0</dd> |
|
48 | - * <dt>SNMP_OID_OUTPUT_MODULE</dt><dd>DISMAN-EVENT-MIB::sysUpTimeInstance</dd> |
|
49 | - * <dt>SNMP_OID_OUTPUT_SUFFIX</dt><dd>sysUpTimeInstance</dd> |
|
50 | - * <dt>SNMP_OID_OUTPUT_UCD</dt><dd>system.sysUpTime.sysUpTimeInstance</dd> |
|
51 | - * <dt>SNMP_OID_OUTPUT_NONE</dt><dd>Undefined</dd> |
|
52 | - * </dl> |
|
53 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.oid-output-format |
|
54 | - */ |
|
55 | - public $oid_output_format; |
|
42 | + /** |
|
43 | + * @var int Controls OID output format |
|
44 | + * <p>OID .1.3.6.1.2.1.1.3.0 representation for various oid_output_format values |
|
45 | + * <dl> |
|
46 | + * <dt>SNMP_OID_OUTPUT_FULL</dt><dd>.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance</dd> |
|
47 | + * <dt>SNMP_OID_OUTPUT_NUMERIC</dt><dd>.1.3.6.1.2.1.1.3.0</dd> |
|
48 | + * <dt>SNMP_OID_OUTPUT_MODULE</dt><dd>DISMAN-EVENT-MIB::sysUpTimeInstance</dd> |
|
49 | + * <dt>SNMP_OID_OUTPUT_SUFFIX</dt><dd>sysUpTimeInstance</dd> |
|
50 | + * <dt>SNMP_OID_OUTPUT_UCD</dt><dd>system.sysUpTime.sysUpTimeInstance</dd> |
|
51 | + * <dt>SNMP_OID_OUTPUT_NONE</dt><dd>Undefined</dd> |
|
52 | + * </dl> |
|
53 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.oid-output-format |
|
54 | + */ |
|
55 | + public $oid_output_format; |
|
56 | 56 | |
57 | - /** |
|
58 | - * @var bool Controls disabling check for increasing OID while walking OID tree |
|
59 | - * <p> Some SNMP agents are known for returning OIDs out of order but can complete the walk anyway. Other agents return OIDs that are out of order and can cause SNMP::walk() to loop indefinitely until memory limit will be reached. PHP SNMP library by default performs OID increasing check and stops walking on OID tree when it detects possible loop with issuing warning about non-increasing OID faced. Set oid_increasing_check to <b>FALSE</b> to disable this check. |
|
60 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.oid-increasing-check |
|
61 | - */ |
|
62 | - public $oid_increasing_check; |
|
57 | + /** |
|
58 | + * @var bool Controls disabling check for increasing OID while walking OID tree |
|
59 | + * <p> Some SNMP agents are known for returning OIDs out of order but can complete the walk anyway. Other agents return OIDs that are out of order and can cause SNMP::walk() to loop indefinitely until memory limit will be reached. PHP SNMP library by default performs OID increasing check and stops walking on OID tree when it detects possible loop with issuing warning about non-increasing OID faced. Set oid_increasing_check to <b>FALSE</b> to disable this check. |
|
60 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.oid-increasing-check |
|
61 | + */ |
|
62 | + public $oid_increasing_check; |
|
63 | 63 | |
64 | - /** |
|
65 | - * @var int Controls which failures will raise SNMPException instead of warning. Use bitwise OR'ed SNMP::ERRNO_* constants. By default all SNMP exceptions are disabled. |
|
66 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.exceptions-enabled |
|
67 | - */ |
|
68 | - public $exceptions_enabled; |
|
64 | + /** |
|
65 | + * @var int Controls which failures will raise SNMPException instead of warning. Use bitwise OR'ed SNMP::ERRNO_* constants. By default all SNMP exceptions are disabled. |
|
66 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.exceptions-enabled |
|
67 | + */ |
|
68 | + public $exceptions_enabled; |
|
69 | 69 | |
70 | - /** |
|
71 | - * @var array Read-only property with remote agent configuration: hostname, port, default timeout, default retries count |
|
72 | - * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.info |
|
73 | - */ |
|
74 | - public $info; |
|
70 | + /** |
|
71 | + * @var array Read-only property with remote agent configuration: hostname, port, default timeout, default retries count |
|
72 | + * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.info |
|
73 | + */ |
|
74 | + public $info; |
|
75 | 75 | |
76 | - public const VERSION_1 = 0; |
|
77 | - public const VERSION_2c = 1; |
|
78 | - public const VERSION_2C = 1; |
|
79 | - public const VERSION_3 = 3; |
|
80 | - public const ERRNO_NOERROR = 0; |
|
81 | - public const ERRNO_ANY = 126; |
|
82 | - public const ERRNO_GENERIC = 2; |
|
83 | - public const ERRNO_TIMEOUT = 4; |
|
84 | - public const ERRNO_ERROR_IN_REPLY = 8; |
|
85 | - public const ERRNO_OID_NOT_INCREASING = 16; |
|
86 | - public const ERRNO_OID_PARSING_ERROR = 32; |
|
87 | - public const ERRNO_MULTIPLE_SET_QUERIES = 64; |
|
76 | + public const VERSION_1 = 0; |
|
77 | + public const VERSION_2c = 1; |
|
78 | + public const VERSION_2C = 1; |
|
79 | + public const VERSION_3 = 3; |
|
80 | + public const ERRNO_NOERROR = 0; |
|
81 | + public const ERRNO_ANY = 126; |
|
82 | + public const ERRNO_GENERIC = 2; |
|
83 | + public const ERRNO_TIMEOUT = 4; |
|
84 | + public const ERRNO_ERROR_IN_REPLY = 8; |
|
85 | + public const ERRNO_OID_NOT_INCREASING = 16; |
|
86 | + public const ERRNO_OID_PARSING_ERROR = 32; |
|
87 | + public const ERRNO_MULTIPLE_SET_QUERIES = 64; |
|
88 | 88 | |
89 | - /** |
|
90 | - * Creates SNMP instance representing session to remote SNMP agent |
|
91 | - * @link https://php.net/manual/en/snmp.construct.php |
|
92 | - * @param int $version <p>SNMP protocol version: |
|
93 | - * <b>SNMP::VERSION_1</b>, |
|
94 | - * <b>SNMP::VERSION_2C</b>, |
|
95 | - * <b>SNMP::VERSION_3</b>.</p> |
|
96 | - * @param string $hostname The SNMP agent. <i>hostname</i> may be suffixed with |
|
97 | - * optional <acronym title="Simple Network Management Protocol">SNMP</acronym> agent port after colon. IPv6 addresses must be enclosed in square |
|
98 | - * brackets if used with port. If FQDN is used for <i>hostname</i> |
|
99 | - * it will be resolved by php-snmp library, not by Net-SNMP engine. Usage |
|
100 | - * of IPv6 addresses when specifying FQDN may be forced by enclosing FQDN |
|
101 | - * into square brackets. Here it is some examples: |
|
102 | - * <table> |
|
103 | - * <tbody> |
|
104 | - * <tr><td>IPv4 with default port</td><td>127.0.0.1</td></tr> |
|
105 | - * <tr><td>IPv6 with default port</td><td>::1 or [::1]</td></tr> |
|
106 | - * <tr><td>IPv4 with specific port</td><td>127.0.0.1:1161</td></tr> |
|
107 | - * <tr><td>IPv6 with specific port</td><td>[::1]:1161</td></tr> |
|
108 | - * <tr><td>FQDN with default port</td><td>host.domain</td></tr> |
|
109 | - * <tr><td>FQDN with specific port</td><td>host.domain:1161</td></tr> |
|
110 | - * <tr><td>FQDN with default port, force usage of IPv6 address</td><td>[host.domain]</td></tr> |
|
111 | - * <tr><td>FQDN with specific port, force usage of IPv6 address</td><td>[host.domain]:1161</td></tr> |
|
112 | - * </tbody> |
|
113 | - * </table> |
|
114 | - * @param string $community <p>The purpuse of <i>community</i> is |
|
115 | - * <acronym title="Simple Network Management Protocol">SNMP</acronym> version specific:</p> |
|
116 | - * <table> |
|
117 | - * <tbody> |
|
118 | - * <tr><td>SNMP::VERSION_1</td><td><acronym title="Simple Network Management Protocol">SNMP</acronym> community</td></tr> |
|
119 | - * <tr><td>SNMP::VERSION_2C</td><td><acronym title="Simple Network Management Protocol">SNMP</acronym> community</td></tr> |
|
120 | - * <tr><td>SNMP::VERSION_3</td><td><acronym title="Simple Network Management Protocol">SNMP</acronym>v3 securityName</td></tr> |
|
121 | - * </tbody> |
|
122 | - * </table> |
|
123 | - * @param int $timeout [optional] The number of microseconds until the first timeout. |
|
124 | - * @param int $retries [optional] The number of retries in case timeout occurs. |
|
125 | - * @since 5.4 |
|
126 | - */ |
|
127 | - public function __construct($version, $hostname, $community, $timeout = 1000000, $retries = 5) {} |
|
89 | + /** |
|
90 | + * Creates SNMP instance representing session to remote SNMP agent |
|
91 | + * @link https://php.net/manual/en/snmp.construct.php |
|
92 | + * @param int $version <p>SNMP protocol version: |
|
93 | + * <b>SNMP::VERSION_1</b>, |
|
94 | + * <b>SNMP::VERSION_2C</b>, |
|
95 | + * <b>SNMP::VERSION_3</b>.</p> |
|
96 | + * @param string $hostname The SNMP agent. <i>hostname</i> may be suffixed with |
|
97 | + * optional <acronym title="Simple Network Management Protocol">SNMP</acronym> agent port after colon. IPv6 addresses must be enclosed in square |
|
98 | + * brackets if used with port. If FQDN is used for <i>hostname</i> |
|
99 | + * it will be resolved by php-snmp library, not by Net-SNMP engine. Usage |
|
100 | + * of IPv6 addresses when specifying FQDN may be forced by enclosing FQDN |
|
101 | + * into square brackets. Here it is some examples: |
|
102 | + * <table> |
|
103 | + * <tbody> |
|
104 | + * <tr><td>IPv4 with default port</td><td>127.0.0.1</td></tr> |
|
105 | + * <tr><td>IPv6 with default port</td><td>::1 or [::1]</td></tr> |
|
106 | + * <tr><td>IPv4 with specific port</td><td>127.0.0.1:1161</td></tr> |
|
107 | + * <tr><td>IPv6 with specific port</td><td>[::1]:1161</td></tr> |
|
108 | + * <tr><td>FQDN with default port</td><td>host.domain</td></tr> |
|
109 | + * <tr><td>FQDN with specific port</td><td>host.domain:1161</td></tr> |
|
110 | + * <tr><td>FQDN with default port, force usage of IPv6 address</td><td>[host.domain]</td></tr> |
|
111 | + * <tr><td>FQDN with specific port, force usage of IPv6 address</td><td>[host.domain]:1161</td></tr> |
|
112 | + * </tbody> |
|
113 | + * </table> |
|
114 | + * @param string $community <p>The purpuse of <i>community</i> is |
|
115 | + * <acronym title="Simple Network Management Protocol">SNMP</acronym> version specific:</p> |
|
116 | + * <table> |
|
117 | + * <tbody> |
|
118 | + * <tr><td>SNMP::VERSION_1</td><td><acronym title="Simple Network Management Protocol">SNMP</acronym> community</td></tr> |
|
119 | + * <tr><td>SNMP::VERSION_2C</td><td><acronym title="Simple Network Management Protocol">SNMP</acronym> community</td></tr> |
|
120 | + * <tr><td>SNMP::VERSION_3</td><td><acronym title="Simple Network Management Protocol">SNMP</acronym>v3 securityName</td></tr> |
|
121 | + * </tbody> |
|
122 | + * </table> |
|
123 | + * @param int $timeout [optional] The number of microseconds until the first timeout. |
|
124 | + * @param int $retries [optional] The number of retries in case timeout occurs. |
|
125 | + * @since 5.4 |
|
126 | + */ |
|
127 | + public function __construct($version, $hostname, $community, $timeout = 1000000, $retries = 5) {} |
|
128 | 128 | |
129 | - /** |
|
130 | - * Close SNMP session |
|
131 | - * @link https://php.net/manual/en/snmp.close.php |
|
132 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
133 | - * @since 5.4 |
|
134 | - */ |
|
135 | - public function close() {} |
|
129 | + /** |
|
130 | + * Close SNMP session |
|
131 | + * @link https://php.net/manual/en/snmp.close.php |
|
132 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
133 | + * @since 5.4 |
|
134 | + */ |
|
135 | + public function close() {} |
|
136 | 136 | |
137 | - /** |
|
138 | - * Configures security-related SNMPv3 session parameters |
|
139 | - * @link https://php.net/manual/en/snmp.setsecurity.php |
|
140 | - * @param string $sec_level the security level (noAuthNoPriv|authNoPriv|authPriv) |
|
141 | - * @param string $auth_protocol [optional] the authentication protocol (MD5 or SHA) |
|
142 | - * @param string $auth_passphrase [optional] the authentication pass phrase |
|
143 | - * @param string $priv_protocol [optional] the privacy protocol (DES or AES) |
|
144 | - * @param string $priv_passphrase [optional] the privacy pass phrase |
|
145 | - * @param string $contextName [optional] the context name |
|
146 | - * @param string $contextEngineID [optional] the context EngineID |
|
147 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
148 | - * @since 5.4 |
|
149 | - */ |
|
150 | - public function setSecurity($sec_level, $auth_protocol, $auth_passphrase, $priv_protocol, $priv_passphrase, $contextName, $contextEngineID) {} |
|
137 | + /** |
|
138 | + * Configures security-related SNMPv3 session parameters |
|
139 | + * @link https://php.net/manual/en/snmp.setsecurity.php |
|
140 | + * @param string $sec_level the security level (noAuthNoPriv|authNoPriv|authPriv) |
|
141 | + * @param string $auth_protocol [optional] the authentication protocol (MD5 or SHA) |
|
142 | + * @param string $auth_passphrase [optional] the authentication pass phrase |
|
143 | + * @param string $priv_protocol [optional] the privacy protocol (DES or AES) |
|
144 | + * @param string $priv_passphrase [optional] the privacy pass phrase |
|
145 | + * @param string $contextName [optional] the context name |
|
146 | + * @param string $contextEngineID [optional] the context EngineID |
|
147 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
148 | + * @since 5.4 |
|
149 | + */ |
|
150 | + public function setSecurity($sec_level, $auth_protocol, $auth_passphrase, $priv_protocol, $priv_passphrase, $contextName, $contextEngineID) {} |
|
151 | 151 | |
152 | - /** |
|
153 | - * Fetch an SNMP object |
|
154 | - * @link https://php.net/manual/en/snmp.get.php |
|
155 | - * @param mixed $object_id The SNMP object (OID) or objects |
|
156 | - * @param bool $preserve_keys [optional] When object_id is a array and preserve_keys set to <b>TRUE</b> keys in results will be taken exactly as in object_id, otherwise SNMP::oid_output_format property is used to determinate the form of keys. |
|
157 | - * @return mixed SNMP objects requested as string or array |
|
158 | - * depending on <i>object_id</i> type or <b>FALSE</b> on error. |
|
159 | - * @since 5.4 |
|
160 | - */ |
|
161 | - public function get($object_id, $preserve_keys = false) {} |
|
152 | + /** |
|
153 | + * Fetch an SNMP object |
|
154 | + * @link https://php.net/manual/en/snmp.get.php |
|
155 | + * @param mixed $object_id The SNMP object (OID) or objects |
|
156 | + * @param bool $preserve_keys [optional] When object_id is a array and preserve_keys set to <b>TRUE</b> keys in results will be taken exactly as in object_id, otherwise SNMP::oid_output_format property is used to determinate the form of keys. |
|
157 | + * @return mixed SNMP objects requested as string or array |
|
158 | + * depending on <i>object_id</i> type or <b>FALSE</b> on error. |
|
159 | + * @since 5.4 |
|
160 | + */ |
|
161 | + public function get($object_id, $preserve_keys = false) {} |
|
162 | 162 | |
163 | - /** |
|
164 | - * Fetch an SNMP object which |
|
165 | - * follows the given object id |
|
166 | - * @link https://php.net/manual/en/snmp.getnext.php |
|
167 | - * @param mixed $object_id <p> |
|
168 | - * The <acronym title="Simple Network Management Protocol">SNMP</acronym> object (OID) or objects |
|
169 | - * </p> |
|
170 | - * @return mixed SNMP objects requested as string or array |
|
171 | - * depending on <i>object_id</i> type or <b>FALSE</b> on error. |
|
172 | - * @since 5.4 |
|
173 | - */ |
|
174 | - public function getnext($object_id) {} |
|
163 | + /** |
|
164 | + * Fetch an SNMP object which |
|
165 | + * follows the given object id |
|
166 | + * @link https://php.net/manual/en/snmp.getnext.php |
|
167 | + * @param mixed $object_id <p> |
|
168 | + * The <acronym title="Simple Network Management Protocol">SNMP</acronym> object (OID) or objects |
|
169 | + * </p> |
|
170 | + * @return mixed SNMP objects requested as string or array |
|
171 | + * depending on <i>object_id</i> type or <b>FALSE</b> on error. |
|
172 | + * @since 5.4 |
|
173 | + */ |
|
174 | + public function getnext($object_id) {} |
|
175 | 175 | |
176 | - /** |
|
177 | - * Fetch SNMP object subtree |
|
178 | - * @link https://php.net/manual/en/snmp.walk.php |
|
179 | - * @param string $object_id <p>Root of subtree to be fetched</p> |
|
180 | - * @param bool $suffix_as_keys [optional] <p>By default full OID notation is used for keys in output array. If set to <b>TRUE</b> subtree prefix will be removed from keys leaving only suffix of object_id.</p> |
|
181 | - * @param int $max_repetitions [optional] <p>This specifies the maximum number of iterations over the repeating variables. The default is to use this value from SNMP object.</p> |
|
182 | - * @param int $non_repeaters [optional] <p>This specifies the number of supplied variables that should not be iterated over. The default is to use this value from SNMP object.</p> |
|
183 | - * @return array|false associative array of the SNMP object ids and their values on success or <b>FALSE</b> on error. |
|
184 | - * When a SNMP error occures <b>SNMP::getErrno</b> and |
|
185 | - * <b>SNMP::getError</b> can be used for retrieving error |
|
186 | - * number (specific to SNMP extension, see class constants) and error message |
|
187 | - * respectively. |
|
188 | - * @since 5.4 |
|
189 | - */ |
|
190 | - public function walk($object_id, $suffix_as_keys = false, $max_repetitions, $non_repeaters) {} |
|
176 | + /** |
|
177 | + * Fetch SNMP object subtree |
|
178 | + * @link https://php.net/manual/en/snmp.walk.php |
|
179 | + * @param string $object_id <p>Root of subtree to be fetched</p> |
|
180 | + * @param bool $suffix_as_keys [optional] <p>By default full OID notation is used for keys in output array. If set to <b>TRUE</b> subtree prefix will be removed from keys leaving only suffix of object_id.</p> |
|
181 | + * @param int $max_repetitions [optional] <p>This specifies the maximum number of iterations over the repeating variables. The default is to use this value from SNMP object.</p> |
|
182 | + * @param int $non_repeaters [optional] <p>This specifies the number of supplied variables that should not be iterated over. The default is to use this value from SNMP object.</p> |
|
183 | + * @return array|false associative array of the SNMP object ids and their values on success or <b>FALSE</b> on error. |
|
184 | + * When a SNMP error occures <b>SNMP::getErrno</b> and |
|
185 | + * <b>SNMP::getError</b> can be used for retrieving error |
|
186 | + * number (specific to SNMP extension, see class constants) and error message |
|
187 | + * respectively. |
|
188 | + * @since 5.4 |
|
189 | + */ |
|
190 | + public function walk($object_id, $suffix_as_keys = false, $max_repetitions, $non_repeaters) {} |
|
191 | 191 | |
192 | - /** |
|
193 | - * Set the value of an SNMP object |
|
194 | - * @link https://php.net/manual/en/snmp.set.php |
|
195 | - * @param string $object_id <p>The SNMP object id</p> |
|
196 | - * @since 5.4 |
|
197 | - * |
|
198 | - * <p>When count of OIDs in object_id array is greater than |
|
199 | - * max_oids object property set method will have to use multiple queries |
|
200 | - * to perform requested value updates. In this case type and value checks |
|
201 | - * are made per-chunk so second or subsequent requests may fail due to |
|
202 | - * wrong type or value for OID requested. To mark this a warning is |
|
203 | - * raised when count of OIDs in object_id array is greater than max_oids. |
|
204 | - * When count of OIDs in object_id array is greater than max_oids object property set method will have to use multiple queries to perform requested value updates. In this case type and value checks are made per-chunk so second or subsequent requests may fail due to wrong type or value for OID requested. To mark this a warning is raised when count of OIDs in object_id array is greater than max_oids.</p> |
|
205 | - * @param mixed $type <p>The MIB defines the type of each object id. It has to be specified as a single character from the below list.</p> |
|
206 | - * <b>types:</b> |
|
207 | - * <table> |
|
208 | - * <tbody> |
|
209 | - * <tr><td>=</td><td>The type is taken from the MIB</td></tr> |
|
210 | - * <tr><td>i</td><td>INTEGER</td> </tr> |
|
211 | - * <tr><td>u</td><td>INTEGER</td></tr> |
|
212 | - * <tr><td>s</td><td>STRING</td></tr> |
|
213 | - * <tr><td>x</td><td>HEX STRING</td></tr> |
|
214 | - * <tr><td>d</td><td>DECIMAL STRING</td></tr> |
|
215 | - * <tr><td>n</td><td>NULLOBJ</td></tr> |
|
216 | - * <tr><td>o</td><td>OBJID</td></tr> |
|
217 | - * <tr><td>t</td><td>TIMETICKS</td></tr> |
|
218 | - * <tr><td>a</td><td>IPADDRESS</td></tr> |
|
219 | - * <tr><td>b</td><td>BITS</td></tr> |
|
220 | - * </tbody> |
|
221 | - * </table> |
|
222 | - * <p> |
|
223 | - * If <b>OPAQUE_SPECIAL_TYPES</b> was defined while compiling the SNMP library, the following are also valid: |
|
224 | - * </p> |
|
225 | - * <b>types:</b> |
|
226 | - * <table> |
|
227 | - * <tbody> |
|
228 | - * <tr><td>U</td><td>unsigned int64</td></tr> |
|
229 | - * <tr><td>I</td><td>signed int64</td></tr> |
|
230 | - * <tr><td>F</td><td>float</td></tr> |
|
231 | - * <tr><td>D</td><td>double</td></tr> |
|
232 | - * </tbody> |
|
233 | - * </table> |
|
234 | - * <p> |
|
235 | - * Most of these will use the obvious corresponding ASN.1 type. 's', 'x', 'd' and 'b' are all different ways of specifying an OCTET STRING value, and |
|
236 | - * the 'u' unsigned type is also used for handling Gauge32 values. |
|
237 | - * </p> |
|
238 | - * |
|
239 | - * <p> |
|
240 | - * If the MIB-Files are loaded by into the MIB Tree with "snmp_read_mib" or by specifying it in the libsnmp config, '=' may be used as |
|
241 | - * the <i>type</i> parameter for all object ids as the type can then be automatically read from the MIB. |
|
242 | - * </p> |
|
243 | - * |
|
244 | - * <p> |
|
245 | - * Note that there are two ways to set a variable of the type BITS like e.g. |
|
246 | - * "SYNTAX BITS {telnet(0), ftp(1), http(2), icmp(3), snmp(4), ssh(5), https(6)}": |
|
247 | - * </p> |
|
248 | - * <ul> |
|
249 | - * <li> |
|
250 | - * Using type "b" and a list of bit numbers. This method is not recommended since GET query for the same OID would return e.g. 0xF8. |
|
251 | - * </li> |
|
252 | - * <li> |
|
253 | - * Using type "x" and a hex number but without(!) the usual "0x" prefix. |
|
254 | - * </li> |
|
255 | - * </ul> |
|
256 | - * <p> |
|
257 | - * See examples section for more details. |
|
258 | - * </p> |
|
259 | - * @param mixed $value <p> |
|
260 | - * The new value.</p> |
|
261 | - * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
262 | - */ |
|
263 | - public function set($object_id, $type, $value) {} |
|
192 | + /** |
|
193 | + * Set the value of an SNMP object |
|
194 | + * @link https://php.net/manual/en/snmp.set.php |
|
195 | + * @param string $object_id <p>The SNMP object id</p> |
|
196 | + * @since 5.4 |
|
197 | + * |
|
198 | + * <p>When count of OIDs in object_id array is greater than |
|
199 | + * max_oids object property set method will have to use multiple queries |
|
200 | + * to perform requested value updates. In this case type and value checks |
|
201 | + * are made per-chunk so second or subsequent requests may fail due to |
|
202 | + * wrong type or value for OID requested. To mark this a warning is |
|
203 | + * raised when count of OIDs in object_id array is greater than max_oids. |
|
204 | + * When count of OIDs in object_id array is greater than max_oids object property set method will have to use multiple queries to perform requested value updates. In this case type and value checks are made per-chunk so second or subsequent requests may fail due to wrong type or value for OID requested. To mark this a warning is raised when count of OIDs in object_id array is greater than max_oids.</p> |
|
205 | + * @param mixed $type <p>The MIB defines the type of each object id. It has to be specified as a single character from the below list.</p> |
|
206 | + * <b>types:</b> |
|
207 | + * <table> |
|
208 | + * <tbody> |
|
209 | + * <tr><td>=</td><td>The type is taken from the MIB</td></tr> |
|
210 | + * <tr><td>i</td><td>INTEGER</td> </tr> |
|
211 | + * <tr><td>u</td><td>INTEGER</td></tr> |
|
212 | + * <tr><td>s</td><td>STRING</td></tr> |
|
213 | + * <tr><td>x</td><td>HEX STRING</td></tr> |
|
214 | + * <tr><td>d</td><td>DECIMAL STRING</td></tr> |
|
215 | + * <tr><td>n</td><td>NULLOBJ</td></tr> |
|
216 | + * <tr><td>o</td><td>OBJID</td></tr> |
|
217 | + * <tr><td>t</td><td>TIMETICKS</td></tr> |
|
218 | + * <tr><td>a</td><td>IPADDRESS</td></tr> |
|
219 | + * <tr><td>b</td><td>BITS</td></tr> |
|
220 | + * </tbody> |
|
221 | + * </table> |
|
222 | + * <p> |
|
223 | + * If <b>OPAQUE_SPECIAL_TYPES</b> was defined while compiling the SNMP library, the following are also valid: |
|
224 | + * </p> |
|
225 | + * <b>types:</b> |
|
226 | + * <table> |
|
227 | + * <tbody> |
|
228 | + * <tr><td>U</td><td>unsigned int64</td></tr> |
|
229 | + * <tr><td>I</td><td>signed int64</td></tr> |
|
230 | + * <tr><td>F</td><td>float</td></tr> |
|
231 | + * <tr><td>D</td><td>double</td></tr> |
|
232 | + * </tbody> |
|
233 | + * </table> |
|
234 | + * <p> |
|
235 | + * Most of these will use the obvious corresponding ASN.1 type. 's', 'x', 'd' and 'b' are all different ways of specifying an OCTET STRING value, and |
|
236 | + * the 'u' unsigned type is also used for handling Gauge32 values. |
|
237 | + * </p> |
|
238 | + * |
|
239 | + * <p> |
|
240 | + * If the MIB-Files are loaded by into the MIB Tree with "snmp_read_mib" or by specifying it in the libsnmp config, '=' may be used as |
|
241 | + * the <i>type</i> parameter for all object ids as the type can then be automatically read from the MIB. |
|
242 | + * </p> |
|
243 | + * |
|
244 | + * <p> |
|
245 | + * Note that there are two ways to set a variable of the type BITS like e.g. |
|
246 | + * "SYNTAX BITS {telnet(0), ftp(1), http(2), icmp(3), snmp(4), ssh(5), https(6)}": |
|
247 | + * </p> |
|
248 | + * <ul> |
|
249 | + * <li> |
|
250 | + * Using type "b" and a list of bit numbers. This method is not recommended since GET query for the same OID would return e.g. 0xF8. |
|
251 | + * </li> |
|
252 | + * <li> |
|
253 | + * Using type "x" and a hex number but without(!) the usual "0x" prefix. |
|
254 | + * </li> |
|
255 | + * </ul> |
|
256 | + * <p> |
|
257 | + * See examples section for more details. |
|
258 | + * </p> |
|
259 | + * @param mixed $value <p> |
|
260 | + * The new value.</p> |
|
261 | + * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. |
|
262 | + */ |
|
263 | + public function set($object_id, $type, $value) {} |
|
264 | 264 | |
265 | - /** |
|
266 | - * Get last error code |
|
267 | - * @link https://php.net/manual/en/snmp.geterrno.php |
|
268 | - * @return int one of SNMP error code values described in constants chapter. |
|
269 | - * @since 5.4 |
|
270 | - */ |
|
271 | - public function getErrno() {} |
|
265 | + /** |
|
266 | + * Get last error code |
|
267 | + * @link https://php.net/manual/en/snmp.geterrno.php |
|
268 | + * @return int one of SNMP error code values described in constants chapter. |
|
269 | + * @since 5.4 |
|
270 | + */ |
|
271 | + public function getErrno() {} |
|
272 | 272 | |
273 | - /** |
|
274 | - * Get last error message |
|
275 | - * @link https://php.net/manual/en/snmp.geterror.php |
|
276 | - * @return string String describing error from last SNMP request. |
|
277 | - * @since 5.4 |
|
278 | - */ |
|
279 | - public function getError() {} |
|
273 | + /** |
|
274 | + * Get last error message |
|
275 | + * @link https://php.net/manual/en/snmp.geterror.php |
|
276 | + * @return string String describing error from last SNMP request. |
|
277 | + * @since 5.4 |
|
278 | + */ |
|
279 | + public function getError() {} |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -288,14 +288,14 @@ discard block |
||
288 | 288 | */ |
289 | 289 | class SNMPException extends RuntimeException |
290 | 290 | { |
291 | - /** |
|
292 | - * @var string Textual error message. Exception::getMessage() to access it. |
|
293 | - */ |
|
294 | - protected $message; |
|
295 | - /** |
|
296 | - * @var string SNMP library error code. Use Exception::getCode() to access it. |
|
297 | - */ |
|
298 | - protected $code; |
|
291 | + /** |
|
292 | + * @var string Textual error message. Exception::getMessage() to access it. |
|
293 | + */ |
|
294 | + protected $message; |
|
295 | + /** |
|
296 | + * @var string SNMP library error code. Use Exception::getCode() to access it. |
|
297 | + */ |
|
298 | + protected $code; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -6,8 +6,7 @@ discard block |
||
6 | 6 | * Represents SNMP session. |
7 | 7 | * @link https://php.net/manual/en/class.snmp.php |
8 | 8 | */ |
9 | -class SNMP |
|
10 | -{ |
|
9 | +class SNMP { |
|
11 | 10 | /** |
12 | 11 | * @var int Maximum OID per GET/SET/GETBULK request |
13 | 12 | * @link https://secure.php.net/manual/en/class.snmp.php#snmp.props.max-oids |
@@ -286,8 +285,7 @@ discard block |
||
286 | 285 | * information about Exceptions in PHP. |
287 | 286 | * @link https://php.net/manual/en/class.snmpexception.php |
288 | 287 | */ |
289 | -class SNMPException extends RuntimeException |
|
290 | -{ |
|
288 | +class SNMPException extends RuntimeException { |
|
291 | 289 | /** |
292 | 290 | * @var string Textual error message. Exception::getMessage() to access it. |
293 | 291 | */ |