PHP: canCompress - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

canWrite apiVersion

Last updated: Sat, 27 Jan 2007

view this page in

# 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()

add a note User Contributed Notes
canCompress
There are no user contributed notes for this page.
canWrite apiVersion

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST