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

search for in the

Phar::canWrite> <Phar::buildFromIterator
[edit] Last updated: Fri, 25 May 2012

view this page in

Phar::canCompress

(PHP >= 5.3.0, PECL phar >= 1.0.0)

Phar::canCompressphar 拡張モジュールが zlib あるいは bzip2 による圧縮をサポートしているかどうかを返す

説明

bool Phar::canCompress ([ int $type = 0 ] )

これは、圧縮されたファイルを含む phar を読み込む前に、 圧縮が可能かどうかを調べるために使用します。

パラメータ

type

Phar::GZ あるいは Phar::BZ2 のいずれかを指定し、指定した圧縮アルゴリズムでの圧縮が可能かどうかを調べます。

返り値

圧縮/展開 が可能な場合に TRUE、そうでない場合に FALSE を返します。

例1 Phar::canCompress() の例

<?php
if (Phar::canCompress()) {
    echo 
file_get_contents('phar://compressedphar.phar/internal/file.txt');
} else {
    echo 
'圧縮はできません';
}
?>

参考



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

 
show source | credits | stats | sitemap | contact | advertising | mirror sites