RarArchive
final class RarArchive implements Traversable (View source)
This class represents a RAR archive, which may be formed by several volumes (parts) and which contains a number of RAR entries (i.e., files, directories and other special objects such as symbolic links).
Objects of this class can be traversed, yielding the entries stored in the respective RAR archive. Those entries can also be obtained through {\RarArchive::getEntry} and {\RarArchive::getEntries}.
Methods
Open RAR archive
Close RAR archive and free all resources
Get comment text from the RAR archive
Get full list of entries from the RAR archive
Test whether an archive is broken (incomplete)
Check whether the RAR archive is solid
Whether opening broken archives is allowed
Get text representation
Details
static RarArchive|false
open(string $filename, null|string $password = null, callable|null $volume_callback = null)
Open RAR archive
bool
close()
Close RAR archive and free all resources
string|null
getComment()
Get comment text from the RAR archive
RarEntry[]|false
getEntries()
Get full list of entries from the RAR archive
RarEntry|false
getEntry(string $entryname)
Get entry object from the RAR archive
Get entry object (file or directory) from the RAR archive
bool
isBroken()
Test whether an archive is broken (incomplete)
This function determines whether an archive is incomplete, i.e., if a volume is missing or a volume is truncated.
bool
isSolid()
Check whether the RAR archive is solid
Check whether the RAR archive is solid. Individual file extraction is slower on solid archives
bool
setAllowBroken(bool $allow_broken)
Whether opening broken archives is allowed
This method defines whether broken archives can be read or all the operations that attempt to extract the archive entries will fail. Broken archives are archives for which no error is detected when the file is opened but an error occurs when reading the entries.
string
__toString()
Get text representation
Provides a string representation for this RarArchive object. It currently shows the full path name of the archive volume that was opened and whether the resource is valid or was already closed through a call to {[\RarArchive::close()}.
This](RarArchive.html) method may be used only for debugging purposes, as there are no guarantees as to which information the result contains or how it is formatted.