Archive
in package
Class for creating archives in various formats - zip, tar.bz2, etc
Table of Contents
Properties
Methods
- __construct() : void
- Loads the archive driver.
- add() : object
- Adds files or directories, recursively, to an archive.
- create() : string|bool
- Creates a raw archive file and returns it.
- save() : bool
- Creates an archive and saves it into a file.
Properties
$driver
protected
mixed
$driver
$paths
protected
mixed
$paths
= []
Methods
__construct()
Loads the archive driver.
public
__construct([string|null $type = null ]) : void
Parameters
- $type : string|null = null
-
Type of archive to create
Tags
add()
Adds files or directories, recursively, to an archive.
public
add(string $path[, string|null $name = null ][, bool|null $recursive = null ]) : object
Parameters
- $path : string
-
File or directory to add
- $name : string|null = null
-
Name to use for the given file or directory
- $recursive : bool|null = null
-
Add files recursively, used with directories
Return values
objectcreate()
Creates a raw archive file and returns it.
public
create() : string|bool
Return values
string|boolsave()
Creates an archive and saves it into a file.
public
save(string $filename) : bool
Parameters
- $filename : string
-
Archive filename