Zippy API
Class

Alchemy\Zippy\Archive\Member

class Member implements MemberInterface

Represents a member of an archive.

Methods

__construct(ResourceInterface $resource, AdapterInterface $adapter, String $location, Integer $fileSize, DateTime $lastModifiedDate, Boolean $isDir)

Constructor

String getLocation()

Boolean isDir()

getLastModifiedDate()

Integer getSize()

__toString()

SplFileInfo extract(String|null $to = null)

Extract the member from its archive

Details

at line 74
public __construct(ResourceInterface $resource, AdapterInterface $adapter, String $location, Integer $fileSize, DateTime $lastModifiedDate, Boolean $isDir)

Constructor

Parameters

ResourceInterface $resource The path of the archive which contain the member
AdapterInterface $adapter The archive adapter interface
String $location The path of the archive member
Integer $fileSize The uncompressed file size
DateTime $lastModifiedDate The last modifed date of the member
Boolean $isDir Tells wheteher the member is a directory or not

at line 87
public String getLocation()

Return Value

String

at line 95
public Boolean isDir()

Return Value

Boolean

at line 103
public getLastModifiedDate()

at line 111
public Integer getSize()

Return Value

Integer

at line 119
public __toString()

at line 127
public SplFileInfo extract(String|null $to = null)

Extract the member from its archive

Be carefull using this method within a loop
This will execute one extraction process for each file
Prefer the use of ArchiveInterface::extractMembers in that use case

Parameters

String|null $to The path where to extract the member, if no path is not provided the member is extracted in the same direcoty of its archive

Return Value

SplFileInfo The extracted file

Exceptions

RuntimeException In case of failure
InvalidArgumentException In case no members could be removed or provide extract target direcotry is not valid