[PHP-DOC] cvs: phpdoc /en/features remote-files.xml From: Egon Schmid (eschmid <email protected>)
Date: 07/30/00

eschmid Sun Jul 30 09:36:43 2000 EDT

  Modified files:
    /phpdoc/en/features remote-files.xml
  Log:
  Used CDATA sections and &quot;
  
Index: phpdoc/en/features/remote-files.xml
diff -u phpdoc/en/features/remote-files.xml:1.3 phpdoc/en/features/remote-files.xml:1.4
--- phpdoc/en/features/remote-files.xml:1.3 Wed Jul 5 03:24:17 2000
+++ phpdoc/en/features/remote-files.xml Sun Jul 30 09:36:43 2000
@@ -2,48 +2,52 @@
   <title>Using remote files</title>
 
   <para>
- As long as support for the "URL fopen wrapper" is enabled when
+ As long as support for the &quot;URL fopen wrapper&quot; is enabled when
    you configure PHP (which it is unless you explicitly pass the
    <option>--disable-url-fopen-wrapper</option> flag to configure),
    you can use HTTP and FTP URLs with most functions that take a
    filename as a parameter, including the <function>require</function>
    and <function>include</function> statements.
-
- <note>
- <para>
- You can't use remote files in <function>include</function> and
- <function>require</function> statements on Windows.</para>
- </note></para>
-
+ </para>
+ <para>
+ <note>
+ <para>
+ You can't use remote files in <function>include</function> and
+ <function>require</function> statements on Windows.
+ </para>
+ </note>
+ </para>
   <para>
    For example, you can use this to open a file on a remote web server,
    parse the output for the data you want, and then use that data in a
    database query, or simply to output it in a style matching the rest
- of your website.</para>
-
+ of your website.
+ </para>
   <para>
    <example>
     <title>Getting the title of a remote page</title>
- <programlisting>
-&lt;?php
- $file = fopen("http://www.php.net/", "r");
- if (!$file) {
- echo "&lt;p>Unable to open remote file.\n";
+ <programlisting role="php">
+<![CDATA[
+<?php
+$file = fopen ("http://www.php.net/", "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("&lt;title>(.*)&lt;/title>", $line, $out)) {
- $title = $out[1];
- break;
+}
+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);
+}
+fclose($file);
 ?&gt;
+]]>
     </programlisting>
- </example></para>
-
+ </example>
+ </para>
   <para>
    You can also write to files on an FTP as long you connect as a user
    with the correct access rights, and the file doesn't exist already.
@@ -51,32 +55,38 @@
    the username (and possibly password) within the URL, such as
    'email protected>?subject=Re:%20[PHP-DOC]%20cvs:%20phpdoc%20/en/features%20remote-files.xml&replyto=cvseschmid964975003 <email protected>">password <email protected>/path/to/file">ftp://user:password <email protected>/path/to/file'. (You can use the
    same sort of syntax to access files via HTTP when they require Basic
- authentication.)</para>
-
+ authentication.)
+ </para>
   <para>
    <example>
     <title>Storing data on a remote server</title>
- <programlisting>
-&lt;?php
- $file = fopen("ftp://ftp.php.net/incoming/outputfile", "w");
- if (!$file) {
- echo "&lt;p>Unable to open remote file for writing.\n";
+ <programlisting role="php">
+<![CDATA[
+<?php
+$file = fopen ("ftp://ftp.php.net/incoming/outputfile", "w");
+if (!$file) {
+ echo "<p>Unable to open remote file for writing.\n";
     exit;
- }
- /* Write the data here. */
- fputs($file, "$HTTP_USER_AGENT\n");
- fclose($file);
-?&gt;
+}
+/* Write the data here. */
+fputs ($file, "$HTTP_USER_AGENT\n");
+fclose ($file);
+?>
+]]>
     </programlisting>
    </example>
-
- <note>
- <para>
- You might get the idea from the example above to use this technique to
- write to a remote log, but as mentioned above, you can only write to
- a new file using the URL fopen() wrappers. To do distributed logging
- like that, you should take a look at <function>syslog</function>.</para>
- </note></para>
+ </para>
+ <para>
+ <note>
+ <para>
+ You might get the idea from the example above to use this
+ technique to write to a remote log, but as mentioned above, you
+ can only write to a new file using the URL fopen() wrappers. To
+ do distributed logging like that, you should take a look at
+ <function>syslog</function>.
+ </para>
+ </note>
+ </para>
 
  </chapter>
 
@@ -90,7 +100,7 @@
 sgml-indent-step:1
 sgml-indent-data:t
 sgml-parent-document:nil
-sgml-default-dtd-file:"../manual.ced"
+sgml-default-dtd-file:"../../manual.ced"
 sgml-exposed-tags:nil
 sgml-local-catalogs:nil
 sgml-local-ecat-files:nil