API
Class

Elibyy\Adapters\TestAdapter

class TestAdapter extends ZipAdapter

Class TestAdapter this file is to cover the test of working extending adapter

Methods

__construct()

from ZipAdapter
static bool supports(string $type)

from ZipAdapter
File[] getFiles()

from ZipAdapter
int getFilesCount()

from ZipAdapter
object getArchive()

from ZipAdapter
bool unzip(string $destination = null, string|array $entries = null)

from ZipAdapter
string getFilename()

from ZipAdapter
string|bool getComment()

from ZipAdapter
Adapter|bool setComment(string $comment)

from ZipAdapter
$this updateArchive()

from ZipAdapter
void open(string $file, int $flags = \ZipArchive::CREATE)

from ZipAdapter
Adapter addFolder(string $path, string $parent = '')

from ZipAdapter
bool addFile(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)

from ZipAdapter
bool removeFileByObject(File $file)

from ZipAdapter
bool removeFileByName(string $name)

from ZipAdapter
array addGlob(string $glob, int $flags = GLOB_BRACE, array $options = array())

from ZipAdapter
array addPattern(string $pattern, string $directory, array $options = array())

from ZipAdapter
Adapter compress(string $format)

from ZipAdapter

Details

in ZipAdapter at line 48
public __construct()

in ZipAdapter at line 59
static public bool supports(string $type)

Parameters

string $type the file type

Return Value

bool is the type supported

in ZipAdapter at line 67
public File[] getFiles()

Return Value

File[] the array of the files in the archive

in ZipAdapter at line 82
public int getFilesCount()

Return Value

int the number of files in the archive

in ZipAdapter at line 90
public object getArchive()

Return Value

object the archive object instance depend on the adapter

in ZipAdapter at line 98
public bool unzip(string $destination = null, string|array $entries = null)

Parameters

string $destination
string|array $entries

Return Value

bool was it success ?

in ZipAdapter at line 110
public string getFilename()

Return Value

string the archive file name

in ZipAdapter at line 118
public string|bool getComment()

Return Value

string|bool the comment of the archive

in ZipAdapter at line 126
public Adapter|bool setComment(string $comment)

Parameters

string $comment the new archive comment

Return Value

Adapter|bool the adapter instance on suceess else false

in ZipAdapter at line 135
public $this updateArchive()

Return Value

$this

in ZipAdapter at line 144
public void open(string $file, int $flags = \ZipArchive::CREATE)

Parameters

string $file the Archive filename
int $flags the flags depend on the adapter

Return Value

void

in ZipAdapter at line 152
public Adapter addFolder(string $path, string $parent = '')

Parameters

string $path the folder full path
string $parent the parent path used for relative path in the archive

Return Value

Adapter

in ZipAdapter at line 180
public bool addFile(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)

Parameters

string $path the file full path
string $localName the file local name in the archive
int $start the start position to start from when reading the file
null $length the end position to stop when reading the file
bool $noUpdate if set will not update the archive after adding the file

Return Value

bool was the file added?

in ZipAdapter at line 194
public bool removeFileByObject(File $file)

Parameters

File $file the File Object to remove

Return Value

bool was the file removed?

in ZipAdapter at line 204
public bool removeFileByName(string $name)

Parameters

string $name the file name

Return Value

bool was the file removed?

in ZipAdapter at line 214
public array addGlob(string $glob, int $flags = GLOB_BRACE, array $options = array())

Parameters

string $glob the glob pattern
int $flags glob flags
array $options An associative array of options. Available options are:

"addpath"

Prefix to prepend when translating to the local path of the file within the archive. This is applied after any remove operations defined by the "removepath" or "removeallpath" options.

Return Value

array the result of the glob

in ZipAdapter at line 224
public array addPattern(string $pattern, string $directory, array $options = array())

Parameters

string $pattern the regular expression pattern
string $directory the path of the directory
array $options An associative array of options accepted by ZipArchive::addGlob.

Return Value

array the result of the pattern

in ZipAdapter at line 240
public Adapter compress(string $format)

Parameters

string $format the format of the compression

Return Value

Adapter the resulting adapter