cvs: phpdoc-zh /appendices filters.xml

From: Date: Fri, 12 Aug 2005 16:33:26 +0000
Subject: cvs: phpdoc-zh /appendices filters.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-2226@lists.php.net to get a copy of this message
dallas Fri Aug 12 12:33:26 2005 EDT Modified files: /phpdoc-zh/appendices filters.xml Log: Completed.

http://cvs.php.net/diff.php/phpdoc-zh/appendices/filters.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-zh/appendices/filters.xml diff -u phpdoc-zh/appendices/filters.xml:1.1 phpdoc-zh/appendices/filters.xml:1.2 --- phpdoc-zh/appendices/filters.xml:1.1 Thu Aug 11 13:18:07 2005 +++ phpdoc-zh/appendices/filters.xml Fri Aug 12 12:33:25 2005 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision:1.14 Maintainer: dallas Status: partial --> +<!-- EN-Revision:1.14 Maintainer: dallas Status: ready --> <appendix id="filters"> <title>¿ÉÓùýÂËÆ÷Áбí</title> @@ -217,62 +217,51 @@ <title>ѹËõ¹ýÂËÆ÷</title> <simpara> - While the <link linkend="wrappers.compression">Compression Wrappers</link> - provide a way of creating - gzip and bz2 compatible files on the local filesystem, they do not provide a - means for generalized compression over network streams, nor do they provide a - means to begin with a non-compressed stream and transition to a compressed one. - For this, a compression filter may be applied to any stream resource at any time. + ËäÈ»<link linkend="wrappers.compression">ѹËõ·âװЭÒé</link>ÌṩÁËÔÚ±¾µØÎļþϵͳÖÐ + ´´½¨ gzip ºÍ bz2 + ¼æÈÝÎļþµÄ·½·¨£¬µ«²»´ú±í¿ÉÒÔÔÚÍøÂçµÄÁ÷ÖÐÌṩͨÓÃѹËõµÄÒâ˼£¬Ò²²»´ú±í¿ÉÒÔ½«Ò»¸ö·ÇѹËõµÄÁ÷ת»»³ÉÒ»¸öѹËõÁ÷¡£¶Ô´Ë£¬Ñ¹Ëõ¹ýÂËÆ÷¿ÉÒÔÔÚÈκÎʱºòÓ¦ÓÃÓÚÈκÎÁ÷×ÊÔ´¡£ </simpara> <note> <simpara> - Compression filters do <emphasis>not</emphasis> generate headers and trailers - used by commandline utilites such as <literal>gzip</literal>. They only compress - and decompress the payload portions of compressed data streams. + ѹËõ¹ýÂËÆ÷<emphasis>²»</emphasis>²úÉúÃüÁîÐй¤¾ßÈç + <literal>gzip</literal> µÄÍ·ºÍβÐÅÏ¢¡£Ö»ÊÇѹËõºÍ½âѹÊý¾ÝÁ÷ÖеÄÓÐÐ§ÔØºÉ²¿·Ö¡£ </simpara> </note> <simpara> - <literal>zlib.deflate</literal> (compression) and - <literal>zlib.inflate</literal> (decompression) are implementations of - the compression methods described in <ulink url="&url.rfc;1951">RFC 1951</ulink>. - The <literal>deflate</literal> filter takes up to three parameters passed as - an associative array. - - <parameter>level</parameter> describes the compression - strength to use (1-9). Higher numbers will generally yield smaller payloads at - the cost of additional processing time. Two special compression levels also exist: - 0 (for no compression at all), and -1 (zlib internal default -- currently 6). - - <parameter>window</parameter> is the base-2 log of the compression loopback window size. - Higher values (up to 15 -- 32768 bytes) yield better compression at a cost of memory, - while lower values (down to 9 -- 512 bytes) yield worse compression in a smaller memory footprint. - Default <parameter>window</parameter> size is currently <constant>15</constant>. - - <parameter>memory</parameter> is a scale indicating how much work memory should be allocated. - Valid values range from 1 (minimal allocation) to 9 (maximum allocation). This memory allocation - affects speed only and does not impact the size of the generated payload. + <literal>zlib.deflate</literal>£¨Ñ¹Ëõ£©ºÍ + <literal>zlib.inflate</literal>£¨½âѹ£©ÊµÏÖÁ˶¨ÒåÓë + <ulink url="&url.rfc;1951">RFC 1951</ulink> + µÄѹËõËã·¨¡£<literal>deflate</literal> + ¹ýÂËÆ÷¿ÉÒÔ½ÓÊÜÒÔÒ»¸ö¹ØÁªÊý×é´«µÝµÄ×î¶àÈý¸ö²ÎÊý¡£<parameter>level</parameter> + ¶¨ÒåÁËѹËõÇ¿¶È£¨1-9£©¡£Êý×Ö¸ü¸ßͨ³£»á²úÉú¸üСµÄÔØºÉ£¬µ«ÒªÏûºÄ¸ü¶àµÄ´¦Àíʱ¼ä¡£´æÔÚÁ½¸öÌØÊâѹËõµÈ¼¶£º0£¨ÍêÈ«²»Ñ¹Ëõ£©ºÍ + -1£¨zlib ÄÚ²¿Ä¬ÈÏÖµ£¬Ä¿Ç°ÊÇ 6£©¡£<parameter>window</parameter> + ÊÇѹËõ»ØËÝ´°¿Ú´óС£¬ÒÔ¶þµÄ´Î·½±íʾ¡£¸ü¸ßµÄÖµ£¨´óµ½ 15 ¡ª¡ª 32768 + ×Ö½Ú£©²úÉú¸üºÃµÄѹËõЧ¹ûµ«ÏûºÄ¸ü¶àÄڴ棬µÍµÄÖµ£¨µÍµ½ 9 ¡ª¡ª 512 + ×Ö½Ú£©²úÉú²úÉú½Ï²îµÄѹËõЧ¹ûµ«ÄÚ´æÏûºÄµÍ¡£Ä¿Ç°Ä¬È쵀 + <parameter>window</parameter> ´óСÊÇ <constant>15</constant>¡£<parameter>memory</parameter> + ÓÃÀ´Ö¸Ê¾Òª·ÖÅä¶àÉÙ¹¤×÷ÄÚ´æ¡£ºÏ·¨µÄÊýÖµ·¶Î§ÊÇ´Ó 1£¨×îС·ÖÅ䣩µ½ + 9£¨×î´ó·ÖÅ䣩¡£ÄÚ´æ·ÖÅä½öÓ°ÏìËÙ¶È£¬²»»áÓ°ÏìÉú³ÉµÄÔØºÉµÄ´óС¡£ </simpara> <note> <simpara> - Because compression level is the most commonly used parameter, it may be alternatively - provided as a simple integer value (rather than an array element). + ÒòΪ×î³£ÓõIJÎÊýÊÇѹËõµÈ¼¶£¬Ò²¿ÉÒÔÌṩһ¸öÕûÊýÖµ×÷Ϊ´Ë²ÎÊý£¨¶ø²»ÓÃÊý×飩¡£ </simpara> </note> <simpara> - zlib.* compression filters are available with PHP as of version <literal>5.1.0</literal> if - <link linkend="ref.zlib">zlib</link> support is enabled. They are also available as a backport in version - <literal>5.0.x</literal> by installing the <ulink url="&url.pecl.package;zlib_filter">zlib_filter</ulink> - package from <ulink url="&url.pecl;">PECL</ulink>. These filters are <emphasis>not</emphasis> - available for PHP 4. + zlib.* ѹËõ¹ýÂËÆ÷×Ô PHP °æ±¾ <literal>5.1.0</literal> Æð¿ÉÓã¬ÔÚ¼¤»î + <link linkend="ref.zlib">zlib</link> µÄǰÌáÏ¡£Ò²¿ÉÒÔͨ¹ý°²×°À´×Ô + <ulink url="&url.pecl;">PECL</ulink> µÄ <ulink + url="&url.pecl.package;zlib_filter">zlib_filter</ulink> °ü×÷Ϊһ¸öºóÃÅÔÚ + <literal>5.0.x</literal> °æÖÐʹÓᣴ˹ýÂËÆ÷ÔÚ PHP 4 ÖÐ<emphasis>²»¿ÉÓÃ</emphasis>¡£ </simpara> <example> <title> - <literal>zlib.deflate</literal> and + <literal>zlib.deflate</literal> ºÍ <literal>zlib.inflate</literal> </title> <programlisting role="php"> @@ -310,7 +299,7 @@ <example> <title> - <literal>zlib.deflate</literal> simple + <literal>zlib.deflate</literal> ¼òµ¥²ÎÊýÓ÷¨ </title> <programlisting role="php"> <![CDATA[ @@ -338,43 +327,30 @@ </example> <simpara> - <literal>bzip2.compress</literal> and - <literal>bzip2.decompress</literal> - work in the same manner as the zlib filters described above. - - The <literal>bzip2.compress</literal> filter accepts up to two parameters given as - elements of an associative array: - - <parameter>blocks</parameter> is an integer value - from 1 to 9 specifying the number of 100kbyte blocks of memory to allocate for - workspace. - - <parameter>work</parameter> is also an integer value ranging from - 0 to 250 indicating how much effort to expend using the normal compression method - before falling back on a slower, but more reliable method. Tuning this parameter - effects only compression speed. Neither size of compressed output nor memory usage - are changed by this setting. A work factor of 0 instructs the bzip library to use - an internal default. - - The <literal>bzip2.decompress</literal> filter only accepts one parameter, - which can be passed as either an ordinary boolean value, or as the - <parameter>small</parameter> element of an associative array. - - <parameter>small</parameter>, when set to a &true; value, instructs the bzip library - to perform decompression in a minimal memory footprint at the cost of speed. + <literal>bzip2.compress</literal> ºÍ + <literal>bzip2.decompress</literal> ¹¤×÷µÄ·½Ê½ÓëÉÏÃæ½²µÄ zlib + ¹ýÂËÆ÷Ïàͬ¡£<literal>bzip2.compress</literal> + ¹ýÂËÆ÷½ÓÊÜÒÔÒ»¸ö¹ØÁªÊý×鏸³öµÄ×î¶àÁ½¸ö²ÎÊý£º<parameter>blocks</parameter> + ÊÇ´Ó 1 µ½ 9 µÄÕûÊýÖµ£¬Ö¸¶¨·ÖÅä¶àÉÙ¸ö 100K + ×Ö½ÚµÄÄÚ´æ¿é×÷Ϊ¹¤×÷Çø¡£<parameter>work</parameter> ÊÇ 0 µ½ 250 + µÄÕûÊýÖµ£¬Ö¸¶¨ÔÚÍ˻ص½Ò»¸öÂýһЩ£¬µ«¸ü¿É¿¿µÄË㷨֮ǰ×ö¶àÉٴγ£¹æÑ¹ËõËã·¨µÄ³¢ÊÔ¡£µ÷Õû´Ë²ÎÊý½öÓ°Ïìµ½ËÙ¶È£¬Ñ¹ËõÊä³öºÍÄÚ´æÊ¹Óö¼²»ÊÜ´ËÉèÖõÄÓ°Ïì¡£½«´Ë²ÎÊýÉèΪ + 0 ָʾ bzip ¿âʹÓÃÄÚ²¿Ä¬ÈÏËã·¨¡£<literal>bzip2.decompress</literal> + ¹ýÂËÆ÷½ö½ÓÊÜÒ»¸ö²ÎÊý£¬¿ÉÒÔÓÃÆÕͨµÄ²¼¶ûÖµ´«µÝ£¬»òÕßÓÃÒ»¸ö¹ØÁªÊý×éÖÐµÄ + <parameter>small</parameter> µ¥Ôª´«µÝ¡£µ± <parameter>small</parameter> + ÉèΪ &true; ֵʱ£¬Ö¸Ê¾ bzip ¿âÓÃ×îСµÄÄÚ´æÕ¼ÓÃÀ´Ö´ÐнâѹËõ£¬´ú¼ÛÊÇËÙ¶È»áÂýһЩ¡£ </simpara> <simpara> - bzip2.* compression filters are available with PHP as of version <literal>5.1.0</literal> if - <link linkend="ref.bzip2">bz2</link> support is enabled. They are also available as a backport in version - <literal>5.0.x</literal> by installing the <ulink url="&url.pecl.package;bz2_filter">bz2_filter</ulink> - package from <ulink url="&url.pecl;">PECL</ulink>. These filters are <emphasis>not</emphasis> - available for PHP 4. + bzip2.* ѹËõ¹ýÂËÆ÷×Ô PHP °æ±¾ <literal>5.1.0</literal> Æð¿ÉÓã¬ÔÚ¼¤»î + <link linkend="ref.bzip2">bz2</link> Ö§³ÖµÄǰÌáÏ¡£Ò²¿ÉÒÔͨ¹ý°²×°À´×Ô + <ulink url="&url.pecl;">PECL</ulink> µÄ<ulink + url="&url.pecl.package;bz2_filter">bz2_filter</ulink> °ü×÷Ϊһ¸öºóÃÅÔÚ + <literal>5.0.x</literal> °æÖÐʹÓᣴ˹ýÂËÆ÷ÔÚ PHP 4 ÖÐ<emphasis>²»¿ÉÓÃ</emphasis>¡£ </simpara> <example> <title> - <literal>bzip2.compress</literal> and + <literal>bzip2.compress</literal> ºÍ <literal>bzip2.decompress</literal> </title> <programlisting role="php"> @@ -404,61 +380,58 @@ </section> <section id="filters.encryption"> - <title>Encryption Filters</title> + <title>¼ÓÃܹýÂËÆ÷</title> <simpara> - <literal>mcrypt.*</literal> and <literal>mdecrypt.*</literal> - provide symmetric encryption and decryption using libmcrypt. - Both sets of filters support the same algorithms available to - <link linkend="ref.mcrypt">mcrypt extension</link> in the form of - <literal>mcrypt.ciphername</literal> where <parameter>ciphername</parameter> - is the name of the cipher as it would be passed to - <function>mcrypt_module_open</function>. - The following five filter parameters are also available: + <literal>mcrypt.*</literal> ºÍ <literal>mdecrypt.*</literal> + ʹÓà libmcrypt ÌṩÁ˶ԳƵļÓÃܺͽâÃÜ¡£ÕâÁ½×é¹ýÂËÆ÷¶¼Ö§³Ö + <link linkend="ref.mcrypt">mcrypt À©Õ¹¿â</link>ÖÐÏàͬµÄËã·¨£¬¸ñʽΪ + <literal>mcrypt.ciphername</literal>£¬ÆäÖÐ <parameter>ciphername</parameter> + ÊÇÃÜÂëµÄÃû×Ö£¬½«±»´«µÝ¸ø <function>mcrypt_module_open</function>¡£ÓÐÒÔÏÂÎå¸ö¹ýÂËÆ÷²ÎÊý¿ÉÓ㺠</simpara> <para> <table> - <title>mcrypt filter parameters</title> + <title>mcrypt ¹ýÂËÆ÷²ÎÊý</title> <tgroup cols="4"> <thead> <row> - <entry>Parameter</entry> - <entry>Required?</entry> - <entry>Default</entry> - <entry>Sample Values</entry> + <entry>²ÎÊý</entry> + <entry>ÊÇ·ñ±ØÐë</entry> + <entry>ĬÈÏÖµ</entry> + <entry>ȡֵ¾ÙÀý</entry> </row> </thead> <tbody> <row> <entry>mode</entry> - <entry>Optional</entry> + <entry>¿ÉÑ¡</entry> <entry>cbc</entry> <entry>cbc, cfb, ecb, nofb, ofb, stream</entry> </row> <row> <entry>algorithms_dir</entry> - <entry>Optional</entry> + <entry>¿ÉÑ¡</entry> <entry>ini_get('mcrypt.algorithms_dir')</entry> - <entry>Location of algorithms modules</entry> + <entry>algorithms Ä£¿éµÄĿ¼</entry> </row> <row> <entry>modes_dir</entry> - <entry>Optional</entry> + <entry>¿ÉÑ¡</entry> <entry>ini_get('mcrypt.modes_dir')</entry> - <entry>Location of modes modules</entry> + <entry>modes Ä£¿éµÄĿ¼</entry> </row> <row> <entry>iv</entry> - <entry>Required</entry> + <entry>±ØÐë</entry> <entry>N/A</entry> - <entry>Typically 8, 16, or 32 bytes of binary data. Depends on cipher</entry> + <entry>µäÐÍΪ 8£¬16 »ò 32 ×ֽڵĶþ½øÖÆÊý¾Ý¡£¸ù¾ÝÃÜÂë¶ø¶¨</entry> </row> <row> <entry>key</entry> - <entry>Required</entry> + <entry>±ØÐë</entry> <entry>N/A</entry> - <entry>Typically 8, 16, or 32 bytes of binary data. Depends on cipher</entry> + <entry>µäÐÍΪ 8£¬16 »ò 32 ×ֽڵĶþ½øÖÆÊý¾Ý¡£¸ù¾ÝÃÜÂë¶ø¶¨</entry> </row> </tbody> </tgroup> @@ -466,7 +439,7 @@ </para> <example> - <title>Encrypting file output using 3DES</title> + <title>Óà 3DES ½«Îļþ¼ÓÃÜÊä³ö</title> <programlisting role="php"> <![CDATA[ <?php @@ -490,7 +463,7 @@ </example> <example> - <title>Reading an encrypted file</title> + <title>¶ÁÈ¡¼ÓÃܵÄÎļþ</title> <programlisting role="php"> <![CDATA[ <?php
« previous php.doc.zh (#2226) next »