8288分类目录 8288分类目录 8288分类目录
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

PHP - Manual: PharFileInfo::isCompressedBZIP2

来源:网络转载 浏览:39次 时间:2023-05-15
PharFileInfo::isCompressedGZ » « PharFileInfo::isCompressed PHP 手册 函数参考 压缩与归档扩展 Phar PharFileInfo

PharFileInfo::isCompressedBZIP2

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

PharFileInfo::isCompressedBZIP2 — Returns whether the entry is compressed using bzip2

说明

public PharFileInfo::isCompressedBZIP2 ( void ) : bool

Note:

此方法已经从 phar 扩展 2.0.0以上版本中删除。可使用 PharFileInfo::isCompressed(),PharFileInfo::decompress() 和 PharFileInfo::compress()替代。

This returns whether a file is compressed within a Phar archive with Bzip2 compression.

返回值

TRUE if the file is compressed within the Phar archive using Bzip2, FALSE if not.

范例

Example #1 A PharFileInfo::isCompressedBZIP2() example

<?php
try {
    $p = new Phar('/path/to/my.phar', 0, 'my.phar');
    $p['myfile.txt'] = 'hi';
    $p['myfile2.txt'] = 'hi';
    $p['myfile3.txt'] = 'hi';
    $p['myfile2.txt']->setCompressedGZ();
    $p['myfile3.txt']->setCompressedBZIP2();
    $file = $p['myfile.txt'];
    $file2 = $p['myfile2.txt'];
    $file3 = $p['myfile3.txt'];
    var_dump($file->isCompressedBZIP2());
    var_dump($file2->isCompressedBZIP2());
    var_dump($file3->isCompressedBZIP2());
} catch (Exception $e) {
    echo 'Create/modify on phar my.phar failed: ', $e;
}
?>

以上例程会输出:

bool(false)
bool(false)
bool(true)

参见

PharFileInfo::getCompressedSize() - Returns the actual size of the file (with compression) inside the Phar archive PharFileInfo::isCompressed() - Returns whether the entry is compressed PharFileInfo::isCompressedGZ() - Returns whether the entry is compressed using gz PharFileInfo::setCompressedBZIP2() - Compresses the current Phar entry within the phar using Bzip2 compression PharFileInfo::setUncompressed() - Uncompresses the current Phar entry within the phar, if it is compressed PharFileInfo::setCompressedGZ() - Compresses the current Phar entry within the phar using gz compression Phar::canCompress() - Returns whether phar extension supports compression using either zlib or bzip2 Phar::isCompressed() - Returns Phar::GZ or PHAR::BZ2 if the entire phar archive is compressed (.tar.gz/tar.bz and so on) Phar::compressAllFilesBZIP2() - Compresses all files in the current Phar archive using Bzip2 compression Phar::compressAllFilesGZ() - Compresses all files in the current Phar archive using Gzip compression Phar::getSupportedCompression() - Return array of supported compression algorithms Phar::uncompressAllFiles() - Uncompresses all files in the current Phar archive
add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/pharfileinfo.iscompressedbzip2.php

  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net