ArchiveZipCreate
in package
Table of Contents
Properties
Methods
- addDirectory() : self
- Add a full directory to the archive, including subdirectories.
- addFile() : self
- Add a new file to the archive from existing file.
- addFromString() : self
- Add a new file to the archive from string.
- getCount() : int
- getFileItems() : array<string|int, ArchiveFile>
- getName() : string
- getPath() : string
- make() : self
- Create a new instance of ArchiveZipCreate, allowing extensions are `zip`, `epub`, `cbz`.
- save() : bool
- Save the archive.
- __construct() : mixed
- directoryToPaths() : array<string|int, mixed>
- pathsToSplFiles() : array<string|int, SplFileInfo>
Properties
$count
protected
int
$count
= 0
$files
protected
array<string|int, mixed>
$files
= []
$name
protected
string
$name
$path
protected
string
$path
Methods
addDirectory()
Add a full directory to the archive, including subdirectories.
public
addDirectory(string $relativeTo, string $path) : self
Parameters
- $relativeTo : string
-
Relative path to the directory inside the archive
- $path : string
-
Path to the directory to add
$archive->addDirectory('./to/directory', '/path/to/directory');
Return values
selfaddFile()
Add a new file to the archive from existing file.
public
addFile(string $outputPath, string $pathToFile) : self
Parameters
- $outputPath : string
-
Path to the file inside the archive
- $pathToFile : string
-
Path to the file to add
Return values
selfaddFromString()
Add a new file to the archive from string.
public
addFromString(string $outputPath, string $content) : self
Parameters
- $outputPath : string
-
Path to the file inside the archive
- $content : string
-
Content of the file to add
Return values
selfgetCount()
public
getCount() : int
Return values
intgetFileItems()
public
getFileItems() : array<string|int, ArchiveFile>
Return values
array<string|int, ArchiveFile>getName()
public
getName() : string
Return values
stringgetPath()
public
getPath() : string
Return values
stringmake()
Create a new instance of ArchiveZipCreate, allowing extensions are `zip`, `epub`, `cbz`.
public
static make(string $path[, bool $skipAllowed = false ]) : self
Parameters
- $path : string
-
Path to the archive
- $skipAllowed : bool = false
-
Skip allowed extensions check
Tags
Return values
selfsave()
Save the archive.
public
save() : bool
Return values
bool__construct()
protected
__construct(string $path, string $name[, array<string|int, ArchiveFile> $files = [] ][, int $count = 0 ]) : mixed
Parameters
- $path : string
- $name : string
- $files : array<string|int, ArchiveFile> = []
- $count : int = 0
directoryToPaths()
protected
directoryToPaths(string $path, string $relativeTo) : array<string|int, mixed>
Parameters
- $path : string
- $relativeTo : string
Return values
array<string|int, mixed>pathsToSplFiles()
protected
pathsToSplFiles(array<string|int, string>|array<string|int, SplFileInfo> $paths) : array<string|int, SplFileInfo>
Parameters
- $paths : array<string|int, string>|array<string|int, SplFileInfo>