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

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

512 lines 11.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Safe;
4
5 use Safe\Exceptions\InfoException;
6
7 /**
8 * Sets the process title visible in tools such as top and
9 * ps. This function is available only in
10 * CLI mode.
11 *
12 * @param string $title The new title.
13 * @throws InfoException
14 *
15 */
16 function cli_set_process_title(string $title): void
17 {
18 error_clear_last();
19 $result = \cli_set_process_title($title);
20 if ($result === false) {
21 throw InfoException::createFromPhpError();
22 }
23 }
24
25
26 /**
27 * Loads the PHP extension given by the parameter
28 * library.
29 *
30 * Use extension_loaded to test whether a given
31 * extension is already available or not. This works on both built-in
32 * extensions and dynamically loaded ones (either through php.ini or
33 * dl).
34 *
35 * @param string $library This parameter is only the filename of the
36 * extension to load which also depends on your platform. For example,
37 * the sockets extension (if compiled
38 * as a shared module, not the default!) would be called
39 * sockets.so on Unix platforms whereas it is called
40 * php_sockets.dll on the Windows platform.
41 *
42 * The directory where the extension is loaded from depends on your
43 * platform:
44 *
45 * Windows - If not explicitly set in the php.ini, the extension is
46 * loaded from C:\php5\ by default.
47 *
48 * Unix - If not explicitly set in the php.ini, the default extension
49 * directory depends on
50 *
51 *
52 *
53 * whether PHP has been built with --enable-debug
54 * or not
55 *
56 *
57 *
58 *
59 * whether PHP has been built with (experimental) ZTS (Zend Thread Safety)
60 * support or not
61 *
62 *
63 *
64 *
65 * the current internal ZEND_MODULE_API_NO (Zend
66 * internal module API number, which is basically the date on which a
67 * major module API change happened, e.g. 20010901)
68 *
69 *
70 *
71 * Taking into account the above, the directory then defaults to
72 * &lt;install-dir&gt;/lib/php/extensions/ &lt;debug-or-not&gt;-&lt;zts-or-not&gt;-ZEND_MODULE_API_NO,
73 * e.g.
74 * /usr/local/php/lib/php/extensions/debug-non-zts-20010901
75 * or
76 * /usr/local/php/lib/php/extensions/no-debug-zts-20010901.
77 * @throws InfoException
78 *
79 */
80 function dl(string $library): void
81 {
82 error_clear_last();
83 $result = \dl($library);
84 if ($result === false) {
85 throw InfoException::createFromPhpError();
86 }
87 }
88
89
90 /**
91 * Gets the time of the last modification of the main script of execution.
92 *
93 * If you're interested in getting the last modification time
94 * of a different file, consider using filemtime.
95 *
96 * @return int Returns the time of the last modification of the current
97 * page. The value returned is a Unix timestamp, suitable for
98 * feeding to date.
99 * @throws InfoException
100 *
101 */
102 function getlastmod(): int
103 {
104 error_clear_last();
105 $result = \getlastmod();
106 if ($result === false) {
107 throw InfoException::createFromPhpError();
108 }
109 return $result;
110 }
111
112
113 /**
114 *
115 *
116 * @return int Returns the group ID of the current script.
117 * @throws InfoException
118 *
119 */
120 function getmygid(): int
121 {
122 error_clear_last();
123 $result = \getmygid();
124 if ($result === false) {
125 throw InfoException::createFromPhpError();
126 }
127 return $result;
128 }
129
130
131 /**
132 * Gets the inode of the current script.
133 *
134 * @return int Returns the current script's inode as an integer.
135 * @throws InfoException
136 *
137 */
138 function getmyinode(): int
139 {
140 error_clear_last();
141 $result = \getmyinode();
142 if ($result === false) {
143 throw InfoException::createFromPhpError();
144 }
145 return $result;
146 }
147
148
149 /**
150 * Gets the current PHP process ID.
151 *
152 * @return int Returns the current PHP process ID.
153 * @throws InfoException
154 *
155 */
156 function getmypid(): int
157 {
158 error_clear_last();
159 $result = \getmypid();
160 if ($result === false) {
161 throw InfoException::createFromPhpError();
162 }
163 return $result;
164 }
165
166
167 /**
168 *
169 *
170 * @return int Returns the user ID of the current script.
171 * @throws InfoException
172 *
173 */
174 function getmyuid(): int
175 {
176 error_clear_last();
177 $result = \getmyuid();
178 if ($result === false) {
179 throw InfoException::createFromPhpError();
180 }
181 return $result;
182 }
183
184
185 /**
186 * Parses options passed to the script.
187 *
188 * @param string $options
189 * @param array $longopts
190 * @param int|null $optind
191 * @return array|array|array This function will return an array of option / argument pairs.
192 * @throws InfoException
193 *
194 */
195 function getopt(string $options, array $longopts = null, ?int &$optind = null): array
196 {
197 error_clear_last();
198 if ($optind !== null) {
199 $result = \getopt($options, $longopts, $optind);
200 } elseif ($longopts !== null) {
201 $result = \getopt($options, $longopts);
202 } else {
203 $result = \getopt($options);
204 }
205 if ($result === false) {
206 throw InfoException::createFromPhpError();
207 }
208 return $result;
209 }
210
211
212 /**
213 * Returns the value of the configuration option on success.
214 *
215 * @param string $varname The configuration option name.
216 * @return string Returns the value of the configuration option as a string on success, or an
217 * empty string for null values. Returns FALSE if the
218 * configuration option doesn't exist.
219 * @throws InfoException
220 *
221 */
222 function ini_get(string $varname): string
223 {
224 error_clear_last();
225 $result = \ini_get($varname);
226 if ($result === false) {
227 throw InfoException::createFromPhpError();
228 }
229 return $result;
230 }
231
232
233 /**
234 * Sets the value of the given configuration option. The configuration option
235 * will keep this new value during the script's execution, and will be restored
236 * at the script's ending.
237 *
238 * @param string $varname Not all the available options can be changed using
239 * ini_set. There is a list of all available options
240 * in the appendix.
241 * @param string|int|float|bool $newvalue The new value for the option.
242 * @return string Returns the old value on success, FALSE on failure.
243 * @throws InfoException
244 *
245 */
246 function ini_set(string $varname, $newvalue): string
247 {
248 error_clear_last();
249 $result = \ini_set($varname, $newvalue);
250 if ($result === false) {
251 throw InfoException::createFromPhpError();
252 }
253 return $result;
254 }
255
256
257 /**
258 * This function prints out the credits listing the PHP developers,
259 * modules, etc. It generates the appropriate HTML codes to insert
260 * the information in a page.
261 *
262 * @param int $flag To generate a custom credits page, you may want to use the
263 * flag parameter.
264 *
265 *
266 * Pre-defined phpcredits flags
267 *
268 *
269 *
270 * name
271 * description
272 *
273 *
274 *
275 *
276 * CREDITS_ALL
277 *
278 * All the credits, equivalent to using: CREDITS_DOCS +
279 * CREDITS_GENERAL + CREDITS_GROUP +
280 * CREDITS_MODULES + CREDITS_FULLPAGE.
281 * It generates a complete stand-alone HTML page with the appropriate tags.
282 *
283 *
284 *
285 * CREDITS_DOCS
286 * The credits for the documentation team
287 *
288 *
289 * CREDITS_FULLPAGE
290 *
291 * Usually used in combination with the other flags. Indicates
292 * that a complete stand-alone HTML page needs to be
293 * printed including the information indicated by the other
294 * flags.
295 *
296 *
297 *
298 * CREDITS_GENERAL
299 *
300 * General credits: Language design and concept, PHP authors
301 * and SAPI module.
302 *
303 *
304 *
305 * CREDITS_GROUP
306 * A list of the core developers
307 *
308 *
309 * CREDITS_MODULES
310 *
311 * A list of the extension modules for PHP, and their authors
312 *
313 *
314 *
315 * CREDITS_SAPI
316 *
317 * A list of the server API modules for PHP, and their authors
318 *
319 *
320 *
321 *
322 *
323 * @throws InfoException
324 *
325 */
326 function phpcredits(int $flag = CREDITS_ALL): void
327 {
328 error_clear_last();
329 $result = \phpcredits($flag);
330 if ($result === false) {
331 throw InfoException::createFromPhpError();
332 }
333 }
334
335
336 /**
337 * Outputs a large amount of information about the current state of PHP.
338 * This includes information about PHP compilation options and extensions,
339 * the PHP version, server information and environment (if compiled as a
340 * module), the PHP environment, OS version information, paths, master and
341 * local values of configuration options, HTTP headers, and the PHP License.
342 *
343 * Because every system is setup differently, phpinfo is
344 * commonly used to check configuration settings and for available
345 * predefined variables
346 * on a given system.
347 *
348 * phpinfo is also a valuable debugging tool as it
349 * contains all EGPCS (Environment, GET, POST, Cookie, Server) data.
350 *
351 * @param int $what The output may be customized by passing one or more of the
352 * following constants bitwise values summed
353 * together in the optional what parameter.
354 * One can also combine the respective constants or bitwise values
355 * together with the bitwise or operator.
356 *
357 *
358 * phpinfo options
359 *
360 *
361 *
362 * Name (constant)
363 * Value
364 * Description
365 *
366 *
367 *
368 *
369 * INFO_GENERAL
370 * 1
371 *
372 * The configuration line, php.ini location, build date, Web
373 * Server, System and more.
374 *
375 *
376 *
377 * INFO_CREDITS
378 * 2
379 *
380 * PHP Credits. See also phpcredits.
381 *
382 *
383 *
384 * INFO_CONFIGURATION
385 * 4
386 *
387 * Current Local and Master values for PHP directives. See
388 * also ini_get.
389 *
390 *
391 *
392 * INFO_MODULES
393 * 8
394 *
395 * Loaded modules and their respective settings. See also
396 * get_loaded_extensions.
397 *
398 *
399 *
400 * INFO_ENVIRONMENT
401 * 16
402 *
403 * Environment Variable information that's also available in
404 * $_ENV.
405 *
406 *
407 *
408 * INFO_VARIABLES
409 * 32
410 *
411 * Shows all
412 * predefined variables from EGPCS (Environment, GET,
413 * POST, Cookie, Server).
414 *
415 *
416 *
417 * INFO_LICENSE
418 * 64
419 *
420 * PHP License information. See also the license FAQ.
421 *
422 *
423 *
424 * INFO_ALL
425 * -1
426 *
427 * Shows all of the above.
428 *
429 *
430 *
431 *
432 *
433 * @throws InfoException
434 *
435 */
436 function phpinfo(int $what = INFO_ALL): void
437 {
438 error_clear_last();
439 $result = \phpinfo($what);
440 if ($result === false) {
441 throw InfoException::createFromPhpError();
442 }
443 }
444
445
446 /**
447 * Adds setting to the server environment. The
448 * environment variable will only exist for the duration of the current
449 * request. At the end of the request the environment is restored to its
450 * original state.
451 *
452 * @param string $setting The setting, like "FOO=BAR"
453 * @throws InfoException
454 *
455 */
456 function putenv(string $setting): void
457 {
458 error_clear_last();
459 $result = \putenv($setting);
460 if ($result === false) {
461 throw InfoException::createFromPhpError();
462 }
463 }
464
465
466 /**
467 * Sets the include_path
468 * configuration option for the duration of the script.
469 *
470 * @param string $new_include_path The new value for the include_path
471 * @return string Returns the old include_path on
472 * success.
473 * @throws InfoException
474 *
475 */
476 function set_include_path(string $new_include_path): string
477 {
478 error_clear_last();
479 $result = \set_include_path($new_include_path);
480 if ($result === false) {
481 throw InfoException::createFromPhpError();
482 }
483 return $result;
484 }
485
486
487 /**
488 * Set the number of seconds a script is allowed to run. If this is reached,
489 * the script returns a fatal error. The default limit is 30 seconds or, if
490 * it exists, the max_execution_time value defined in the
491 * php.ini.
492 *
493 * When called, set_time_limit restarts the timeout
494 * counter from zero. In other words, if the timeout is the default 30
495 * seconds, and 25 seconds into script execution a call such as
496 * set_time_limit(20) is made, the script will run for a
497 * total of 45 seconds before timing out.
498 *
499 * @param int $seconds The maximum execution time, in seconds. If set to zero, no time limit
500 * is imposed.
501 * @throws InfoException
502 *
503 */
504 function set_time_limit(int $seconds): void
505 {
506 error_clear_last();
507 $result = \set_time_limit($seconds);
508 if ($result === false) {
509 throw InfoException::createFromPhpError();
510 }
511 }
512