Download the PHP package dmamontov/rararchiver without Composer
On this page you can find all versions of the php package dmamontov/rararchiver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rararchiver
In the process version 2.0.
RarArchiver
Class for working with archives RAR. It allows you to add files to the directory, as well as extract, delete, rename, and get content.
Requirements
- PHP version ~5.5.11
Installation
1) Install composer
2) Follow in the project folder:
In config composer.json
your project will be added to the library dmamontov/rararchiver
, who settled in the folder vendor/
. In the absence of a config file or folder with vendors they will be created.
If before your project is not used composer
, connect the startup file vendors. To do this, enter the code in the project:
Available methods
RarArchiver::__construct
Description
It creates or opens a file and initializes it.
Parameters
file
- The path to archive.flag
- An optional parameter.RarArchiver::CREATE
- It creates the archive if it is not found.RarArchiver::REPLACE
- Overwrites the archive if it is found, otherwise create it.
Examples
RarArchiver::isRar
Description
Checks whether the file archive RAR.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::getFileList
Description
Gets a list of files in the archive.
Return Values
Returns the filled array on success, or an empty array on failure.
Examples
RarArchiver::addEmptyDir
Description
Adds an empty directory in the archive.
Parameters
dirname
- The directory to add.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::addFile
Description
Adds a file to a RAR archive from a given path.
Parameters
filename
- The path to the file to add.localname
- If supplied, this is the local name inside the RAR archive that will override thefilename
.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::addFromString
Description
Add a file to a RAR archive using its contents.
Parameters
localname
- The name of the entry to create.contents
- The contents to use to create the entry.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::buildFromDirectory
Description
Populate a RAR archive from directory contents. The optional second parameter is a regular expression (pcre) that is used to exclude files.
Parameters
path
- The full or relative path to the directory that contains all files to add to the archive.regex
- An optional pcre regular expression that is used to filter the list of files. Only file paths matching the regular expression will be included in the archive.
Examples
RarArchiver::deleteIndex
Description
Delete an entry in the archive using its index.
Parameters
index
- Index of the entry to delete.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::deleteName
Description
Delete an entry in the archive using its name.
Parameters
name
- Name of the entry to delete.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::getFromIndex
Description
Returns the entry contents using its index.
Parameters
index
- Index of the entry.length
- The length to be read from the entry. If 0, then the entire entry is read.
Return Values
Returns the contents of the entry on success or FALSE on failure.
Examples
RarArchiver::getFromName
Description
Returns the entry contents using its name.
Parameters
name
- Name of the entry.length
- The length to be read from the entry. If 0, then the entire entry is read.
Return Values
Returns the contents of the entry on success or FALSE on failure.
Examples
RarArchiver::getNameIndex
Description
Returns the name of an entry using its index.
Parameters
index
- Index of the entry.
Return Values
Returns the name on success or FALSE on failure.
Examples
RarArchiver::renameIndex
Description
Renames an entry defined by its index.
Parameters
index
- Index of the entry to rename.newname
- New name.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::renameName
Description
Renames an entry defined by its name.
Parameters
name
- Name of the entry to rename.newname
- New name.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
RarArchiver::extractTo
Description
Extract the complete archive or the given files to the specified destination.
Parameters
destination
- Location where to extract the files.entries
- The entries to extract. It accepts either a single entry name or an array of names.
Return Values
Returns TRUE on success or FALSE on failure.