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

search for in the

 
Last updated: Fri, 29 Aug 2008

view this page in

Phar::canCompress

(PECL phar:1.0.0-1.2.1)

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

説明

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

これは、圧縮されたファイルを含む 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.

 
Last updated: Fri, 29 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites