reference/funchand/functions/register-shutdown-function.xml
b412bbd26214f7281ac7dd858710e09952a275f2
...
...
@@ -11,8 +11,7 @@
11
11
<methodsynopsis>
12
12
<type>void</type><methodname>register_shutdown_function</methodname>
13
13
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
14
-
<methodparam choice="opt"><type>mixed</type><parameter>parameter</parameter></methodparam>
15
-
<methodparam choice="opt"><type>mixed</type><parameter>...</parameter></methodparam>
14
+
<methodparam rep="repeat"><type>mixed</type><parameter>args</parameter></methodparam>
16
15
</methodsynopsis>
17
16
<para>
18
17
Registers a <parameter>callback</parameter> to be executed after script
...
...
@@ -25,6 +24,10 @@
25
24
function, processing will stop completely and no other registered
26
25
shutdown functions will be called.
27
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>
28
31
</refsect1>
29
32

30
33
<refsect1 role="parameters">
...
...
@@ -44,7 +47,7 @@
44
47
</listitem>
45
48
</varlistentry>
46
49
<varlistentry>
47
-
<term><parameter>parameter</parameter></term>
50
+
<term><parameter>args</parameter></term>
48
51
<listitem>
49
52
<para>
50
53
It is possible to pass parameters to the shutdown function by passing
...
...
@@ -52,13 +55,6 @@
52
55
</para>
53
56
</listitem>
54
57
</varlistentry>
55
-
<varlistentry>
56
-
<term><parameter>...</parameter></term>
57
-
<listitem>
58
-
<para>
59
-
</para>
60
-
</listitem>
61
-
</varlistentry>
62
58
</variablelist>
63
59
</para>
64
60
</refsect1>
...
...
@@ -70,14 +66,6 @@
70
66
</para>
71
67
</refsect1>
72
68

73
-
<refsect1 role="errors">
74
-
&reftitle.errors;
75
-
<para>
76
-
If the passed callback is not callable a <constant>E_WARNING</constant>
77
-
level error will be generated.
78
-
</para>
79
-
</refsect1>
80
-

81
69
<refsect1 role="examples">
82
70
&reftitle.examples;
83
71
<para>
...
...
@@ -107,7 +95,7 @@ register_shutdown_function('shutdown');
107
95
&reftitle.notes;
108
96
<note>
109
97
<para>
110
-
Working directory of the script can change inside the shutdown function
98
+
The working directory of the script can change inside the shutdown function
111
99
under some web servers, e.g. Apache.
112
100
</para>
113
101
</note>
...
...
@@ -119,6 +107,15 @@ register_shutdown_function('shutdown');
119
107
end cleanly.
120
108
</para>
121
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>
122
119
</refsect1>
123
120

124
121
<refsect1 role="seealso">
...
...
@@ -127,14 +124,13 @@ register_shutdown_function('shutdown');
127
124
<simplelist>
128
125
<member><link linkend="ini.auto-append-file">auto_append_file</link></member>
129
126
<member><function>exit</function></member>
130
-
<member>The section on <link
131
-
linkend="features.connection-handling">connection handling</link></member>
127
+
<member><function>fastcgi_finish_request</function></member>
128
+
<member>The section on <link linkend="features.connection-handling">connection handling</link></member>
132
129
</simplelist>
133
130
</para>
134
131
</refsect1>
135
132

136
133
</refentry>
137
-

138
134
<!-- Keep this comment at the end of the file
139
135
Local variables:
140
136
mode: sgml
141
137