cvs: phpdoc-zh /features remote-files.xml

From: Date: Sat, 20 Jul 2002 23:35:10 +0000
Subject: cvs: phpdoc-zh /features remote-files.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-172@lists.php.net to get a copy of this message
thomaslio Sat Jul 20 19:35:10 2002 EDT Modified files: /phpdoc-zh/features remote-files.xml Log: spoken problem fixed Index: phpdoc-zh/features/remote-files.xml diff -u phpdoc-zh/features/remote-files.xml:1.2 phpdoc-zh/features/remote-files.xml:1.3 --- phpdoc-zh/features/remote-files.xml:1.2 Tue Jul 16 11:25:40 2002 +++ phpdoc-zh/features/remote-files.xml Sat Jul 20 19:35:10 2002 @@ -1,110 +1,108 @@ -<?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.10 $ --> - <chapter id="features.remote-files"> - <title>ʹÓÃÔ¶³ÌÎļþ</title> - - <para> - ÐèÒªÖ§³Ö &quot;URL fopen wrapper&quot; ¹¦ÄÜ£¬ÄãÐèÅäÖÃPHP - (³ý·ÇÄãÃ÷È·µÄʹÓà - <option>--disable-url-fopen-wrapper</option> ±êÖ¾ ( - Ò»Ö±µ½°æ±¾ 4.0.3) »òÕßÉèÖà <parameter>allow_url_fopen</parameter> ÔÚ &php.ini ¹Ø±Õ; - (¶ÔÓÚа汾))£¬ - Äã¿ÉÒÔʹÓà HTTP ºÍ FTP µØÖ·ÔÚ¸ü¶àº¯ÊýÖУ¬Ò²¿ÉÒÔ°Ñ - ÎļþÃû×÷Ϊ²ÎÊý£¬ °üÀ¨ <function>require</function> - ºÍ <function>include</function> ÉùÃ÷¡£ - </para> - <para> - <note> - <para> - Windows°æ±¾µÄ <literal>PHP</literal> ÔÚµ±Ç°²»Ö§³ÖÒÔϺ¯ÊýµÄ - Ô¶³ÌÎļþ·ÃÎÊ: - <function>include</function>£¬ <function>include_once</function>£¬ - <function>require</function> ºÍ <function>require_once</function>¡£ - </para> - </note> - </para> - <para> - ±ÈÈ磬 Äã¿ÉÒÔʹÓÃÕâ¸öÔÚÔ¶³Ìweb·þÎñÆ÷´ò¿ªÒ»¸öÎļþ£¬ - ½âÎöÄãÐèÒªÊä³öµÄÊý¾Ý£¬È»ºóʹÓÃÕâЩÊý¾ÝÔÚÊý¾Ý¿â»òÕß¼òµ¥µÄÊä³öµ½ÄãµÄÍøÕ¾¼òµ¥µÄÑùʽƥÅä¡£ - </para> - <para> - <example> - <title>»ñµÃÒ»¸öÔ¶³ÌÒ³ÃæµÄ±êÌâ</title> - <programlisting role="php"> -<![CDATA[ -<?php -$file = fopen ("http://www.example.com/"£¬ "r"); -if (!$file) { - echo "<p>Unable to open remote file.\n"; - exit; -} -while (!feof ($file)) { - $line = fgets ($file£¬ 1024); - /* This only works if the title and its tags are on one line */ - if (eregi ("<title>(.*)</title>"£¬ $line£¬ $out)) { - $title = $out[1]; - break; - } -} -fclose($file); -?> -]]> - </programlisting> - </example> - </para> - <para> - µ±ÄãÁ¬½Óµ½Ò»¸öÓµÓÐÇ¡µ±µÄ·ÃÎÊȨÏÞµÄFTPºÍ¸ÃÎļþ²»´æÔÚµÄʱºò£¬Äã¿ÉÒÔдÎļþ¡£ - ÔÚÓû§Á¬½ÓµÄʱºò£¬³ýÁË'ÄäÃû'£¬Äã±ØÐëÖ¸¶¨Ò»¸öÃû×Ö (ÕýÈ·µÄÃÜÂë)ºÍµØÖ·£¬ ±ÈÈç - 'ftp://user:password@ftp.example.com/path/to/file'. (ËüÃÇÐèÒª»ù±¾µÄÈÏÖ¤£¬Äã¿ÉÒÔʹÓÃÏàͬµÄÓ﷨ȥ·ÃÎÊhttpµÄÎļþ¡£) - </para> - <para> - <example> - <title>±£´æÊý¾Ýµ½Ô¶³Ì·þÎñÆ÷</title> - <programlisting role="php"> -<![CDATA[ -<?php -$file = fopen ("ftp://ftp.example.com/incoming/outputfile"£¬ "w"); -if (!$file) { - echo "<p>Unable to open remote file for writing.\n"; - exit; -} -/* Write the data here. */ -fputs ($file£¬ $_SERVER['HTTP_USER_AGENT'] . "\n"); -fclose ($file); -?> -]]> - </programlisting> - </example> - </para> - <para> - <note> - <para> - Äã¿ÉÒÔ´ÓÉÏÃæµÄÀý×Ó»ñµÃÏ뷨ȥдԶ³Ì·ÃÎÊÈÕÖ¾¡£ µ«´ÓÒÔÉÏÀý×ÓÖУ¬ Äã¿ÉÒÔÓÃfopen()дÄãËùϲ»¶µÄ·ÃÎÊÈÕÖ¾µÄеÄÎļþ - £¬ ÄãÓ¦¸ÃÈ¥¹Û¿´ - <function>syslog</function>º¯Êý. - </para> - </note> - </para> - - </chapter> - -<!-- 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:"../../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 ---> +<?xml version="1.0" encoding="gb2312"?> +<!-- $Revision: 1.10 $ --> +<!-- $AUTHOR$ --> +<!-- EN-Revision: 1.18 Maintainer: thomaslio Status: ready --> + <chapter id="features.remote-files"> + <title>ʹÓÃÔ¶³ÌÎļþ</title> + + <para> + ÐèÒªÖ§³Ö &quot;URL fopen wrapper&quot; ¹¦ÄÜ£¬ÄãÐèÅäÖÃPHP + (³ý·ÇÄãÃ÷È·µÄʹÓà + <option>--disable-url-fopen-wrapper</option>±êÖ¾( + Ò»Ö±µ½°æ±¾ 4.0.3)»òÕßÉèÖÃ<parameter>allow_url_fopen</parameter>ÔÚ &php.ini ¹Ø±Õ; + (¶ÔÓÚа汾))£¬ + Äã¿ÉÒÔʹÓà HTTP ºÍ FTP µØÖ·ÔÚ¸ü¶àº¯ÊýÖУ¬Ò²¿ÉÒÔ°Ñ + ÎļþÃû×÷Ϊ²ÎÊý£¬°üÀ¨<function>require</function> + ºÍ <function>include</function>¡£ + </para> + <para> + <note> + <para> + Windows°æ±¾µÄ <literal>PHP</literal>ÔÚµ±Ç°²»Ö§³ÖÒÔϺ¯ÊýµÄ + Ô¶³ÌÎļþ·ÃÎÊ: + <function>include</function>£¬<function>include_once</function>£¬ + <function>require</function>ºÍ<function>require_once</function>¡£ + </para> + </note> + </para> + <para> + ±ÈÈ磬Äã¿ÉÒÔʹÓÃÕâ¸öÔÚÔ¶³Ìweb·þÎñÆ÷´ò¿ªÒ»¸öÎļþ£¬½âÎöÄãÐèÒªÊä³öµÄÊý¾Ý£¬È»ºóʹÓÃÕâЩÊý¾ÝÔÚÊý¾Ý¿â»òÕß¼òµ¥µÄÊä³öµ½×°ÊÎÄãµÄÍøÕ¾¡£ + </para> + <para> + <example> + <title>»ñµÃÒ»¸öÔ¶³ÌÒ³ÃæµÄ±êÌâ</title> + <programlisting role="php"> +<![CDATA[ +<?php +$file = fopen ("http://www.example.com/"£¬ "r"); +if (!$file) { + echo "<p>Unable to open remote file.\n"; + exit; +} +while (!feof ($file)) { + $line = fgets ($file£¬ 1024); + /* This only works if the title and its tags are on one line */ + if (eregi ("<title>(.*)</title>"£¬ $line£¬ $out)) { + $title = $out[1]; + break; + } +} +fclose($file); +?> +]]> + </programlisting> + </example> + </para> + <para> + µ±ÄãÁ¬½Óµ½Ò»¸öÓµÓÐÇ¡µ±µÄ·ÃÎÊȨÏÞµÄFTPÒÔ¼°¸ÃÎļþ²»´æÔÚµÄʱºò£¬Äã¿ÉÒÔдÎļþ¡£ÔÚÓû§Á¬½ÓµÄʱºò£¬³ýÁË'ÄäÃû'£¬Äã±ØÐëÖ¸¶¨Ò»¸öÃû×Ö (ÕýÈ·µÄÃÜÂë)ºÍµØÖ·£¬±ÈÈç'ftp://user:password@ftp.example.com/path/to/file'.(ËüÃÇÐèÒª»ù±¾µÄÈÏÖ¤£¬Äã¿ÉÒÔʹÓÃÏàͬµÄÓ﷨ȥ·ÃÎÊhttpµÄÎļþ¡£) + </para> + <para> + <example> + <title>±£´æÊý¾Ýµ½Ô¶³Ì·þÎñÆ÷</title> + <programlisting role="php"> +<![CDATA[ +<?php +$file = fopen ("ftp://ftp.example.com/incoming/outputfile"£¬ "w"); +if (!$file) { + echo "<p>Unable to open remote file for writing.\n"; + exit; +} +/* Write the data here. */ +fputs ($file£¬ $_SERVER['HTTP_USER_AGENT'] . "\n"); +fclose ($file); +?> +]]> + </programlisting> + </example> + </para> + <para> + <note> + <para> + Äã¿ÉÒÔ´ÓÉÏÃæµÄÀý×Ó»ñµÃÖ÷ÒâȥдԶ³Ì·ÃÎÊÈÕÖ¾¡£´ÓÒÔÉÏÀý×ÓÖУ¬Äã¿ÉÒÔÓÃfopen()дÄãËùϲ»¶µÄ·ÃÎÊÈÕÖ¾µÄ·½Ê½£¬ÄãÓ¦¸ÃÈ¥²Î¿¼ + <function>syslog</function>º¯Êý¡£ + </para> + </note> + </para> + + </chapter> + +<!-- 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:"../../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 +-->

« previous php.doc.zh (#172) next »