Documentation

ArchiveZipCreate
in package

Table of Contents

Properties

$count  : int
$files  : array<string|int, mixed>
$name  : string
$path  : string

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

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
self

addFile()

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
self

addFromString()

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
self

make()

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
throws
Exception
Return values
self

__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>
Return values
array<string|int, SplFileInfo>

        
On this page

Search results