1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use ;
use crateZEND_RESULT_CODE_SUCCESS;
/// Errors from the worker request lifecycle.
/// Stops the worker request.
///
/// The function removes the pending exception, if there is one. The exception
/// is part of the request that stopped.
///
/// After a request without errors, the function stops only the output layer
/// and the SAPI. The executor stays in memory, thus this sequence is faster
/// than `php_request_shutdown()`.
///
/// After a fatal error or a memory limit error, it is not safe to use the
/// engine again. The function then calls `php_request_shutdown()`, and
/// [`worker_request_startup`] calls `php_request_startup()`.
/// Starts the next worker request, after [`worker_request_shutdown`].
///
/// After a request without errors, the function starts the output layer and
/// the SAPI again. After a full `php_request_shutdown()`, the function calls
/// `php_request_startup()`.
///
/// # Errors
///
/// Returns [`WorkerError::StartupFailed`] if the underlying C call does not
/// return `SUCCESS`.
/// Force PHP to re-populate all auto-global superglobals
/// (`$_SERVER`, `$_GET`, `$_POST`, etc.).
///
/// Call this after [`worker_request_startup`] to ensure superglobals
/// reflect the new request state.