[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/spout/src/Spout/Writer/Common/Helper/ -> ZipHelper.php (summary)

(no description)

File Size: 217 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ZipHelper:: (12 methods):
  __construct()
  createOrGetZip()
  getZipFilePath()
  addFileToArchive()
  addUncompressedFileToArchive()
  addFileToArchiveWithCompressionMethod()
  canChooseCompressionMethod()
  addFolderToArchive()
  shouldSkipFile()
  getNormalizedRealPath()
  closeArchiveAndCopyToStream()
  copyZipToStream()


Class: ZipHelper  - X-Ref

Class ZipHelper
This class provides helper functions to create zip files

__construct($tmpFolderPath)   X-Ref

param: string $tmpFolderPath Path of the temp folder where the zip file will be created

createOrGetZip()   X-Ref
Returns the already created ZipArchive instance or
creates one if none exists.

return: \ZipArchive

getZipFilePath()   X-Ref

return: string Path where the zip file of the given folder will be created

addFileToArchive($rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)   X-Ref
Adds the given file, located under the given root folder to the archive.
The file will be compressed.

Example of use:
addFileToArchive('/tmp/xlsx/foo', 'bar/baz.xml');
=> will add the file located at '/tmp/xlsx/foo/bar/baz.xml' in the archive, but only as 'bar/baz.xml'

param: string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
param: string $localFilePath Path of the file to be added, under the root folder
param: string|void $existingFileMode Controls what to do when trying to add an existing file
return: void

addUncompressedFileToArchive($rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)   X-Ref
Adds the given file, located under the given root folder to the archive.
The file will NOT be compressed.

Example of use:
addUncompressedFileToArchive('/tmp/xlsx/foo', 'bar/baz.xml');
=> will add the file located at '/tmp/xlsx/foo/bar/baz.xml' in the archive, but only as 'bar/baz.xml'

param: string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
param: string $localFilePath Path of the file to be added, under the root folder
param: string|void $existingFileMode Controls what to do when trying to add an existing file
return: void

addFileToArchiveWithCompressionMethod($rootFolderPath, $localFilePath, $existingFileMode, $compressionMethod)   X-Ref
Adds the given file, located under the given root folder to the archive.
The file will NOT be compressed.

Example of use:
addUncompressedFileToArchive('/tmp/xlsx/foo', 'bar/baz.xml');
=> will add the file located at '/tmp/xlsx/foo/bar/baz.xml' in the archive, but only as 'bar/baz.xml'

param: string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
param: string $localFilePath Path of the file to be added, under the root folder
param: string $existingFileMode Controls what to do when trying to add an existing file
param: int $compressionMethod The compression method
return: void

canChooseCompressionMethod()   X-Ref

return: bool Whether it is possible to choose the desired compression method to be used

addFolderToArchive($folderPath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)   X-Ref

param: string $folderPath Path to the folder to be zipped
param: string|void $existingFileMode Controls what to do when trying to add an existing file
return: void

shouldSkipFile($zip, $itemLocalPath, $existingFileMode)   X-Ref

param: \ZipArchive $zip
param: string $itemLocalPath
param: string $existingFileMode
return: bool Whether the file should be added to the archive or skipped

getNormalizedRealPath($path)   X-Ref
Returns canonicalized absolute pathname, containing only forward slashes.

param: string $path Path to normalize
return: string Normalized and canonicalized path

closeArchiveAndCopyToStream($streamPointer)   X-Ref
Closes the archive and copies it into the given stream

param: resource $streamPointer Pointer to the stream to copy the zip
return: void

copyZipToStream($pointer)   X-Ref
Streams the contents of the zip file into the given stream

param: resource $pointer Pointer to the stream to copy the zip
return: void



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1