From c686b9be32b2ac888000d5b129defce89beb186f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Andr=C3=A9=20dos=20Santos=20Lopes?= Date: Thu, 24 Dec 2009 20:26:33 +0000 Subject: [PATCH] Updated RAR extension documentation. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@292613 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/rar/book.xml | 1 + reference/rar/rararchive/issolid.xml | 114 ++++++++++ reference/rar/rarexception.xml | 207 ++++++++++++++++++ .../rar/rarexception/isusingexceptions.xml | 89 ++++++++ .../rar/rarexception/setusingexceptions.xml | 124 +++++++++++ reference/rar/versions.xml | 16 ++ 6 files changed, 551 insertions(+) create mode 100644 reference/rar/rararchive/issolid.xml create mode 100644 reference/rar/rarexception.xml create mode 100644 reference/rar/rarexception/isusingexceptions.xml create mode 100644 reference/rar/rarexception/setusingexceptions.xml diff --git a/reference/rar/book.xml b/reference/rar/book.xml index fa79b71e50..9ebb82a433 100644 --- a/reference/rar/book.xml +++ b/reference/rar/book.xml @@ -28,6 +28,7 @@ &reference.rar.examples; &reference.rar.rararchive; &reference.rar.rarentry; + &reference.rar.rarexception; diff --git a/reference/rar/rararchive/issolid.xml b/reference/rar/rararchive/issolid.xml new file mode 100644 index 0000000000..ad3b80f058 --- /dev/null +++ b/reference/rar/rararchive/issolid.xml @@ -0,0 +1,114 @@ + + + + + + RarArchive::isSolid + rar_solid_is + Check whether the RAR archive is solid. + + + + &reftitle.description; + Object oriented style (method): + + public boolRarArchive::isSolid + + + Procedural style: + + boolrar_solid_is + RarArchiverarfile + + + Check whether the RAR archive is solid. Individual file extraction is slower on solid + archives. + + + + + &reftitle.parameters; + + + + rarfile + + + A RarArchive object, opened with rar_open. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the archive is solid, &false; otherwise. + + + + + &reftitle.examples; + + + Object oriented style + +isSolid()?'yes':'no') ."\n"; +echo "$arch2: " . ($arch2->isSolid()?'yes':'no') . "\n"; +?> +]]> + + &example.outputs.similar; + + + + + + + + Procedural style + + +]]> + + + + + + + + diff --git a/reference/rar/rarexception.xml b/reference/rar/rarexception.xml new file mode 100644 index 0000000000..b207adcb09 --- /dev/null +++ b/reference/rar/rarexception.xml @@ -0,0 +1,207 @@ + + + + + + The RarException class + RarException + + + + +
+ &reftitle.intro; + + This class serves two purposes: it is the type of the exceptions thrown by the RAR extension + functions and methods and it allows, through static methods to query and define the error + behaviour of the extension, i.e., whether exceptions are thrown or only warnings are emitted. + + + The following error codes are used: + + + + + -1 - error outside UnRAR library + + + + + 11 - insufficient memory + + + + + + 12 - bad data + + + + + + 13 - bad archive + + + + + + 14 - unknown format + + + + + + 15 - file open error + + + + + + 16 - file create error + + + + + + 17 - file close error + + + + + + 18 - read error + + + + + 19 - write error + + + + + + 20 - buffer too small + + + + + + 21 - unkown RAR error + + + + + + 22 - password required but not given + + + +
+ + +
+ &reftitle.classsynopsis; + + + + RarException + + + + + final + RarException + + + + extends + Exception + + + + Properties + + private + static + usingExceptions + + + + Methods + + + Inherited methods + + + + + +
+ + + +
+ &reftitle.properties; + + + message + + Not part of the contract. Use RarException::getMessage. + + + + code + + Not part of the contract. Use RarException::getCode. + + + + file + + Not part of the contract. Use RarException::getFile. + + + + line + + Not part of the contract. Use RarException::getLine. + + + + usingExceptions + + Not part of the contract. + Use RarException::isUsingExceptions and RarException::setUsingExceptions. + + + +
+ + + +
+ + &reference.rar.entities.rarexception; + +
+ + diff --git a/reference/rar/rarexception/isusingexceptions.xml b/reference/rar/rarexception/isusingexceptions.xml new file mode 100644 index 0000000000..c339667fa5 --- /dev/null +++ b/reference/rar/rarexception/isusingexceptions.xml @@ -0,0 +1,89 @@ + + + + + + RarException::isUsingExceptions + Check whether error handling with exceptions is in use + + + + &reftitle.description; + + public static boolRarException::isUsingExceptions + + + + Checks whether the RAR functions will emit warnings and return error values or whether they + will throw exceptions in most of the circumstances (does not include some programmatic + errors such as passing the wrong type of arguments). + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns &true; if exceptions are being used, &false; otherwise. + + + + + &reftitle.examples; + + + <function>RarException::isUsingExceptions</function> example + + +]]> + + &example.outputs.similar; + + + + + + + + + + &reftitle.seealso; + + + RarException::setUsingExceptions + + + + + + + diff --git a/reference/rar/rarexception/setusingexceptions.xml b/reference/rar/rarexception/setusingexceptions.xml new file mode 100644 index 0000000000..c3e8d3542d --- /dev/null +++ b/reference/rar/rarexception/setusingexceptions.xml @@ -0,0 +1,124 @@ + + + + + + RarException::setUsingExceptions + Activate and deactivate error handling with exceptions + + + + &reftitle.description; + + public static voidRarException::setUsingExceptions + stringusing_exceptions + + + If and only if the argument is &true;, then, instead of emitting warnings and returning a special value indicating error when the UnRAR library encounters an error, an exception of type RarExzception will be thrown. + + + Exceptions will also be thrown for the following errors, which occur outside the library (their error code will be -1): + + + + + attempting some operations on a closed RarArchive object or a RarEntry object relative to the first; + + + + + + attempting to get an entry that does not exist with RarArchive::getEntry. + + + + + + + + &reftitle.parameters; + + + + using_exceptions + + + Should be &true; to activate exception throwing, &false; to deactivate (the default). + + + + + + + + + &reftitle.examples; + + + <function>RarException::setUsingExceptions</function> example + + +]]> + + &example.outputs.similar; + + + + + + + + + + &reftitle.seealso; + + + RarException::isUsingExceptions + + + + + + + diff --git a/reference/rar/versions.xml b/reference/rar/versions.xml index 42e99d10d8..3bfffba53e 100644 --- a/reference/rar/versions.xml +++ b/reference/rar/versions.xml @@ -9,15 +9,18 @@ + + + @@ -32,6 +35,19 @@ + + + + + + + + + + + + +