reference/funchand/functions/register-shutdown-function.xml
b412bbd26214f7281ac7dd858710e09952a275f2
...
...
@@ -9,7 +9,7 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type class="union"><type>bool</type><type>null</type></type><methodname>register_shutdown_function</methodname>
12
+
<type>void</type><methodname>register_shutdown_function</methodname>
13
13
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
14
14
<methodparam rep="repeat"><type>mixed</type><parameter>args</parameter></methodparam>
15
15
</methodsynopsis>
...
...
@@ -24,6 +24,10 @@
24
24
function, processing will stop completely and no other registered
25
25
shutdown functions will be called.
26
26
</para>
27
+
<para>
28
+
Shutdown functions may also call <function>register_shutdown_function</function>
29
+
themselves to add a shutdown function to the end of the queue.
30
+
</para>
27
31
</refsect1>
28
32

29
33
<refsect1 role="parameters">
...
...
@@ -62,14 +66,6 @@
62
66
</para>
63
67
</refsect1>
64
68

65
-
<refsect1 role="errors">
66
-
&reftitle.errors;
67
-
<para>
68
-
If the passed callback is not callable a <constant>E_WARNING</constant>
69
-
level error will be generated.
70
-
</para>
71
-
</refsect1>
72
-

73
69
<refsect1 role="examples">
74
70
&reftitle.examples;
75
71
<para>
...
...
@@ -99,7 +95,7 @@ register_shutdown_function('shutdown');
99
95
&reftitle.notes;
100
96
<note>
101
97
<para>
102
-
Working directory of the script can change inside the shutdown function
98
+
The working directory of the script can change inside the shutdown function
103
99
under some web servers, e.g. Apache.
104
100
</para>
105
101
</note>
...
...
@@ -111,6 +107,15 @@ register_shutdown_function('shutdown');
111
107
end cleanly.
112
108
</para>
113
109
</note>
110
+
<note>
111
+
<para>
112
+
Shutdown functions run separately from the time tracked by
113
+
<link linkend="ini.max-execution-time">max_execution_time</link>. That means
114
+
even if a process is terminated for running too long, shutdown functions will still be
115
+
called. Additionally, if the <literal>max_execution_time</literal> runs out while
116
+
a shutdown function is running it will not be terminated.
117
+
</para>
118
+
</note>
114
119
</refsect1>
115
120

116
121
<refsect1 role="seealso">
...
...
@@ -119,6 +124,7 @@ register_shutdown_function('shutdown');
119
124
<simplelist>
120
125
<member><link linkend="ini.auto-append-file">auto_append_file</link></member>
121
126
<member><function>exit</function></member>
127
+
<member><function>fastcgi_finish_request</function></member>
122
128
<member>The section on <link linkend="features.connection-handling">connection handling</link></member>
123
129
</simplelist>
124
130
</para>
125
131