cvs: phpdoc-zh /appendices wrappers.xml

From: Date: Thu, 21 Apr 2005 03:57:28 +0000
Subject: cvs: phpdoc-zh /appendices wrappers.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1941@lists.php.net to get a copy of this message
class007 Wed Apr 20 23:57:28 2005 EDT Modified files: /phpdoc-zh/appendices wrappers.xml Log: ÓëÓ¢Îİæ 1.49 ͬ²½

http://cvs.php.net/diff.php/phpdoc-zh/appendices/wrappers.xml?r1=1.20&r2=1.21&ty=u Index: phpdoc-zh/appendices/wrappers.xml diff -u phpdoc-zh/appendices/wrappers.xml:1.20 phpdoc-zh/appendices/wrappers.xml:1.21 --- phpdoc-zh/appendices/wrappers.xml:1.20 Wed Dec 10 19:37:42 2003 +++ phpdoc-zh/appendices/wrappers.xml Wed Apr 20 23:57:28 2005 @@ -1,26 +1,109 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.20 $ --> -<!-- $Author: dallas $ --> -<!-- EN-Revision:1.29 Maintainer: dallas Status: ready --> +<!-- $Revision: 1.21 $ --> +<!-- $Author: class007 $ --> +<!-- EN-Revision:1.49 Maintainer: class007 Status: ready --> +<!-- CREDITS: dallas, class007 --> <appendix id="wrappers"> <title>Ö§³ÖµÄЭÒ飯·âװЭÒéÁбí</title> <para> ÒÔÏÂÊÇ PHP ÄÚÖÃÓÃÓÚÎļþϵͳº¯ÊýÀýÈç <function>fopen</function> ºÍ <function>copy</function> µÄ URL ·ç¸ñЭÒéÁÐ±í¡£³ýÁËÕâЩ·âװЭÒéÖ®Í⣬´Ó - <literal>PHP 4.3</literal> Æð£¬Ä㻹¿ÉÒÔÓà PHP ½Å±¾ºÍ + PHP 4.3 Æð£¬Ä㻹¿ÉÒÔÓà PHP ½Å±¾ºÍ <function>stream_wrapper_register</function> д×Ô¼ºµÄ·âװЭÒé¡£ </para> + <section id="wrappers.file"> + <title>Îļþϵͳ</title> + <simpara>ËùÓа汾µÄ PHP¡£×Ô´Ó PHP 4.3.0 ÒÔÀ´Ã÷ȷʹÓà <filename>file://</filename>¡£</simpara> + + <itemizedlist> + <listitem><simpara><filename>/path/to/file.ext</filename></simpara></listitem> + <listitem><simpara><filename>relative/path/to/file.ext</filename></simpara></listitem> + <listitem><simpara><filename>fileInCwd.ext</filename></simpara></listitem> + <listitem><simpara><filename>C:/path/to/winfile.ext</filename></simpara></listitem> + <listitem><simpara><filename>C:\path\to\winfile.ext</filename></simpara></listitem> + <listitem><simpara><filename>\\smbserver\share\path\to\winfile.ext</filename></simpara></listitem> + <listitem><simpara><filename>file:///path/to/file.ext</filename></simpara></listitem> + </itemizedlist> + + <simpara> + <filename>file://</filename> ÊÇ PHP ĬÈϵÄÃèÊö±¾µØÎļþϵͳµÄ·âװЭÒé¡£Ö¸¶¨Ïà¶Ô·¾¶ (Ïà¶Ô·¾¶Ãû²»¿ªÊ¼ÓÚ /¡¢\¡¢\\ »ò Windows ÅÌ·û) ʱ£¬¸Ã·¾¶ÊÇÏà¶ÔÓÚµ±Ç°µÄ¹¤×÷Ŀ¼¡£ÔںܶàÇé¿öϹ¤×÷Ŀ¼¾ÍÊǵ±Ç°Ö´ÐеĽű¾ËùÔÚµÄĿ¼£¬³ý·ÇËü±»¸Ä±ä¡£Ê¹Óà CLI sapi ʱ£¬Ä¬ÈÏÊǵ÷Óøýű¾Ê±ÖÕ¶ËËù´¦µÄĿ¼¡£ + </simpara> + + <simpara> + ijЩº¯Êý£¬ÀýÈç <function>fopen</function> ºÍ <function>file_get_contents</function>£¬»á×Ô¶¯ËÑË÷ + <literal>include_path</literal> ×÷ΪÏà¶Ô·¾¶¡£ + </simpara> + + <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>·ñ</entry> + </row> + <row> + <entry>ÔÊÐí¶ÁÈ¡</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíдÈë</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐí¸½¼Ó</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>Ö§³Ö <function>stat</function></entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>ÊÇ</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </section> + <section id="wrappers.http"> <title>HTTP ºÍ HTTPS</title> - <simpara>PHP 3£¬PHP 4¡£×Ô <literal>PHP 4.3.0</literal> ÆðÖ§³Ö <filename>https://</filename></simpara> + <simpara>PHP 3, PHP 4, PHP 5¡£×Ô PHP 4.3.0 ÆðÖ§³Ö <filename>https://</filename></simpara> <itemizedlist> <listitem><simpara><filename>http://example.com</filename></simpara></listitem> + <listitem><simpara><filename>http://example.com/file.php?var1=val1&amp;var2=val2</filename></simpara></listitem> <listitem><simpara><filename>http://user:password@example.com</filename></simpara></listitem> <listitem><simpara><filename>https://example.com</filename></simpara></listitem> + <listitem><simpara><filename>https://example.com/file.php?var1=val1&amp;var2=val2</filename></simpara></listitem> <listitem><simpara><filename>https://user:password@example.com</filename></simpara></listitem> </itemizedlist> @@ -30,6 +113,7 @@ Îļþ»òÕßÁ÷ÉÏÏÂÎÄÅäÖÃÁË <link linkend="ini.user-agent">user_agent</link> ×Ö·û´®£¬Ò²»á±»°üÀ¨ÔÚÇëÇó±¨Í·ÖС£ </simpara> + &warn.ssl-·ñn-standard; <simpara> ×Ô PHP 4.0.5 ÆðÖ§³ÖÖØ¶¨Ïò¡£Èç¹ûʹÓýÏÔç°æ±¾µÄ PHP ÔòÐèÒªÔÚ URL ĩβ°üÀ¨Ò»¸öбÏß¡£Èç¹ûÒ»¶¨ÒªÖªµÀÎĵµËùÔÚµÄ×ÊÔ´µÄ @@ -43,13 +127,14 @@ $fp = fopen($url, 'r'); -/* Prior to PHP 4.3.0 use $http_response_header - instead of stream_get_meta_data() */ -foreach(stream_get_meta_data($fp) as $response) { +/* ÔÚ PHP 4.3.0 ֮ǰʹÓà $http_response_header + ¶ø²»ÊÇ stream_get_meta_data() */ +$meta_data = stream_get_meta_data($fp); +foreach($meta_data['wrapper_data'] as $response) { - /* Were we redirected? */ + /* ÖØ¶¨Ïòµ½ºÎ´¦? */ if (substr(strtolower($response), 0, 10) == 'location: ') { - /* update $url with where we were redirected to */ + /* °ÑÒªÖØ¶¨ÏòµÄÁ´½Ó¸³Öµ¸ø $url */ $url = substr($response, 10); } @@ -62,7 +147,7 @@ <simpara> Á÷ÔÊÐí·ÃÎÊ×ÊÔ´µÄ<emphasis>ÕýÎÄ</emphasis>£¬±¨Í·²¿·Ö±£´æÔÚ <varname>$http_response_header</varname> ±äÁ¿ÖС£×Ô - <literal>PHP 4.3.0</literal> Æð£¬¿ÉÒÔÓà + PHP 4.3.0 Æð£¬¿ÉÒÔÓà <function>stream_get_meta_data</function> µÃµ½±¨Í·¡£ </simpara> <simpara> @@ -70,7 +155,7 @@ </simpara> <note> <simpara> - ×Ô <literal>PHP 4.3.0</literal> Æð¿ªÊ¼Ö§³Ö HTTPS£¬ÐèÒªÔÚ±àÒëʱ¼ÓÈë OpenSSL µÄÖ§³Ö¡£ + ×Ô PHP 4.3.0 Æð¿ªÊ¼Ö§³Ö HTTPS£¬ÐèÒªÔÚ±àÒëʱ¼ÓÈë OpenSSL µÄÖ§³Ö¡£ </simpara> </note> <para> @@ -85,32 +170,44 @@ </thead> <tbody> <row> - <entry>ÊÜ <literal>allow_url_fopen</literal> ÏÞÖÆ</entry> - <entry>Yes</entry> + <entry>ÊÜÏÞÓÚ <link linkend="ini.allow-url-fopen">allow_url_fopen</link></entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐí¶ÁÈ¡</entry> + <entry>ÊÇ</entry> </row> <row> - <entry>Allows Reading</entry> - <entry>Yes</entry> + <entry>ÔÊÐíдÈë</entry> + <entry>·ñ</entry> </row> <row> - <entry>Allows Writing</entry> - <entry>No</entry> + <entry>ÔÊÐí¸½¼Ó</entry> + <entry>·ñ</entry> </row> <row> - <entry>Allows Appending</entry> - <entry>No</entry> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>ÎÞЧ</entry> </row> <row> - <entry>Allows Simultaneous Reading and Writing</entry> - <entry>N/A</entry> + <entry>Ö§³Ö <function>stat</function></entry> + <entry>·ñ</entry> </row> <row> - <entry>Supports <function>stat</function></entry> - <entry>No</entry> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry>·ñ</entry> </row> <row> - <entry>Supports <function>unlink</function></entry> - <entry>No</entry> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>·ñ</entry> </row> </tbody> </tgroup> @@ -118,7 +215,7 @@ </para> <para> <table> - <title>ÉÏÏÂÎÄÑ¡Ïcontext options£¬×Ô <literal>PHP 5.0.0</literal> Æð£©</title> + <title>ÉÏÏÂÎÄÑ¡Ïcontext options£¬×Ô PHP 5.0.0 Æð£©</title> <tgroup cols="3"> <thead> <row> @@ -168,6 +265,15 @@ </entry> <entry></entry> </row> + <row> + <entry><literal>request_fulluri</literal></entry> + <entry> + ÉèÖÃΪ &true; ʱ£¬½¨Á¢ÇëÇóʱÕû¸ö URI ½«±»Ê¹Óá£(¼´ + <literal>GET http://www.example.com/path/to/file.html HTTP/1.0</literal>)¡£ + ¶øÕâÊÇÒ»¸ö·Ç±ê×¼ÇëÇó¸ñʽ£¬Ä³Ð©´úÀí·þÎñÆ÷ÐèÒªËü¡£ + </entry> + <entry>&false;</entry> + </row> </tbody> </tgroup> </table> @@ -188,7 +294,7 @@ <section id="wrappers.ftp"> <title>FTP ºÍ FTPS</title> - <simpara>PHP 3£¬PHP 4¡£×Ô <literal>PHP 4.3.0</literal> ÆðÖ§³Ö <filename>ftps://</filename></simpara> + <simpara>PHP 3, PHP 4, PHP 5¡£×Ô PHP 4.3.0 ÆðÖ§³Ö <filename>ftps://</filename></simpara> <itemizedlist> <listitem><simpara><filename>ftp://example.com/pub/file.txt</filename></simpara></listitem> @@ -212,65 +318,89 @@ <note> <title>×·¼ÓÎļþ</title> <simpara> - ×Ô <literal>PHP 5.0.0</literal> Æð¿ÉÒÔͨ¹ý - <literal>ftp://</literal> url ЭÒéÀ´×·¼ÓÎļþ¡£ÔÚ֮ǰµÄ°æ±¾ÊÔͼͨ¹ý + ×Ô PHP 5.0.0 Æð¿ÉÒÔͨ¹ý + <literal>ftp://</literal> URL ЭÒéÀ´×·¼ÓÎļþ¡£ÔÚ֮ǰµÄ°æ±¾ÊÔͼͨ¹ý <literal>ftp://</literal> À´×·¼ÓÎļþ»áµ¼ÖÂʧ°Ü¡£ </simpara> </note> <simpara> - <filename>ftps://</filename> ÊÇ <literal>PHP 4.3.0</literal> + <filename>ftps://</filename> ÊÇ PHP 4.3.0 Òý½øµÄ¡£ËüºÍ <filename>ftp://</filename> Ïàͬ£¬µ«Êdz¢ÊÔºÍ ftp ·þÎñÆ÷½¨Á¢Ò»¸ö°²È«Á¬½Ó¡£Èç¹û·þÎñÆ÷²»Ö§³Ö SSL£¬Ôò»á·µ»ØÒ»¸öÆÕͨµÄδ¼ÓÃÜµÄ ftp Á¬½Ó¡£ </simpara> <note> <simpara> - ×Ô <literal>PHP 4.3.0</literal> Æð¿ªÊ¼Ö§³Ö + ×Ô PHP 4.3.0 Æð¿ªÊ¼Ö§³Ö FTPS£¬ÐèÒªÔÚ±àÒëʱ¼ÓÈë OpenSSL µÄÖ§³Ö¡£ </simpara> </note> <para> <table> <title>Wrapper Summary</title> - <tgroup cols="2"> + <tgroup cols="3"> <thead> <row> <entry>ÊôÐÔ</entry> - <entry>Ö§³Ö</entry> + <entry>PHP 4</entry> + <entry>PHP 5</entry> </row> </thead> <tbody> <row> - <entry>Restricted by <literal>allow_url_fopen</literal>.</entry> - <entry>Yes</entry> + <entry>ÊÜÏÞÓÚ <link linkend="ini.allow-url-fopen">allow_url_fopen</link>¡£</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐí¶ÁÈ¡</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíдÈë</entry> + <entry>ÊÇ (½öÔÊÐíдÈëÐÂÎļþ)</entry> + <entry>ÊÇ (ÔÊÐíʹÓà <parameter>overwrite</parameter> ²ÎÊý¸²¸ÇÐÂÎļþ)</entry> </row> <row> - <entry>Allows Reading</entry> - <entry>Yes</entry> + <entry>ÔÊÐí¸½¼Ó</entry> + <entry>·ñ</entry> + <entry>ÊÇ (<literal>PHP 5.0.0</literal> »ò¸üа汾)</entry> </row> <row> - <entry>Allows Writing</entry> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>stat</function></entry> + <entry>·ñ</entry> <entry> - Yes (Prior to <literal>PHP 5.0.0</literal>: new files only. - <literal>PHP 5.0.0</literal> and later: overwrite allowed - with context option) + PHP 5.0.0: ½öÔÚ <function>filesize</function>, + <function>filetype</function>, <function>file_exists</function>, + <function>is_file</function> ºÍ <function>is_dir</function> ÖÐÖ§³Ö¡£ + PHP 5.1.0: <function>filemtime</function>¡£ </entry> </row> <row> - <entry>Allows Appending</entry> - <entry>Yes (<literal>PHP 5.0.0</literal> or later)</entry> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> </row> <row> - <entry>Allows Simultaneous Reading and Writing</entry> - <entry>No</entry> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> </row> <row> - <entry>Supports <function>stat</function></entry> - <entry>No</entry> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> </row> <row> - <entry>Supports <function>unlink</function></entry> - <entry>Yes (<literal>PHP 5.0.0</literal> or later)</entry> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> </row> </tbody> </tgroup> @@ -278,7 +408,7 @@ </para> <para> <table> - <title>ÉÏÏÂÎÄÑ¡Ï×Ô <literal>PHP 5.0</literal> Æð£©</title> + <title>ÉÏÏÂÎÄÑ¡Ï×Ô PHP 5.0 Æð£©</title> <tgroup cols="3"> <thead> <row> @@ -298,6 +428,15 @@ <entry>¿ªÊ¼´«ÊäµÄÎļþÆ«ÒÆÁ¿¡£½öÊÊÓÃÓÚ¶Áȡģʽ£¨ÏÂÔØ£©¡£</entry> <entry>0£¨ÎļþÍ·£©</entry> </row> + <row> + <entry><literal>proxy</literal>(PHP 5.1.0 »ò¸ü¸ß°æ±¾)</entry> + <entry> + ͨ¹ý HTTP ´úÀí·þÎñÆ÷¶Ô FTP ·¢³öÇëÇó + ½öÄܽøÐÐÎļþ¶ÁÈ¡²Ù×÷¡£ + ÀýÈ磺<literal>tcp://squid.example.com:8000</literal> + </entry> + <entry/> + </row> </tbody> </tgroup> </table> @@ -319,10 +458,10 @@ <section id="wrappers.php"> <title>PHP ÊäÈ룯Êä³öÁ÷</title> <simpara> - <literal>PHP 3.0.13</literal> ¼°ÒÔÉϰ汾£¬×Ô - <literal>PHP 4.3.0</literal> ÆðÖ§³Ö <filename>php://output</filename> + PHP 3.0.13 ¼°ÒÔÉϰ汾£¬×Ô + PHP 4.3.0 ÆðÖ§³Ö <filename>php://output</filename> ºÍ <filename>php://input</filename>£¬×Ô - <literal>PHP 5.0.0</literal> ÆðÖ§³Ö <filename>php://filter</filename>¡£ + PHP 5.0.0 ÆðÖ§³Ö <filename>php://filter</filename>¡£ </simpara> <itemizedlist> @@ -359,7 +498,7 @@ ºÍ <function>file_get_contents</function> ºÜÓÐÓ㬷ñÔò¾ÍûÓлú»áÔÚ¶ÁÈ¡ÄÚÈÝ֮ǰ½«¹ýÂËÆ÷Ó¦ÓÃÓÚÁ÷Ö®ÉÏ¡£ </simpara> <simpara> - <filename>php://filter</filename> µÄÄ¿±ê½ÓÊÜËæºóµÄ&apos;²ÎÊý&apos;×÷ΪÆä&apos;·¾¶&apos;µÄÒ»²¿·Ö¡£ + <filename>php://filter</filename> µÄÄ¿±ê½ÓÊÜËæºóµÄ¡°²ÎÊý¡±×÷ΪÆä¡°Â·¾¶¡±µÄÒ»²¿·Ö¡£ </simpara> <itemizedlist> <listitem> @@ -373,7 +512,7 @@ <?php /* This is equivalent to simply: readfile("http://www.example.com"); - since no filters are actually specified */ + since ·ñ filters are actually specified */ readfile("php://filter/resource=http://www.example.com"); ?> @@ -411,10 +550,9 @@ <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"); +/* ÏÂÃæµÄÓï¾ä½«Ê¹Óà rot13 ¹ýÂËÆ÷¹ýÂË "Hello World" + ×Ö·û´®£¬²¢Ð´È뵱ǰĿ¼Ï嵀 example.txt */ +file_put_contents("php://filter/write=string.rot13/resource=example.txt","Hello World"); ?> ]]> </programlisting> @@ -433,8 +571,7 @@ <para> <table> <title> - Wrapper Summary (For <literal>php://filter</literal>, - refer to summary of wrapper being filtered.) + ·âװЭÒéÕªÒª (¶ÔÓÚ <literal>php://filter</literal>£¬ÊÇÖ¸±»¹ýÂ˵ķâ×°Æ÷ÕªÒª¡£) </title> <tgroup cols="2"> <thead> @@ -445,43 +582,55 @@ </thead> <tbody> <row> - <entry>Restricted by <literal>allow_url_fopen</literal>.</entry> - <entry>No</entry> + <entry>ÊÜÏÞÓÚ <link linkend="ini.allow-url-fopen">allow_url_fopen</link>¡£</entry> + <entry>·ñ</entry> </row> <row> - <entry>Allows Reading</entry> + <entry>ÔÊÐí¶ÁÈ¡</entry> <entry> - <literal>php://stdin</literal> and - <literal>php://input</literal> only. + ½öÔÚ <literal>php://stdin</literal> ºÍ + <literal>php://input</literal> ÖÐÔÊÐí¡£ </entry> </row> <row> - <entry>Allows Writing</entry> + <entry>ÔÊÐíдÈë</entry> <entry> - <literal>php://stdout</literal>, - <literal>php://stderr</literal>, and - <literal>php://output</literal> only. + ½öÔÚ <literal>php://stdout</literal>, + <literal>php://stderr</literal>, ºÍ + <literal>php://output</literal> ÖÐÔÊÐí¡£ </entry> </row> <row> - <entry>Allows Appending</entry> + <entry>ÔÊÐí¸½¼Ó</entry> <entry> - <literal>php://stdout</literal>, - <literal>php://stderr</literal>, and - <literal>php://output</literal> only. (Equivalent to writing) + ½öÔÚ <literal>php://stdout</literal>, + <literal>php://stderr</literal>, ºÍ + <literal>php://output</literal> ÖÐÔÊÐí (ÓëдÈëÏàͬ)¡£ </entry> </row> <row> - <entry>Allows Simultaneous Reading and Writing</entry> - <entry>No. These wrappers are unidirectional.</entry> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>·ñ¡£ÕâЩ·â×°Æ÷Êǵ¥ÏòµÄ¡£</entry> + </row> + <row> + <entry>Ö§³Ö <function>stat</function></entry> + <entry>·ñ</entry> </row> <row> - <entry>Supports <function>stat</function></entry> - <entry>No</entry> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry>·ñ</entry> </row> <row> - <entry>Supports <function>unlink</function></entry> - <entry>No</entry> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>·ñ</entry> </row> </tbody> </tgroup> @@ -513,7 +662,321 @@ </simpara> <para> <table> - <title>Wrapper Summary</title> + <title>·âװЭÒéÕªÒª</title> + <tgroup cols="2"> + <thead> + <row> + <entry>ÊôÐÔ</entry> + <entry>Ö§³Ö</entry> + </row> + </thead> + <tbody> + <row> + <entry>ÊÜÏÞÓÚ <literal>allow_url_fopen</literal>¡£</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>ÔÊÐí¶ÁÈ¡</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíдÈë</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐí¸½¼Ó</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>stat</function></entry> + <entry> + ·ñ£¬ÇëʹÓà <literal>file://</literal> ·â×°Æ÷ͳ¼ÆÑ¹ËõÎļþ¡£ + </entry> + </row> + <row> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry> + ·ñ£¬ÇëʹÓà <literal>file://</literal> ·â×°Æ÷ɾ³ýѹËõÎļþ¡£ + </entry> + </row> + <row> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>·ñ</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + </section> + <section id="wrappers.ssh2"> + <title>Secure Shell 2</title> + <simpara> + <filename>ssh2.shell://</filename> + <filename>ssh2.exec://</filename> + <filename>ssh2.tunnel://</filename> + <filename>ssh2.sftp://</filename> + <filename>ssh2.scp://</filename> + PHP 4.3.0 ¼°ÒÔÉϰ汾 (PECL) + </simpara> + + <itemizedlist> + <listitem><simpara><filename>ssh2.shell://user:pass@example.com:22/xterm</filename></simpara></listitem> + <listitem><simpara><filename>ssh2.exec://user:pass@example.com:22/usr/local/bin/somecmd</filename></simpara></listitem> + <listitem><simpara><filename>ssh2.tunnel://user:pass@example.com:22/192.168.0.1:14</filename></simpara></listitem> + <listitem><simpara><filename>ssh2.sftp://user:pass@example.com:22/path/to/filename</filename></simpara></listitem> + </itemizedlist> + + <note> + <title>¸Ã·â×°Æ÷ĬÈÏûÓÐÆôÓÃ</title> + <simpara> + ҪʹÓà <filename>ssh2.*://</filename> ·â×°Æ÷£¬Äú±ØÐë°²×° <ulink url="&url.pecl.package;ssh2">SSH2</ulink> À©Õ¹¡£¿ÉÒÔµ½ <ulink url="&url.pecl;">PECL</ulink> ÏÂÔØ¡£ + </simpara> + </note> + + <simpara> + ³ýÁ˽ÓÊÜ´«Í³ URI µÄµÇ¼ÐÅÏ¢Í⣬ssh2 ·â×°Æ÷Ò²ÖØÓÃÖ÷»ú URL µÄÒ»²¿·ÖµÄÁ¬½Ó×ÊÔ´¡£ + </simpara> + + <example> + <title>Ϊ»î¶¯Á¬½Ó´ò¿ªÁ÷</title> + <programlisting role="php"> +<![CDATA[ +<?php +$session = ssh2_connect('example.com', 22); +ssh2_auth_pubkey_file($session, 'username', '/home/username/.ssh/id_rsa.pub', + '/home/username/.ssh/id_rsa', 'secret'); +$stream = fopen("ssh2.tunnel://$session/remote.example.com:1234", 'r'); +?> +]]> + </programlisting> + </example> + <para> + <table> + <title>·âװЭÒéÕªÒª</title> + <tgroup cols="6"> + <thead> + <row> + <entry>ÊôÐÔ</entry> + <entry>ssh2.shell</entry> + <entry>ssh2.exec</entry> + <entry>ssh2.tunnel</entry> + <entry>ssh2.sftp</entry> + <entry>ssh2.scp</entry> + </row> + </thead> + <tbody> + <row> + <entry>ÊÜÏÞÓÚ <link linkend="ini.allow-url-fopen">allow_url_fopen</link>¡£</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐí¶ÁÈ¡</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíдÈë</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>ÔÊÐí¸½¼Ó</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>ÊÇ (Èô·þÎñÆ÷Ö§³Ö)</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>stat</function></entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>·ñ</entry> + <entry>ÊÇ</entry> + <entry>·ñ</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + <para> + <table> + <title>ÉÏÏÂÎÄÑ¡Ïî</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Ãû³Æ</entry> + <entry>Ó÷¨</entry> + <entry>ĬÈÏ</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>session</literal></entry> + <entry>¿ÉÖØÓÃÔ¤Á¬½ÓµÄ ssh2 Á¬½Ó×ÊÔ´</entry> + <entry/> + </row> + <row> + <entry><literal>sftp</literal></entry> + <entry>¿ÉÖØÓÃÔ¤·ÖÅäµÄ sftp Á¬½Ó×ÊÔ´</entry> + <entry/> + </row> + <row> + <entry><literal>methods</literal></entry> + <entry>ҪʹÓÃµÄ Key exchange, hostkey, cipher, compression, ºÍ MAC ·½·¨</entry> + <entry/> + </row> + <row> + <entry><literal>callbacks</literal></entry> + <entry></entry> + <entry></entry> + </row> + <row> + <entry><literal>username</literal></entry> + <entry>Á¬½ÓµÄÓû§Ãû</entry> + <entry></entry> + </row> + <row> + <entry><literal>password</literal></entry> + <entry>ÃÜÂëÈÏ֤ʱÐèÒªµÄÃÜÂë</entry> + <entry></entry> + </row> + <row> + <entry><literal>pubkey_file</literal></entry> + <entry>ÈÏÖ¤ÐèÒªµÄ public key ÎļþÃû</entry> + <entry></entry> + </row> + <row> + <entry><literal>privkey_file</literal></entry> + <entry>ÈÏÖ¤ÐèÒªµÄ private key ÎļþÃû</entry> + <entry></entry> + </row> + <row> + <entry><literal>env</literal></entry> + <entry>ÒªÉèÖõĻ·¾³±äÁ¿µÄÊý×é</entry> + <entry></entry> + </row> + <row> + <entry><literal>term</literal></entry> + <entry>µ±·ÖÅäÒ»¸ö¿ØÖÆÌ¨Ê±Ê¹ÓõÄÖÕ¶ËÀàÐÍ</entry> + <entry></entry> + </row> + <row> + <entry><literal>term_width</literal></entry> + <entry>µ±·ÖÅäÒ»¸ö¿ØÖÆÌ¨Ê±Öն˵Ŀí¶È</entry> + <entry></entry> + </row> + <row> + <entry><literal>term_height</literal></entry> + <entry>µ±·ÖÅäÒ»¸ö¿ØÖÆÌ¨Ê±Öն˵ĸ߶È</entry> + <entry></entry> + </row> + <row> + <entry><literal>term_units</literal></entry> + <entry>Óë term_width ºÍ term_height һͬʹÓõĵ¥Ôª</entry> + <entry><constant>SSH2_TERM_UNIT_CHARS</constant></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + + + </section> + + <section id="wrappers.audio"> + <title>ÒôƵÁ÷</title> + <simpara><filename>ogg://</filename> PHP 4.3.0 ¼°¸ü¸ß°æ±¾ (PECL) </simpara> + + <itemizedlist> + <listitem><simpara><filename>ogg://soundfile.ogg</filename></simpara></listitem> + <listitem><simpara><filename>ogg:///path/to/soundfile.ogg</filename></simpara></listitem> + <listitem><simpara><filename>ogg://http://www.example.com/path/to/soundstream.ogg</filename></simpara></listitem> + </itemizedlist> + + <note> + <title>´Ë·â×°Æ÷ĬÈÏûÓÐÆôÓÃ</title> + <simpara> + ҪʹÓà <filename>ogg://</filename> ·â×°Æ÷£¬Äú±ØÐë°²×° <ulink url="&url.pecl.package;oggvorbis">OGG/Vorbis</ulink> À©Õ¹¡£¿ÉÓÃÔÚ <ulink url="&url.pecl;">PECL</ulink> ÕÒµ½¡£ + </simpara> + </note> + + <simpara> + ͨ¹ý <filename>ogg://</filename> ·â×°Æ÷´ò¿ªµÄÎļþ£¬±»µ±×÷ʹÓà OGG/Vorbis ±àÂëѹËõµÄÒôƵÎļþÀ´¶ÁÈ¡¡£ÀàËÆµØ£¬Í¨¹ý <filename>ogg://</filename> ·â×°Æ÷дÈë»ò¸½¼ÓµÄÎļþ£¬±»µ±×÷ʹÓà OGG/Vorbis ±àÂëѹËõµÄÒôƵÎļþÀ´Ð´Èë¡£ + <function>stream_get_meta_data</function>£¬µ±Ê¹ÓÃÔÚ´ò¿ª¶ÁÈ¡µÄ OGG/Vorbis Îļþʱ£¬·µ»Ø¸ÃÎļþÁ÷µÄÏêϸÐÅÏ¢£¬°üÀ¨£º<parameter>vendor</parameter> ±êÇ©£¬ + <parameter>comments</parameter>£¬ + <parameter>channels</parameter>, <parameter>rate</parameter> ²ÉÑùÂÊ, + ºÍ±àÂ뷶Χ¡£±àÂ뷶ΧÓÃÈçϲÎÊýÃèÊö£º + <parameter>bitrate_lower</parameter>, <parameter>bitrate_upper</parameter>, + <parameter>bitrate_nominal</parameter>, ºÍ <parameter>bitrate_window</parameter>¡£ + </simpara> + + <para> + <table> + <title>·âװЭÒéÕªÒª</title> <tgroup cols="2"> <thead> <row> @@ -523,38 +986,106 @@ </thead> <tbody> <row> - <entry>Restricted by <literal>allow_url_fopen</literal>.</entry> - <entry>No</entry> + <entry>ÊÜÏÞÓÚ <link linkend="ini.allow-url-fopen">allow_url_fopen</link>¡£</entry> + <entry>·ñ</entry> + </row> + <row> + <entry>ÔÊÐí¶ÁÈ¡</entry> + <entry>ÊÇ</entry> + </row> + <row> + <entry>ÔÊÐíдÈë</entry> + <entry>ÊÇ</entry> </row> <row> - <entry>Allows Reading</entry> - <entry>Yes</entry> + <entry>ÔÊÐí¸½¼Ó</entry> + <entry>ÊÇ</entry> </row> <row> - <entry>Allows Writing</entry> - <entry>Yes</entry> + <entry>ÔÊÐíͬʱ¶Áд</entry> + <entry>·ñ</entry> </row> <row> - <entry>Allows Appending</entry> - <entry>Yes</entry> + <entry>Ö§³Ö <function>stat</function></entry> + <entry>·ñ</entry> </row> <row> - <entry>Allows Simultaneous Reading and Writing</entry> - <entry>No</entry> + <entry>Ö§³Ö <function>unlink</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rename</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>mkdir</function></entry> + <entry>·ñ</entry> + </row> + <row> + <entry>Ö§³Ö <function>rmdir</function></entry> + <entry>·ñ</entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <para> + <table> + <title>ÉÏÏÂÎÄÑ¡Ïî</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Ãû³Æ</entry> + <entry>Ó÷¨</entry> + <entry>ĬÈÏ</entry> + <entry>ģʽ</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>pcm_mode</literal></entry> + <entry> + ¶ÁȡʱʹÓÃÈçÏ PCM ±àÂëÖ®Ò»: + <constant>OGGVORBIS_PCM_U8</constant>, <constant>OGGVORBIS_PCM_S8</constant>, + <constant>OGGVORBIS_PCM_U16_BE</constant>, <constant>OGGVORBIS_PCM_S16_BE</constant>, + <constant>OGGVORBIS_PCM_U16_LE</constant>, ºÍ <constant>OGGVORBIS_PCM_S16_LE</constant>¡£ + (8 »ò 16 λ£¬Ç©Ãû»òδǩÃû£¬´ó»òСµÄ endian) + </entry> + <entry>OGGVORBIS_PCM_S16_LE</entry> + <entry>¶ÁÈ¡</entry> + </row> + <row> + <entry><literal>rate</literal></entry> + <entry> + ÊäÈëÊý¾ÝµÄ²ÉÑùÂÊ£¬µ¥Î»Îª Hz + </entry> + <entry>44100</entry> + <entry>дÈë/¸½¼Ó</entry> + </row> + <row> + <entry><literal>bitrate</literal></entry> + <entry> + Èô¸øµÄֵΪÕûÊý£¬ÔòÊÇÓù̶¨µÄ±ÈÌØÂʽøÐбàÂë¡£(16000 µ½ 131072) + Èô¸øµÄֵΪ¸¡µãÊý£¬ÔòʹÓÿɱäµÄ±ÈÌØÂÊÆ·ÖÊ¡£(-1.0 µ½ 1.0) + </entry> + <entry>128000</entry> + <entry>дÈë/¸½¼Ó</entry> </row> <row> - <entry>Supports <function>stat</function></entry> + <entry><literal>channels</literal></entry> <entry> - No, use the normal <literal>file://</literal> wrapper - to stat compressed files. + Òª±àÂëµÄÉùµÀµÄÊýÁ¿£¬µäÐÍΪ 1 (µ¥ÉùµÀ), »ò 2 (Á¢ÌåÉù)¡£×î¸ßÖ§³Ö 16 ÉùµÀ¡£ </entry> + <entry>2</entry> + <entry>дÈë/¸½¼Ó</entry> </row> <row> - <entry>Supports <function>unlink</function></entry> + <entry><literal>comments</literal></entry> <entry> - No, use the normal <literal>file://</literal> wrapper - to unlink compressed files. + ±àÂëµ½Òô¹ìÍ·²¿µÄ×Ö·û´®Êý×é¡£ </entry> + <entry/> + <entry>дÈë/¸½¼Ó</entry> </row> </tbody> </tgroup>
« previous php.doc.zh (#1941) next »