getPharCompressionType.php
Table of Contents
Functions
- getPharCompressionType() : int
- Returns the corresponding Phar compression constant for a given compression type.
Functions
getPharCompressionType()
Returns the corresponding Phar compression constant for a given compression type.
getPharCompressionType(string $compression) : int
This function maps a compression type (e.g., gzip
, bzip2
, or none
) to
the appropriate Phar compression constant (e.g., Phar::GZ
, Phar::BZ2
, Phar::NONE
).
It is useful when setting or detecting compression in Phar archives programmatically.
Parameters
- $compression : string
-
The compression type to resolve. Must be one of the values defined in CompressionType.
Tags
Return values
int —The Phar compression constant (Phar::GZ, Phar::BZ2, or Phar::NONE).