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

search for in the

data://> <php://
[edit] Last updated: Fri, 10 Feb 2012

view this page in

zlib://

bzip2://

zip://

zlib:// -- bzip2:// -- zip://圧縮ストリーム

説明

zlib: PHP 4.0.4 - PHP 4.2.3 (fopencookie をサポートするシステムのみ)

compress.zlib:// および compress.bzip2:// PHP 4.3.0以降

zlib:gzopen() と同様に 動作しますが、このストリームは fread() および 他のファイルシステム関数と組み合わせて使用することができるところが 異なります。この機能ではファイル名に ':' 文字が含まれる曖昧さが あるため、PHP 4.3.0 以降では古い機能となっています。代わりに compress.zlib:// を使用してください。

compress.zlib:// および compress.bzip2:// は、それぞれ gzopen() および bzopen() と等価で、 fopencookie をサポートしないシステムの上でも動作します。

ZIP 拡張モジュールzip: ラッパーを登録します。

オプション

  • zlib:
  • compress.zlib://
  • compress.bzip2://

オプション

ラッパーの概要
属性 サポートの有無
allow_url_fopen で制約される No
読み込み許可 Yes
書き込み許可 Yes (zip:// を除く)
追加許可 Yes (zip:// を除く)
同時読み書き許可 No
stat() のサポート No, 圧縮されたファイルの状態を知るには、通常の file:// ラッパーを使用します。
unlink() のサポート No, 圧縮されたファイルを unlink するには、通常の file:// ラッパーを使用します。
rename() のサポート No
mkdir() のサポート No
rmdir() のサポート No



add a note add a note User Contributed Notes zlib://
alvaro at demogracia dot com 12-Apr-2011 07:41
Example on how to read an entry from a ZIP archive (file "bar.txt" inside "./foo.zip"):

<?php

$fp
= fopen('zip://./foo.zip#bar.txt', 'r');
if(
$fp ){
    while( !
feof($fp) ){
        echo
fread($fp, 8192);
    }
   
fclose($fp);
}

?>

Also, apparently, the "zip:" wrapper does not allow writing as of PHP/5.3.6. You can read http://php.net/ziparchive-getstream for further reference since the underlying code is probably the same.
joshualross at gmail dot com 19-Aug-2007 12:24
I had a difficult time finding how to use compress.zlib with an http resource so I thought I would post what I found
<?php
$file
= 'compress.zlib://http://www.example.com/myarchive.gz';
$fr = fopen($file, 'rb');
?>

Per the bugreport I found here (http://bugs.php.net/bug.php?id=29045)

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