Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errorfunc sync with EN #1777

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions reference/errorfunc/functions/trigger-error.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 210d382b5b139444fe2e16a5a3211076a65ff2ba Maintainer: yannick Status: ready -->
<!-- EN-Revision: 72b70d7c3c3b2b87423641906da2db407c32c3c3 Maintainer: yannick Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.trigger-error" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -50,6 +50,14 @@
la famille de constantes <constant>E_USER_<replaceable>*</replaceable></constant>
et sera par défaut <constant>E_USER_NOTICE</constant>.
</para>
<warning>
<simpara>
Passer <constant>E_USER_ERROR</constant> comme
<parameter>error_level</parameter> est désormais obsolète.
Lancez une <exceptionname>Exception</exceptionname> ou
appelez <function>exit</function> à la place.
</simpara>
</warning>
</listitem>
</varlistentry>
</variablelist>
Expand Down Expand Up @@ -84,6 +92,22 @@
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Passer <constant>E_USER_ERROR</constant> comme
<parameter>error_level</parameter> est désormais obsolète.
Lancez une <exceptionname>Exception</exceptionname> ou
appelez <function>exit</function> à la place.
</entry>
</row>
<row>
<entry>8.4.0</entry>
<entry>
La fonction a désormais un type de retour <type>true</type>
au lieu de <type>bool</type>.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand All @@ -107,9 +131,11 @@
<programlisting role="php">
<![CDATA[
<?php
if ($divisor == 0) {
trigger_error("Impossible de diviser par zéro", E_USER_ERROR);
$password = $_POST['password'] ?? '';
if ($password === '') {
trigger_error("Using an empty password is unsafe", E_USER_WARNING);
}
$hash = password_hash($password, PASSWORD_DEFAULT);
?>
]]>
</programlisting>
Expand All @@ -136,6 +162,7 @@ if ($divisor == 0) {
<member><function>set_error_handler</function></member>
<member><function>restore_error_handler</function></member>
<member>Les <link linkend="errorfunc.constants">constantes de niveau d'erreur</link></member>
<member>L’attribut <classname>Deprecated</classname></member>
</simplelist>
</para>
</refsect1>
Expand Down