reference/errorfunc/functions/error-log.xml
769812c12f00c1978bf7dd711dca38dbf05462da
...
...
@@ -3,7 +3,7 @@
3
3
<refentry xml:id="function.error-log" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>error_log</refname>
6
-
<refpurpose>Send an error message somewhere</refpurpose>
6
+
<refpurpose>Send an error message to the defined error handling routines</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
...
...
@@ -12,8 +12,8 @@
12
12
<type>bool</type><methodname>error_log</methodname>
13
13
<methodparam><type>string</type><parameter>message</parameter></methodparam>
14
14
<methodparam choice="opt"><type>int</type><parameter>message_type</parameter><initializer>0</initializer></methodparam>
15
-
<methodparam choice="opt"><type>string</type><parameter>destination</parameter></methodparam>
16
-
<methodparam choice="opt"><type>string</type><parameter>extra_headers</parameter></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>destination</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>additional_headers</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
Sends an error message to the web server's error log or to a file.
...
...
@@ -59,7 +59,7 @@
59
59
<parameter>message</parameter> is sent by email to the address in
60
60
the <parameter>destination</parameter> parameter. This is the only
61
61
message type where the fourth parameter,
62
-
<parameter>extra_headers</parameter> is used.
62
+
<parameter>additional_headers</parameter> is used.
63
63
</entry>
64
64
</row>
65
65
<row>
...
...
@@ -99,7 +99,7 @@
99
99
</listitem>
100
100
</varlistentry>
101
101
<varlistentry>
102
-
<term><parameter>extra_headers</parameter></term>
102
+
<term><parameter>additional_headers</parameter></term>
103
103
<listitem>
104
104
<para>
105
105
The extra headers. It's used when the <parameter>message_type</parameter>
...
...
@@ -117,31 +117,32 @@
117
117
&reftitle.returnvalues;
118
118
<para>
119
119
&return.success;
120
+
If <parameter>message_type</parameter> is zero, this function always returns &true;,
121
+
regardless of whether the error could be logged or not.
120
122
</para>
121
123
</refsect1>
122
124

123
125
<refsect1 role="changelog">
124
126
&reftitle.changelog;
125
-
<para>
126
-
<informaltable>
127
-
<tgroup cols="2">
128
-
<thead>
129
-
<row>
130
-
<entry>&Version;</entry>
131
-
<entry>&Description;</entry>
132
-
</row>
133
-
</thead>
134
-
<tbody>
127
+
<informaltable>
128
+
<tgroup cols="2">
129
+
<thead>
135
130
<row>
136
-
<entry>5.2.7</entry>
137
-
<entry>
138
-
The possible value of 4 was added to <parameter>message_type</parameter>.
139
-
</entry>
140
-
</row>
141
-
</tbody>
142
-
</tgroup>
143
-
</informaltable>
144
-
</para>
131
+
<entry>&Version;</entry>
132
+
<entry>&Description;</entry>
133
+
</row>
134
+
</thead>
135
+
<tbody>
136
+
<row>
137
+
<entry>8.0.0</entry>
138
+
<entry>
139
+
<parameter>destination</parameter> and
140
+
<parameter>additional_headers</parameter> are now nullable.
141
+
</entry>
142
+
</row>
143
+
</tbody>
144
+
</tgroup>
145
+
</informaltable>
145
146
</refsect1>
146
147

147
148
<refsect1 role="examples">
...
...
@@ -172,8 +173,22 @@ error_log("You messed up!", 3, "/var/tmp/my-errors.log");
172
173
</example>
173
174
</para>
174
175
</refsect1>
175
-
</refentry>
176
176

177
+
<refsect1 role="notes">
178
+
&reftitle.notes;
179
+
<warning>
180
+
<simpara>
181
+
<function>error_log</function> is not binary safe. <parameter>message</parameter> will be truncated by null character.
182
+
</simpara>
183
+
</warning>
184
+
<tip>
185
+
<simpara>
186
+
<parameter>message</parameter> should not contain null character. Note that <parameter>message</parameter> may be sent to file, mail, syslog, etc. Use appropriate conversion/escape function, <function>base64_encode</function>, <function>rawurlencode</function> or <function>addslashes</function> before calling <function>error_log</function>.
187
+
</simpara>
188
+
</tip>
189
+
</refsect1>
190
+

191
+
</refentry>
177
192
<!-- Keep this comment at the end of the file
178
193
Local variables:
179
194
mode: sgml
180
195