interface Adapter
Interface Adapter the adapter interface for adapters to implement
Methods
__construct()
|
||
void |
open(string $file, int $flags)
opens the archive file or creates one by the file name supplied |
|
File[] |
getFiles()
returns an array of {@link File} object to iterate on |
|
bool |
unzip(string $destination = null, string|array $entries = null)
return true if the unzipping was success else failure |
|
object |
getArchive()
returns the archive object depends on the adapter |
|
string |
getFilename()
returns the archive file name |
|
int |
getFilesCount()
returns the number of files in the archive |
|
string|bool |
getComment()
returns the archive comment if supported by the archive or false if not supported |
|
Adapter|bool |
setComment(string $comment)
if supported by the adapter will set the new comment for the archive |
|
Adapter |
addFolder(string $path, string $parent = '')
adds a new folder recursively to the archive |
|
bool |
addFile(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)
adds a new file into the archive. |
|
$this |
updateArchive()
updates the archive in the adapter to show latest changes |
|
bool |
removeFileByObject(File $file)
removes a file from the archive using a {@link File} Object |
|
bool |
removeFileByName(string $name)
removes a file from the archive using the file name in the archive |
|
array |
addGlob(string $glob, int $flags = GLOB_BRACE, array $options = array())
adds files using |
|
array |
addPattern(string $pattern, string $directory, array $options = array())
|
|
static bool |
supports(string $type)
checks if the file type is supported by the adapter |
|
Adapter |
compress(string $format)
|
Details
at line 25
public
__construct()
at line 36
public void
open(string $file, int $flags)
opens the archive file or creates one by the file name supplied
at line 44
public File[]
getFiles()
returns an array of {@link File} object to iterate on
at line 55
public bool
unzip(string $destination = null, string|array $entries = null)
return true if the unzipping was success else failure
at line 63
public object
getArchive()
returns the archive object depends on the adapter
at line 71
public string
getFilename()
returns the archive file name
at line 79
public int
getFilesCount()
returns the number of files in the archive
at line 87
public string|bool
getComment()
returns the archive comment if supported by the archive or false if not supported
at line 97
public Adapter|bool
setComment(string $comment)
if supported by the adapter will set the new comment for the archive
at line 108
public Adapter
addFolder(string $path, string $parent = '')
adds a new folder recursively to the archive
at line 124
public bool
addFile(string $path, string $localName = null, int $start, null $length = null, bool $noUpdate = false)
adds a new file into the archive.
please note if $noUpdate is set to true you must run {@link Adapter#updateArchive()} manually,
or your archive info might not be updated
at line 132
public $this
updateArchive()
updates the archive in the adapter to show latest changes
at line 142
public bool
removeFileByObject(File $file)
removes a file from the archive using a {@link File} Object
at line 152
public bool
removeFileByName(string $name)
removes a file from the archive using the file name in the archive
at line 173
public array
addGlob(string $glob, int $flags = GLOB_BRACE, array $options = array())
adds files using
at line 184
public array
addPattern(string $pattern, string $directory, array $options = array())
at line 194
static public bool
supports(string $type)
checks if the file type is supported by the adapter
at line 202
public Adapter
compress(string $format)