canCompress

(no version information, might be only in CVS)

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

Описание

bool canCompress ( void )

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

Список параметров

Возвращаемые значения

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

Примеры

Пример 1. A canCompress() example

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

Смотрите также

PharFileInfo::isCompressed()