mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
141 lines
3.9 KiB
XML
141 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: cbac1ecf71d754707d69bdc344c4031c157eaa54 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="rarexception.setusingexceptions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>RarException::setUsingExceptions</refname>
|
|
<refpurpose>Active ou désactive les exceptions dans le gestionnaire d'erreurs</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <modifier>static</modifier> <type>void</type><methodname>RarException::setUsingExceptions</methodname>
|
|
<methodparam><type>bool</type><parameter>using_exceptions</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Si et seulement si l'argument vaut &true;, alors, au lieu d'émettre des alertes
|
|
et de retourner des valeurs spéciales indiquant une erreur lors que la
|
|
bibliothèque UnRAR rencontre une erreur, une exception de type
|
|
<type>RarException</type> est émise.
|
|
</para>
|
|
<para>
|
|
Les exceptions seront également lancées pour les erreurs suivantes,
|
|
qui surviennent en dehors de la bibliothèque (leurs codes erreurs seront -1) :
|
|
</para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
tentative d'une opération sur un objet <type>RarArchive</type> clos ou
|
|
un objet <type>RarEntry</type> relatif au premier ;
|
|
</simpara>
|
|
</listitem>
|
|
|
|
<listitem>
|
|
<simpara>
|
|
tentative de récupération d'une entrée qui n'existe pas avec la méthode
|
|
<methodname>RarArchive::getEntry</methodname>.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>using_exceptions</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Doit valoir &true; pour active l'émission d'exceptions, &false; pour le
|
|
désactiver (par défaut).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.void;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>RarException::setUsingExceptions</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
var_dump(RarException::isUsingExceptions());
|
|
$arch = RarArchive::open("does_not_exist.rar");
|
|
var_dump($arch);
|
|
|
|
RarException::setUsingExceptions(true);
|
|
var_dump(RarException::isUsingExceptions());
|
|
$arch = RarArchive::open("does_not_exist.rar");
|
|
var_dump($arch); //non atteint
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
bool(false)
|
|
|
|
Warning: RarArchive::open(): Failed to open does_not_exist.rar: ERAR_EOPEN (file open error) in C:\php_rar\trunk\tests\test.php on line 3
|
|
bool(false)
|
|
bool(true)
|
|
|
|
Fatal error: Uncaught exception 'RarException' with message 'unRAR internal error: Failed to open does_not_exist.rar: ERAR_EOPEN (file open error)' in C:\php_rar\trunk\tests\test.php:8
|
|
Stack trace:
|
|
#0 C:\php_rar\trunk\tests\test.php(8): RarArchive::open('does_not_exist....')
|
|
#1 {main}
|
|
thrown in C:\php_rar\trunk\tests\test.php on line 8
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><methodname>RarException::isUsingExceptions</methodname></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
|
|
-->
|