Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rararchive.setallowbroken(3) [php man page]

RARARCHIVE.SETALLOWBROKEN(3)						 1					      RARARCHIVE.SETALLOWBROKEN(3)

RarArchive::setAllowBroken - Whether opening broken archives is allowed

       Object oriented style (method):

SYNOPSIS
public bool RarArchive::setAllowBroken (bool $allow_broken) DESCRIPTION
Procedural style: bool rar_allow_broken_set (RarArchive $rarfile, bool $allow_broken) This method defines whether broken archives can be read or all the operations that attempt to extract the archive entries will fail. Bro- ken archives are archives for which no error is detected when the file is opened but an error occurs when reading the entries. PARAMETERS
o $rarfile - A RarArchive object, opened with rar_open(3). o $allow_broken - Whether to allow reading broken files ( TRUE) or not ( FALSE). RETURN VALUES
Returns TRUE or FALSE on failure. It will only fail if the file has already been closed. EXAMPLES
Example #1 Object oriented style <?php function retnull() { return null; } $file = dirname(__FILE__) . "/multi_broken.part1.rar"; /* Third argument omits "volume not found" message */ $a = RarArchive::open($file, null, 'retnull'); $a->setAllowBroken(true); foreach ($a->getEntries() as $e) { echo "$e "; } var_dump(count($a)); ?> The above example will output something similar to: RarEntry for file "file1.txt" (52b28202) int(1) Example #2 Procedural style <?php function retnull() { return null; } $file = dirname(__FILE__) . "/multi_broken.part1.rar"; /* Third argument omits "volume not found" message */ $a = rar_open($file, null, 'retnull'); rar_allow_broken_set($a, true); foreach (rar_list($a) as $e) { echo "$e "; } var_dump(count($a)); ?> SEE ALSO
RarArchive::isBroken. PHP Documentation Group RARARCHIVE.SETALLOWBROKEN(3)

Check Out this Related Man Page

RAR_LIST(3)								 1							       RAR_LIST(3)

RarArchive::getEntries - Get full list of entries from the RAR archive

       Object oriented style (method):

SYNOPSIS
public array RarArchive::getEntries (void ) DESCRIPTION
Procedural style: array rar_list (RarArchive $rarfile) Get entries list (files and directories) from the RAR archive. Note If the archive has entries with the same name, this method, together with RarArchive foreach iteration and array-like access with numeric indexes, are the only ones to access all the entries (i.e., RarArchive::getEntry and the rar:// wrapper are insufficient). PARAMETERS
o $rarfile - A RarArchive object, opened with rar_open(3). RETURN VALUES
rar_list(3) returns array of RarEntry objects or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 3.0.0 | | | | | | | Support for RAR archives with repeated entry | | | names is no longer defective. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 Object oriented style <?php $rar_arch = RarArchive::open('solid.rar'); if ($rar_arch === FALSE) die("Could not open RAR archive."); $rar_entries = $rar_arch->getEntries(); if ($rar_entries === FALSE) die("Could retrieve entries."); echo "Found " . count($rar_entries) . " entries. "; foreach ($rar_entries as $e) { echo $e; echo " "; } $rar_arch->close(); ?> The above example will output something similar to: Found 2 entries. RarEntry for file "tese.txt" (23b93a7a) RarEntry for file "unrardll.txt" (2ed64b6e) Example #2 Procedural style <?php $rar_arch = rar_open('solid.rar'); if ($rar_arch === FALSE) die("Could not open RAR archive."); $rar_entries = rar_list($rar_arch); if ($rar_entries === FALSE) die("Could retrieve entries."); echo "Found " . count($rar_entries) . " entries. "; foreach ($rar_entries as $e) { echo $e; echo " "; } rar_close($rar_arch); ?> SEE ALSO
RarArchive::getEntry, rar:// wrapper. PHP Documentation Group RAR_LIST(3)
Man Page