tarWritableCompressions.php
Table of Contents
Functions
- tarWritableCompressions() : array<int, string>
- The compressions {@see tar()} can actually write **on this host**, in a stable order.
Functions
tarWritableCompressions()
The compressions {@see tar()} can actually write **on this host**, in a stable order.
tarWritableCompressions() : array<int, string>
Not a constant list, because it is not a property of this library: it is a property of the machine. Two engines contribute, and they do not cover the same formats.
- PharData compresses through PHP extensions, so it offers
gzipwithext-zlibandbzip2withext-bz2, and nothing else —Pharknows no other. - The system
tarpipes through a program, so it offers whatever it can find:gzip,bzip2,xzandzstd. Which means a host can write.tar.zstand the one next to it cannot, with the same code and the same version of this library.
none is always there.
Why this is a function and not documentation. tar() used to refuse xz with
"Compression type 'xz' is not supported", raised by a helper assembling a temporary
path, seventeen lines before the engines had even been looked at — a sentence about
this library where the truth was about the host. The refusal now names what is missing
and what would work here, and this is where it reads it. It is also what a doctor
command should print: a host that silently writes .tar.gz where the operator
expected .tar.zst has nothing else to tell them.
Deliberately absent: lzma, which xz superseded and whose --lzma flag
tarCompressionFlag() still carries for a caller going straight to
tarWithBinary(), and lz4, for which GNU tar has no flag at all.
Tags
Return values
array<int, string> —Values of CompressionType, none first.