canCompress

(no version information, might be only in CVS)

canCompress -- Returns whether phar extension supports compression using zlib or bzip2

Descrizione

bool canCompress ( void )

This should be used to test whether compression is possible prior to loading a phar archive containing compressed files.

Elenco dei parametri

Valori restituiti

TRUE if compression/decompression is available, FALSE if not.

Esempi

Esempio 1. A canCompress() example

<?php
if (Phar::canCompress()) {
    echo 
file_get_contents('phar://whatever.phar/internal/file.txt');
} else {
    echo 
'no compression available';
}
?>

Vedere anche:

PharFileInfo::isCompressed()