cvs: phpdoc-zh /appendices wrappers.xml
| From: | Dallas Thunder | Date: | Fri, 04 Apr 2003 05:17:48 +0000 |
| Subject: | cvs: phpdoc-zh /appendices wrappers.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-1300@lists.php.net to get a copy of this message | ||
dallas Fri Apr 4 00:17:48 2003 EDT
Modified files:
/phpdoc-zh/appendices wrappers.xml
Log:
Updated.
Index: phpdoc-zh/appendices/wrappers.xml
diff -u phpdoc-zh/appendices/wrappers.xml:1.8 phpdoc-zh/appendices/wrappers.xml:1.9
--- phpdoc-zh/appendices/wrappers.xml:1.8 Sun Dec 29 11:29:50 2002
+++ phpdoc-zh/appendices/wrappers.xml Fri Apr 4 00:17:47 2003
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<!-- $Author: dallas $ -->
-<!-- EN-Revision:1.10 Maintainer: dallas Status: ready -->
+<!-- EN-Revision:1.11 Maintainer: dallas Status: ready -->
<appendix id="wrappers">
<title>Ö§³ÖµÄÐÒ飯·â×°ÐÒéÁбí</title>
<para>
@@ -84,8 +84,12 @@
<section id="wrappers.php">
<title>PHP ÊäÈ룯Êä³öÁ÷</title>
- <simpara>PHP 3.0.13 ¼°ÒÔÉϰ汾£¬×Ô PHP 4.3 ÆðÖ§³Ö
<filename>php://output</filename>
- ºÍ <filename>php://input</filename>¡£</simpara>
+ <simpara>
+ <literal>PHP 3.0.13</literal> ¼°ÒÔÉϰ汾£¬×Ô
+ <literal>PHP 4.3<literal> ÆðÖ§³Ö <filename>php://output</filename>
+ ºÍ <filename>php://input</filename>£¬×Ô
+ <literal>PHP 5.0</literal> ÆðÖ§³Ö
<filename>php://filter</filename>¡£
+ </simpara>
<itemizedlist>
<listitem><simpara><filename>php://stdin</filename></simpara></listitem>
@@ -93,6 +97,7 @@
<listitem><simpara><filename>php://stderr</filename></simpara></listitem>
<listitem><simpara><filename>php://output</filename></simpara></listitem>
<listitem><simpara><filename>php://input</filename></simpara></listitem>
+
<listitem><simpara><filename>php://filter</filename></simpara></listitem>
</itemizedlist>
<simpara>
@@ -112,6 +117,86 @@
<filename>php://input</filename>
ÊÇÖ»¶ÁµÄ£¬Í¬Ê±£¬<filename>php://stdout</filename>£¬<filename>php://stderr</filename>
ºÍ
<filename>php://output</filename> ÊÇֻдµÄ¡£
</simpara>
+
+ <simpara>
+ <filename>php://filter</filename>
+
ÊÇÒ»ÖÖÉè¼ÆÓÃÀ´ÔÊÐí¹ýÂËÆ÷³ÌÐòÔÚ´ò¿ªÊ±³ÉΪÁ÷µÄ·â×°ÐÒé¡£Õâ¶ÔÓÚµ¥¶À¾ßÓÐÍêÕû¹¦ÄܵÄÎļþº¯ÊýÀýÈç
+ <function>readfile</function>£¬<function>file</function>
+ ºÍ <function>file_get_contents</function>
ºÜÓÐÓ㬷ñÔò¾ÍûÓлú»áÔÚ¶ÁÈ¡ÄÚÈÝ֮ǰ½«¹ýÂËÆ÷Ó¦ÓÃÓÚÁ÷Ö®ÉÏ¡£
+ </simpara>
+ <simpara>
+ <filename>php://filter</filename>
µÄÄ¿±ê½ÓÊÜËæºóµÄ'²ÎÊý'×÷ΪÆä'·¾¶'µÄÒ»²¿·Ö¡£
+ </simpara>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>/resource=<stream to be filtered></literal>
+ (<emphasis>required</emphasis>) ´Ë²ÎÊý±ØÐëλÓÚ
+ <filename>php://filter</filename>
µÄĩβ²¢ÇÒÐèÒªÖ¸ÏòÏòÒª¹ýÂ˵ÄÁ÷¡£
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+<?php
+/* This is equivalent to simply:
+ readfile("http://www.example.com");
+ since no filters are actually specified */
+
+readfile("php://filter/resource=http://www.example.com");
+?>
+]]>
+ </programlisting>
+ </informalexample>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>/read=<filter list to apply to read chain></literal>
+ (<emphasis>optional</emphasis>)
±¾²ÎÊý½ÓÊÜÒ»¸ö»ò¶à¸ö¹ýÂËÆ÷µÄÃû×Ö£¬ÓùܵÀ×Ö·û
<literal>|</literal> ·Ö¸ô¡£
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+<?php
+/* This will output the contents of
+ www.example.com entirely in uppercase */
+readfile("php://filter/read=string.toupper/resource=http://www.example.com");
+
+/* This will do the same as above
+ but will also ROT13 encode it */
+readfile("php://filter/read=string.toupper|string.rot13/resource=http://www.example.com");
+?>
+]]>
+ </programlisting>
+ </informalexample>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>/write=<filter list to apply to write chain></literal>
+ (<emphasis>optional</emphasis>)
±¾²ÎÊý½ÓÊÜÒ»¸ö»ò¶à¸ö¹ýÂËÆ÷µÄÃû×Ö£¬ÓùܵÀ×Ö·û
<literal>|</literal> ·Ö¸ô¡£
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+<?php
+/* This will filter the string "Hello World"
+ through the rot13 filter, then write to
+ example.txt in the current directory */
+file_set_contents("php://filter/write=string.rot13/resource=example.txt","Hello
World");
+?>
+]]>
+ </programlisting>
+ </informalexample>
+ </para>
+ </listitem>
+ <listitem>
+ <simpara>
+ <literal>/<filter list to apply to both chains></literal>
+ (<emphasis>optional</emphasis>) ÈκÎûÓб»
+ <literal>read=</literal> »ò
+ <literal>write=</literal>
Ö¸¶¨µÄ¹ýÂËÆ÷»á±»Í¬Ê±Ó¦ÓÃÓÚ¶ÁдÁ´¡£
+ </simpara>
+ </listitem>
+ </itemizedlist>
+
</section>
<section id="wrappers.compression">
@@ -125,7 +210,7 @@
<listitem><simpara><filename>compress.bzip2://</filename></simpara></listitem>
</itemizedlist>
- <simpara>
+ <simpara>
<filename>zlib:</filename> ºÍ <function>gzopen</function>
µÄ¹¤×÷·½Ê½ÏàÏó£¬Ö»³ýÁËÁ÷¿ÉÒÔÓÃÓÚ
<function>fread</function> ºÍÆäËüÎļþϵͳº¯Êý¡£×Ô PHP 4.3
ÆðÒѲ»ÔÞ³ÉʹÓã¬ÒòΪ¿ÉÄÜ»áºÍ°üº¬ÓС°:¡±×Ö·ûµÄÎļþÃû»ìÏý£¬ÓÃ
<filename>compress.zlib://</filename> ´úÌæ¡£