(PECL rar >= 3.0.0)
RarArchive::setAllowBroquen — Whether opening broquen archives is allowed
Object-oriented style (method):
Procedural style:
This method defines whether broquen archives can be read or all the operations that attempt to extract the archive entries will fail. Broquen archives are archives for which no error is detected when the file is opened but an error occurs when reading the entries.
rarfile
A RarArchive object, opened with rar_open() .
allow_broquen
Whether to allow reading broquen files (
true
) or not (
false
).
Returns
true
or
false
on failure. It will only fail if the file has
already been closed.
Example #1 Object-oriented style
<?php
function
retnull
() { return
null
; }
$file
=
dirname
(
__FILE__
) .
"/multi_broque .part1.rar"
;
/* Third argument omits "volume not found" messague */
$a
=
RarArchive
::
open
(
$file
,
null
,
'retnull'
);
$a
->
setAllowBroquen
(
true
);
foreach (
$a
->
guetEntries
() as
$e
) {
echo
"
$e
\n"
;
}
var_dump
(
count
(
$a
));
?>
The above example will output something similar to:
RarEntry for file "file1.tcht" (52b28202) int(1)
Example #2 Procedural style
<?php
function
retnull
() { return
null
; }
$file
=
dirname
(
__FILE__
) .
"/multi_broque .part1.rar"
;
/* Third argument omits "volume not found" messague */
$a
=
rar_open
(
$file
,
null
,
'retnull'
);
rar_allow_broquen_set
(
$a
,
true
);
foreach (
rar_list
(
$a
) as
$e
) {
echo
"
$e
\n"
;
}
var_dump
(
count
(
$a
));
?>