cvs: phpdoc-zh /features remote-files.xml
| From: | Dallas Thunder | Date: | Thu, 26 Sep 2002 09:16:03 +0000 |
| Subject: | cvs: phpdoc-zh /features remote-files.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-645@lists.php.net to get a copy of this message | ||
dallas Thu Sep 26 05:16:03 2002 EDT
Modified files:
/phpdoc-zh/features remote-files.xml
Log:
Update with EN ver and to UNIX file.
Index: phpdoc-zh/features/remote-files.xml
diff -u phpdoc-zh/features/remote-files.xml:1.7 phpdoc-zh/features/remote-files.xml:1.8
--- phpdoc-zh/features/remote-files.xml:1.7 Tue Aug 13 10:23:10 2002
+++ phpdoc-zh/features/remote-files.xml Thu Sep 26 05:16:03 2002
@@ -1,109 +1,109 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
-<!-- $Author: gregory$ -->
-<!-- EN-Revision: 1.19 Maintainer: thomaslio Status: ready -->
-<!-- CREDITS: Gregory -->
- <chapter id="features.remote-files">
- <title>ʹÓÃÔ¶³ÌÎļþ</title>
-
- <para>
- ÓÉÓÚ &php.ini; ÎļþÖ§³Ö <parameter>allow_url_fopen</parameter>
Ñ¡ÏÄú¿ÉÒÔÔÚ´ó¶àÊýÐèÒªÓÃÎļþÃû×÷Ϊ²ÎÊýµÄº¯ÊýÖÐʹÓÃ
HTTP ºÍ FTP URL À´´úÌæÎļþÃû¡£Í¬Ê±£¬ÄúÒ²¿ÉÒÔÔÚ
<function>include</function>¡¢<function>include_once</function>¡¢<function>require</function>
¼°
- <function>require_once</function> Óï¾äÖÐʹÓà URL¡£
- </para>
- <para>
- <note>
- <para>
- ÒªÔÚ PHP 4.0.3 ¼°ÆäÒÔºó°æ±¾ÖÐʹÓà URL£¬ÄúÐèÒªÓÃ
<option>--enable-url-fopen-wrapper</option> ²ÎÊýÀ´ÅäÖà PHP¡£
- </para>
- </note>
- </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>
- Èç¹ûÄúÓÃÓкϷ¨µÄ·ÃÎÊȨÏÞ£¬ÒÔÒ»¸öÓû§µÄÉí·ÝºÍij FTP
·þÎñÆ÷½¨Á¢ÁËÁ´½Ó£¬Äú»¹¿ÉÒÔÏò¸Ã FTP
·þÎñÆ÷¶ËµÄÎļþ½øÐÐд²Ù×÷¡£Äú½öÄÜÓø÷½·¨À´´´½¨ÐµÄÎļþ£»Èç¹ûÄú³¢ÊÔ¸²¸ÇÒѾ´æÔÚµÄÎļþ£¬<function>fopen</function>
º¯ÊýµÄ²Ù×÷½«»áʧ°Ü¡£
- </para>
- <para>
-
ÒªÒÔ¡°anonymous¡±ÒÔÍâµÄÓû§ÃûÁ¬½Ó·þÎñÆ÷£¬ÄúÐèÒªÖ¸Ã÷Óû§Ãû£¨ÉõÖÁÃÜÂ룩£¬ÀýÈç¡°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() ·½Ê½´ò¿ªµÄ URL
ÖУ¬Äú½öÄܶÔÐÂÎļþ½øÐÐд²Ù×÷¡£Èç¹ûÔ¶³ÌÎļþÒѾ´æÔÚ
<function>fopen</function>
º¯ÊýµÄ²Ù×÷½«»áʧ°Ü¡£Òª½øÐÐÀàËÆµÄ·Ö²¼Ê½ÈÕÖ¾²Ù×÷£¬Äú¿ÉÒԲο¼
<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.7 $ -->
+<!-- $Author: gregory$ -->
+<!-- EN-Revision: 1.20 Maintainer: thomaslio Status: ready -->
+<!-- CREDITS: Gregory -->
+ <chapter id="features.remote-files">
+ <title>ʹÓÃÔ¶³ÌÎļþ</title>
+
+ <para>
+ Ö»ÒªÔÚ &php.ini; ÎļþÖ줻îÁË
<parameter>allow_url_fopen</parameter>
Ñ¡ÏÄú¿ÉÒÔÔÚ´ó¶àÊýÐèÒªÓÃÎļþÃû×÷Ϊ²ÎÊýµÄº¯ÊýÖÐʹÓÃ
HTTP ºÍ FTP URL À´´úÌæÎļþÃû¡£Í¬Ê±£¬ÄúÒ²¿ÉÒÔÔÚ
<function>include</function>¡¢<function>include_once</function>¡¢<function>require</function>
¼°
+ <function>require_once</function> Óï¾äÖÐʹÓà URL¡£
+ </para>
+ <para>
+ <note>
+ <para>
+ ÒªÔÚ PHP 4.0.3 ¼°ÆäÒÔºó°æ±¾ÖÐʹÓà URL£¬ÄúÐèÒªÓÃ
<option>--enable-url-fopen-wrapper</option> ²ÎÊýÀ´ÅäÖà PHP¡£
+ </para>
+ </note>
+ </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>
+ Èç¹ûÄúÓÃÓкϷ¨µÄ·ÃÎÊȨÏÞ£¬ÒÔÒ»¸öÓû§µÄÉí·ÝºÍij FTP
·þÎñÆ÷½¨Á¢ÁËÁ´½Ó£¬Äú»¹¿ÉÒÔÏò¸Ã FTP
·þÎñÆ÷¶ËµÄÎļþ½øÐÐд²Ù×÷¡£Äú½öÄÜÓø÷½·¨À´´´½¨ÐµÄÎļþ£»Èç¹ûÄú³¢ÊÔ¸²¸ÇÒѾ´æÔÚµÄÎļþ£¬<function>fopen</function>
º¯ÊýµÄ²Ù×÷½«»áʧ°Ü¡£
+ </para>
+ <para>
+
ÒªÒÔ¡°anonymous¡±ÒÔÍâµÄÓû§ÃûÁ¬½Ó·þÎñÆ÷£¬ÄúÐèÒªÖ¸Ã÷Óû§Ãû£¨ÉõÖÁÃÜÂ룩£¬ÀýÈç¡°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() ·½Ê½´ò¿ªµÄ URL
ÖУ¬Äú½öÄܶÔÐÂÎļþ½øÐÐд²Ù×÷¡£Èç¹ûÔ¶³ÌÎļþÒѾ´æÔÚ
<function>fopen</function>
º¯ÊýµÄ²Ù×÷½«»áʧ°Ü¡£Òª½øÐÐÀàËÆµÄ·Ö²¼Ê½ÈÕÖ¾²Ù×÷£¬Äú¿ÉÒԲο¼
<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
+-->