mirror of
https://github.com/php/doc-zh.git
synced 2026-03-23 22:52:08 +01:00
139 lines
4.2 KiB
XML
139 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
<!-- EN-Revision: bad50150f7e06228f48c4461fab52afe08a4d5e4 Maintainer: daijie Status: ready -->
|
||
<!-- CREDITS: Luffy, mowangjuanzi -->
|
||
<refentry xml:id="wrappers.compression" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" annotations="verify_info:false" role="stream_wrapper">
|
||
<refnamediv>
|
||
<refname>zlib://</refname>
|
||
<refname>bzip2://</refname>
|
||
<refname>zip://</refname>
|
||
<refpurpose>压缩流</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description"><!-- {{{ -->
|
||
&reftitle.description;
|
||
<simpara><filename>compress.zlib://</filename> and <filename>compress.bzip2://</filename></simpara>
|
||
|
||
<simpara>
|
||
<filename>zlib:</filename> 的功能类似 <function>gzopen</function>,但是
|
||
其数据流还能被 <function>fread</function> 和其他文件系统函数使用。
|
||
不建议使用,因为会和其他带“:”字符的文件名混淆;
|
||
请使用 <filename>compress.zlib://</filename> 替代。
|
||
</simpara>
|
||
|
||
<simpara>
|
||
<filename>compress.zlib://</filename>、
|
||
<filename>compress.bzip2://</filename>
|
||
和 <function>gzopen</function>、<function>bzopen</function>
|
||
是相等的。并且可以在不支持 fopencookie 的系统中使用。
|
||
</simpara>
|
||
|
||
<simpara>
|
||
<link linkend="book.zip">ZIP 扩展</link> 注册了 <filename>zip:</filename> 封装器。
|
||
自 PHP 7.2.0 和 libzip 1.2.0+ 起,加密归档开始支持密码,允许数据流中使用密码。
|
||
字节流上下文(stream contexts)中使用 <literal>'password'</literal> 选项设置密码。
|
||
</simpara>
|
||
</refsect1><!-- }}} -->
|
||
|
||
<refsect1 role="usage"> <!-- {{{ -->
|
||
&reftitle.options;
|
||
<itemizedlist>
|
||
<listitem><simpara><filename>compress.zlib://file.gz</filename></simpara></listitem>
|
||
<listitem><simpara><filename>compress.bzip2://file.bz2</filename></simpara></listitem>
|
||
<listitem><simpara><filename>zip://archive.zip#dir/file.txt</filename></simpara></listitem>
|
||
</itemizedlist>
|
||
</refsect1> <!-- }}} -->
|
||
|
||
<refsect1 role="options"><!-- {{{ -->
|
||
&reftitle.usage;
|
||
<para>
|
||
<table>
|
||
<title>封装协议摘要</title>
|
||
<tgroup cols="2">
|
||
<thead>
|
||
<row>
|
||
<entry>属性</entry>
|
||
<entry>支持</entry>
|
||
</row>
|
||
</thead>
|
||
<tbody>
|
||
<row>
|
||
<entry>受限于 <link linkend="ini.allow-url-fopen">allow_url_fopen</link></entry>
|
||
<entry>No</entry>
|
||
</row>
|
||
<row>
|
||
<entry>允许读取</entry>
|
||
<entry>Yes</entry>
|
||
</row>
|
||
<row>
|
||
<entry>允许写入</entry>
|
||
<entry>Yes(除了 <literal>zip://</literal>)</entry>
|
||
</row>
|
||
<row>
|
||
<entry>允许附加</entry>
|
||
<entry>Yes(除了 <literal>zip://</literal>)</entry>
|
||
</row>
|
||
<row>
|
||
<entry>允许同时读写</entry>
|
||
<entry>No</entry>
|
||
</row>
|
||
<row>
|
||
<entry>支持 <function>stat</function></entry>
|
||
<entry>
|
||
No,请使用普通的 <literal>file://</literal> 封装器统计压缩文件。
|
||
</entry>
|
||
</row>
|
||
<row>
|
||
<entry>支持 <function>unlink</function></entry>
|
||
<entry>
|
||
No,请使用 <literal>file://</literal> 封装器删除压缩文件。
|
||
</entry>
|
||
</row>
|
||
<row>
|
||
<entry>支持 <function>rename</function></entry>
|
||
<entry>No</entry>
|
||
</row>
|
||
<row>
|
||
<entry>支持 <function>mkdir</function></entry>
|
||
<entry>No</entry>
|
||
</row>
|
||
<row>
|
||
<entry>支持 <function>rmdir</function></entry>
|
||
<entry>No</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</table>
|
||
</para>
|
||
</refsect1> <!-- }}} -->
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<simplelist>
|
||
<member><xref linkend="context.zlib" /></member>
|
||
</simplelist>
|
||
</refsect1>
|
||
</refentry>
|
||
|
||
<!-- Keep this comment at the end of the file
|
||
Local variables:
|
||
mode: sgml
|
||
sgml-omittag:t
|
||
sgml-shorttag:t
|
||
sgml-minimize-attributes:nil
|
||
sgml-always-quote-attributes:t
|
||
sgml-indent-step:1
|
||
sgml-indent-data:t
|
||
indent-tabs-mode:nil
|
||
sgml-parent-document:nil
|
||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||
sgml-exposed-tags:nil
|
||
sgml-local-catalogs:nil
|
||
sgml-local-ecat-files:nil
|
||
End:
|
||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||
vim: et tw=78 syn=sgml
|
||
vi: ts=1 sw=1
|
||
-->
|
||
|