Files
archived-doc-pt-br/reference/libxml/functions/libxml-use-internal-errors.xml
Leonardo Lara Rodrigues 9f933eab04 Updates to abandoned/outdated/missing pages and other corrections (#368)
* Corrections to many issues found by QA scripts, as well as alignment of line numbers between en and pt_br xml files

* Update to abandoned/outdated/missing pages in reference/filesystem/

* Correction to parameter 'filename'

* Updates to abandoned/outdated/missing pages in reference/var/

* Updates to match recent revision in `en` pages

* update to migration83/other-changes.xml according to last english revision

* update to language/types/float.xml according to last `en` version

* update to reference/calendar/constants.xml according to last `en`version

---------

Co-authored-by: LEONARDO LARA RODRIGUES <leonardolara@github.com>
2023-11-28 13:15:44 -03:00

139 lines
3.5 KiB
XML
Executable File

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: f90df97fa5ebfa6e7fcace04976900d6700467cc Maintainer: adiel Status: ready --><!-- CREDITS: adiel,felipe -->
<refentry xml:id="function.libxml-use-internal-errors" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>libxml_use_internal_errors</refname>
<refpurpose>
Desabilita erros da libxml e permite que o usuário obtenha informações de erro conforme necessário
</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>
A função <function>libxml_use_internal_errors</function> permite desabilitar
os erros padrão da libxml e habilitar o tratamento de erros do usuário.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>use_errors</parameter></term>
<listitem>
<para>
Habilita (&true;) ou desabilita (&false;) o tratamento de erros do usuário. Desabilitar também limpará quaisquer erros libxml existentes.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Esta função retorna o valor anterior de
<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>
O parâmetro <parameter>use_errors</parameter> agora pode ser nulo.
Anteriormente, o padrão era &false;.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemplo de <function>libxml_use_internal_errors</function></title>
<para>
Este exemplo demonstra o uso básico dos erros da libxml e o valor retornado
por esta função.
</para>
<programlisting role="php">
<![CDATA[
<?php
// habilita o tratamento de erros do usuário
var_dump(libxml_use_internal_errors(true));
// carrega o documento
$doc = new DOMDocument;
if (!$doc->load('arquivo.xml')) {
foreach (libxml_get_errors() as $erro) {
// trata os erros aqui
}
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
-->