DataFileDecompressor
in package
Decompresses a data file. Supports zip and gzip compression.
Table of Contents
Constants
- CONTENT_TYPE_GZIP = "application/x-gzip"
- CONTENT_TYPE_ZIP = "application/zip"
- XMSG_DECOMPRESS_ERROR = "Could not decompress gzipped/zipped content. Please check you have write permissions to: %s."
- XMSG_DECOMPRESS_OPEN_FILE_ERROR = "Could not open gzipped/zipped content at: %s."
- XMSG_ZIP_MOD_EXT_NOT_FOUND_ERROR = "Zip module/extension not found. Please install it or use gzip data file url for download."
- XMSG_ZLIB_MOD_EXT_NOT_FOUND_ERROR = "Zlib module/extension not found. Please install it or use zip data file url for download."
Properties
- $dataFile : mixed
- $supportedContentTypes : mixed
Methods
- __construct() : mixed
- decompress() : bool
- getSupportedContentTypes() : mixed
- isDecompressionRequired() : mixed
- decompressGzip() : bool
- Decompress Gzip and extract in a 'configured_file_directory/temporary file'.
- decompressZip() : bool
- Decompress Zip and extract in a 'configured_file_directory/temporary file'.
Constants
CONTENT_TYPE_GZIP
public
mixed
CONTENT_TYPE_GZIP
= "application/x-gzip"
CONTENT_TYPE_ZIP
public
mixed
CONTENT_TYPE_ZIP
= "application/zip"
XMSG_DECOMPRESS_ERROR
public
mixed
XMSG_DECOMPRESS_ERROR
= "Could not decompress gzipped/zipped content. Please check you have write permissions to: %s."
XMSG_DECOMPRESS_OPEN_FILE_ERROR
public
mixed
XMSG_DECOMPRESS_OPEN_FILE_ERROR
= "Could not open gzipped/zipped content at: %s."
XMSG_ZIP_MOD_EXT_NOT_FOUND_ERROR
public
mixed
XMSG_ZIP_MOD_EXT_NOT_FOUND_ERROR
= "Zip module/extension not found. Please install it or use gzip data file url for download."
XMSG_ZLIB_MOD_EXT_NOT_FOUND_ERROR
public
mixed
XMSG_ZLIB_MOD_EXT_NOT_FOUND_ERROR
= "Zlib module/extension not found. Please install it or use zip data file url for download."
Properties
$dataFile
private
mixed
$dataFile
$supportedContentTypes
private
static mixed
$supportedContentTypes
= array(self::CONTENT_TYPE_ZIP, self::CONTENT_TYPE_GZIP)
Methods
__construct()
public
__construct(mixed $dataFile) : mixed
Parameters
- $dataFile : mixed
decompress()
public
decompress( $contentType) : bool
Parameters
Tags
Return values
boolgetSupportedContentTypes()
public
static getSupportedContentTypes() : mixed
isDecompressionRequired()
public
isDecompressionRequired(mixed $contentType) : mixed
Parameters
- $contentType : mixed
decompressGzip()
Decompress Gzip and extract in a 'configured_file_directory/temporary file'.
private
decompressGzip() : bool
Delete the gzip file.
Tags
Return values
booldecompressZip()
Decompress Zip and extract in a 'configured_file_directory/temporary file'.
private
decompressZip() : bool
Delete the zip file.