Files
php-doc-ru/reference/libxml/functions/libxml-use-internal-errors.xml
Alexey Pyltsyn b21887f9c3 Yofication
2021-01-03 21:07:35 +03:00

142 lines
4.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: f90df97fa5ebfa6e7fcace04976900d6700467cc Maintainer: tmn Status: ready -->
<!-- Reviewed: yes Maintainer: lex -->
<!-- $Revision$ -->
<refentry xml:id="function.libxml-use-internal-errors" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>libxml_use_internal_errors</refname>
<refpurpose>
Отключение ошибок libxml и передача полномочий по выборке и обработке
информации об ошибках пользователю
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>libxml_use_internal_errors</methodname>
<methodparam choice="opt"><type class="union"><type>bool</type><type>null</type></type><parameter>use_errors</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
<function>libxml_use_internal_errors</function> позволяет отключить
стандартные ошибки libxml и включить пользовательскую обработку ошибок.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>use_errors</parameter></term>
<listitem>
<para>
Включает (&true;) пользовательскую обработку ошибок или отключает её (&false;). Отключение также очищает все текущие ошибки libxml.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Эта функция возвращает предыдущее значение параметра
<parameter>use_errors</parameter>.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
<parameter>use_errors</parameter> теперь допускает значение null.
Ранее значением по умолчанию было &false;.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Пример использования <function>libxml_use_internal_errors</function></title>
<para>
Этот пример демонстрирует основное использование ошибок libxml и значение,
которое возвращает эта функция.
</para>
<programlisting role="php">
<![CDATA[
<?php
// включение обработки ошибок пользователем
var_dump(libxml_use_internal_errors(true));
// загрузка документа
$doc = new DOMDocument;
if (!$doc->load('file.xml')) {
foreach (libxml_get_errors() as $error) {
// обработка ошибок здесь
}
libxml_clear_errors();
}
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(false)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>libxml_clear_errors</function></member>
<member><function>libxml_get_errors</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->