October\Rain\Filesystem\Zip

Source: ~/vendor/october/rain/src/Filesystem/Zip.php

Extends:

  • ZipArchive

Zip helper

Protected properties

protected string $folderPrefix

Folder prefix

Public methods

public self add(mixed $source, array $options=array())

Includes a source to the Zip

Parameters
  • mixed $source
  • array $options

public static bool extract(string $source, string $destination, array $options=array())

Extract an existing zip file.

Parameters
  • string $source - Path for the existing zip
  • string $destination - Path to extract the zip files
  • array $options

public self folder(string $name, mixed $source=NULL)

Creates a new folder inside the Zip and adds source files (optional)

Parameters
  • string $name - Folder name
  • mixed $source

public static self make(string $destination, mixed $source)

Creates a new empty zip file.

Parameters
  • string $destination - Path for the new zip
  • mixed $source

public self remove(string $source)

Removes a file or folder from the zip collection. Does not support wildcards.

Parameters
  • string $source

Show inherited public methods

Inherited public methods

  • public void addEmptyDir($dirname) - defined in ZipArchive.
  • public void addFile($filepath, $entryname=NULL, $start=NULL, $length=NULL) - defined in ZipArchive.
  • public void addFromString($name, $content) - defined in ZipArchive.
  • public void addGlob($pattern, $flags=NULL, $options=NULL) - defined in ZipArchive.
  • public void addPattern($pattern, $path=NULL, $options=NULL) - defined in ZipArchive.
  • public void close() - defined in ZipArchive.
  • public void deleteIndex($index) - defined in ZipArchive.
  • public void deleteName($name) - defined in ZipArchive.
  • public void extractTo($pathto, $files=NULL) - defined in ZipArchive.
  • public void getArchiveComment($flags=NULL) - defined in ZipArchive.
  • public void getCommentIndex($index, $flags=NULL) - defined in ZipArchive.
  • public void getCommentName($name, $flags=NULL) - defined in ZipArchive.
  • public void getExternalAttributesIndex($index, &$opsys, &$attr, $flags=NULL) - defined in ZipArchive.
  • public void getExternalAttributesName($name, &$opsys, &$attr, $flags=NULL) - defined in ZipArchive.
  • public void getFromIndex($index, $len=NULL, $flags=NULL) - defined in ZipArchive.
  • public void getFromName($entryname, $len=NULL, $flags=NULL) - defined in ZipArchive.
  • public void getNameIndex($index, $flags=NULL) - defined in ZipArchive.
  • public void getStatusString() - defined in ZipArchive.
  • public void getStream($entryname) - defined in ZipArchive.
  • public void locateName($filename, $flags=NULL) - defined in ZipArchive.
  • public void open($filename, $flags=NULL) - defined in ZipArchive.
  • public void renameIndex($index, $new_name) - defined in ZipArchive.
  • public void renameName($name, $new_name) - defined in ZipArchive.
  • public void setArchiveComment($comment) - defined in ZipArchive.
  • public void setCommentIndex($index, $comment) - defined in ZipArchive.
  • public void setCommentName($name, $comment) - defined in ZipArchive.
  • public void setCompressionIndex($index, $method, $compflags=NULL) - defined in ZipArchive.
  • public void setCompressionName($name, $method, $compflags=NULL) - defined in ZipArchive.
  • public void setExternalAttributesIndex($index, $opsys, $attr, $flags=NULL) - defined in ZipArchive.
  • public void setExternalAttributesName($name, $opsys, $attr, $flags=NULL) - defined in ZipArchive.
  • public void setPassword($password) - defined in ZipArchive.
  • public void statIndex($index, $flags=NULL) - defined in ZipArchive.
  • public void statName($filename, $flags=NULL) - defined in ZipArchive.
  • public void unchangeAll() - defined in ZipArchive.
  • public void unchangeArchive() - defined in ZipArchive.
  • public void unchangeIndex($index) - defined in ZipArchive.
  • public void unchangeName($name) - defined in ZipArchive.

Protected methods

protected string removePathPrefix(string $prefix, string $path)

Removes a prefix from a path.

Parameters
  • string $prefix - /var/sites/
  • string $path - /var/sites/moo/cow/