PHP Class ArrayArchive, Zipper

Inheritance: implements Chumper\Zipper\Repositories\RepositoryInterface
ファイルを表示 Open project: chumper/zipper

Public Methods

Method Description
__construct ( $filePath, boolean $new = false, $archiveImplementation = null ) Construct with a given path
addEmptyDir ( $dirName ) : void Add an empty directory
addFile ( $pathToFile, $pathInArchive ) : void Add a file to the opened Archive
close ( ) : void Closes the archive and saves it
each ( $callback ) : void Will loop over every item in the archive and will execute the callback on them Will provide the filename for every item
fileExists ( $fileInArchive ) : boolean Checks whether the file is in the archive
getFileContent ( $pathInArchive ) : string Get the content of a file
getFileStream ( $pathInArchive ) : mixed Get the stream of a file
getStatus ( ) : string Returns the status of the archive as a string
removeFile ( $pathInArchive ) : void Remove a file permanently from the Archive
usePassword ( $password ) : void Sets the password to be used for decompressing

Method Details

__construct() public method

Construct with a given path
public __construct ( $filePath, boolean $new = false, $archiveImplementation = null )
$filePath
$new boolean
$archiveImplementation

addEmptyDir() public method

Add an empty directory
public addEmptyDir ( $dirName ) : void
$dirName
return void

addFile() public method

Add a file to the opened Archive
public addFile ( $pathToFile, $pathInArchive ) : void
$pathToFile
$pathInArchive
return void

close() public method

Closes the archive and saves it
public close ( ) : void
return void

each() public method

Will loop over every item in the archive and will execute the callback on them Will provide the filename for every item
public each ( $callback ) : void
$callback
return void

fileExists() public method

Checks whether the file is in the archive
public fileExists ( $fileInArchive ) : boolean
$fileInArchive
return boolean

getFileContent() public method

Get the content of a file
public getFileContent ( $pathInArchive ) : string
$pathInArchive
return string

getFileStream() public method

Get the stream of a file
public getFileStream ( $pathInArchive ) : mixed
$pathInArchive
return mixed

getStatus() public method

Returns the status of the archive as a string
public getStatus ( ) : string
return string

removeFile() public method

Remove a file permanently from the Archive
public removeFile ( $pathInArchive ) : void
$pathInArchive
return void

usePassword() public method

Sets the password to be used for decompressing
public usePassword ( $password ) : void
$password
return void