didou           Thu May 29 10:49:38 2003 EDT

  Modified files:              
    /phpdoc/en/reference/ftp/functions  ftp-chdir.xml ftp-connect.xml 
                                        ftp-login.xml ftp-mkdir.xml 
                                        ftp-nlist.xml ftp-rawlist.xml 
                                        ftp-rmdir.xml ftp-size.xml 
  Log:
  some users notes integration, examples, see also and typos
  
Index: phpdoc/en/reference/ftp/functions/ftp-chdir.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-chdir.xml:1.4 
phpdoc/en/reference/ftp/functions/ftp-chdir.xml:1.5
--- phpdoc/en/reference/ftp/functions/ftp-chdir.xml:1.4 Tue Feb 18 13:09:02 2003
+++ phpdoc/en/reference/ftp/functions/ftp-chdir.xml     Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-chdir">
    <refnamediv>
@@ -14,11 +14,39 @@
       <methodparam><type>string</type><parameter>directory</parameter></methodparam>
      </methodsynopsis>
     <para> 
-     Changes to the specified <parameter>directory</parameter>.
+     Changes the current directory to the specified <parameter>directory</parameter>.
     </para>
     <para>
      &return.success;
     </para>
+    <example>
+     <title><function>ftp_chdir</function> example</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+
+// set up basic connection
+$conn_id = ftp_connect($ftp_server); 
+
+// login with username and password
+$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 
+
+// check connection
+if ((!$conn_id) || (!$login_result)) {
+    die("FTP connection has failed !");
+}
+
+echo "Current directory : ", ftp_pwd($conn_id), "\n";
+
+if (@ftp_chdir($conn_id, "somedir")) {
+    echo "Current directory is now : ", ftp_pwd($conn_id), "\n";
+} else { 
+    echo "Couldn't change directory\n";
+}
+?>
+]]>
+     </programlisting>
+    </example>
    </refsect1>
   </refentry>
 
Index: phpdoc/en/reference/ftp/functions/ftp-connect.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-connect.xml:1.5 
phpdoc/en/reference/ftp/functions/ftp-connect.xml:1.6
--- phpdoc/en/reference/ftp/functions/ftp-connect.xml:1.5       Fri Nov  8 05:35:22 
2002
+++ phpdoc/en/reference/ftp/functions/ftp-connect.xml   Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-connect">
    <refnamediv>
@@ -19,7 +19,9 @@
     </para>  
     <para>
      <function>ftp_connect</function> opens an FTP connection to the
-     specified <parameter>host</parameter>.  The <parameter>port</parameter>
+     specified <parameter>host</parameter>. <parameter>host</parameter>
+     shouldn't have any trailing slashes and shouldn't be prefixed with
+     <literal>ftp://</literal>. The <parameter>port</parameter>
      parameter specifies an alternate port to connect to.  If it is
      omitted or set to zero, then the default FTP port, 21, will be used.
     </para>
@@ -34,6 +36,24 @@
        The <parameter>timeout</parameter> parameter became available in PHP 4.2.0.
       </para>
      </note>
+    </para>
+    <example>
+     <title><function>ftp_connect</function> example</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+
+$ftp_server = "ftp.example.com";
+
+// set up a connection or die
+$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); 
+
+?>
+]]>  
+     </programlisting>
+    </example>
+    <para>
+     See also <function>ftp_close</function>.
     </para>
    </refsect1>
   </refentry>
Index: phpdoc/en/reference/ftp/functions/ftp-login.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-login.xml:1.4 
phpdoc/en/reference/ftp/functions/ftp-login.xml:1.5
--- phpdoc/en/reference/ftp/functions/ftp-login.xml:1.4 Tue Nov 12 06:57:54 2002
+++ phpdoc/en/reference/ftp/functions/ftp-login.xml     Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-login">
    <refnamediv>
@@ -20,6 +20,30 @@
     <para>
      &return.success;
     </para>
+    <example>
+     <title><function>ftp_login</function> example</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+                     
+$ftp_server = "ftp.example.com";
+$ftp_user = "foo";
+$ftp_pass = "bar";
+
+// set up a connection or die
+$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); 
+
+// try to login
+if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
+    echo "Connected as [EMAIL PROTECTED]";
+} else {
+    echo "Couldn't connect as $ftp_user\n";
+}
+    
+?>
+]]>  
+     </programlisting>
+    </example>
    </refsect1>
   </refentry>
 
Index: phpdoc/en/reference/ftp/functions/ftp-mkdir.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-mkdir.xml:1.3 
phpdoc/en/reference/ftp/functions/ftp-mkdir.xml:1.4
--- phpdoc/en/reference/ftp/functions/ftp-mkdir.xml:1.3 Tue Sep 17 05:46:57 2002
+++ phpdoc/en/reference/ftp/functions/ftp-mkdir.xml     Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-mkdir">
    <refnamediv>
@@ -18,6 +18,9 @@
     </para>
     <para>
      Returns the newly created directory name on success or &false; on error.
+    </para>
+    <para>
+     See also <function>ftp_rmdir</function>.
     </para>
    </refsect1>
   </refentry>
Index: phpdoc/en/reference/ftp/functions/ftp-nlist.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-nlist.xml:1.3 
phpdoc/en/reference/ftp/functions/ftp-nlist.xml:1.4
--- phpdoc/en/reference/ftp/functions/ftp-nlist.xml:1.3 Tue Sep 17 05:46:57 2002
+++ phpdoc/en/reference/ftp/functions/ftp-nlist.xml     Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-nlist">
    <refnamediv>
@@ -16,6 +16,36 @@
     <para>
      Returns an array of filenames from the specified directory
      on success or &false; on error.
+    </para>
+    <example>
+     <title><function>ftp_nlist</function> example</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+
+// set up basic connection
+$conn_id = ftp_connect($ftp_server);
+$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
+
+// check connection
+if ((!$conn_id) || (!$login_result)) {
+    die("FTP connection has failed !");
+}
+
+// get contents of the root directory
+$contents = ftp_nlist($conn_id, "/");
+
+// print each entry
+foreach ($contents as $entry) {
+    echo $entry, "<br />\n";
+}
+
+?>
+]]>  
+     </programlisting>
+    </example>
+    <para>
+     See also <function>ftp_rawlist</function>.
     </para>
    </refsect1>
   </refentry>
Index: phpdoc/en/reference/ftp/functions/ftp-rawlist.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-rawlist.xml:1.2 
phpdoc/en/reference/ftp/functions/ftp-rawlist.xml:1.3
--- phpdoc/en/reference/ftp/functions/ftp-rawlist.xml:1.2       Wed Apr 17 02:38:16 
2002
+++ phpdoc/en/reference/ftp/functions/ftp-rawlist.xml   Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-rawlist">
    <refnamediv>
@@ -19,6 +19,9 @@
      to one line of text.  The output is not parsed in any way.  The
      system type identifier returned by <function>ftp_systype</function>
      can be used to determine how the results should be interpreted.
+    </para>
+    <para>
+     See also <function>ftp_nlist</function>.
     </para>
    </refsect1>
   </refentry>
Index: phpdoc/en/reference/ftp/functions/ftp-rmdir.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-rmdir.xml:1.4 
phpdoc/en/reference/ftp/functions/ftp-rmdir.xml:1.5
--- phpdoc/en/reference/ftp/functions/ftp-rmdir.xml:1.4 Tue Nov 12 06:57:54 2002
+++ phpdoc/en/reference/ftp/functions/ftp-rmdir.xml     Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-rmdir">
    <refnamediv>
@@ -15,9 +15,14 @@
      </methodsynopsis>
     <para> 
      Removes the specified <parameter>directory</parameter>.
+     <parameter>directory</parameter> must be either an absolute or relative
+     path to an empty directory.
     </para>
     <para>
      &return.success;
+    </para>
+    <para>
+     See also <function>ftp_mkdir</function>.
     </para>
    </refsect1>
   </refentry>
Index: phpdoc/en/reference/ftp/functions/ftp-size.xml
diff -u phpdoc/en/reference/ftp/functions/ftp-size.xml:1.2 
phpdoc/en/reference/ftp/functions/ftp-size.xml:1.3
--- phpdoc/en/reference/ftp/functions/ftp-size.xml:1.2  Wed Apr 17 02:38:17 2002
+++ phpdoc/en/reference/ftp/functions/ftp-size.xml      Thu May 29 10:49:37 2003
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
 <!-- splitted from ./en/functions/ftp.xml, last change in rev 1.2 -->
   <refentry id="function.ftp-size">
    <refnamediv>
@@ -14,12 +14,16 @@
       <methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
      </methodsynopsis>
     <para>
-     <function>ftp_size</function> returns the size of a file in bytes.  If an
-     error occurs, of if the file does not exist, -1 is returned.  Not
-     all servers support this feature.
+     <function>ftp_size</function> returns the size of a
+     <parameter>remote_file</parameter> in bytes. If an error occurs, or if the
+     given file does not exist, or is a directory, -1 is returned. Not all
+     servers support this feature.
     </para>
     <para>
      Returns the file size on success, or -1 on error.
+    </para>
+    <para>
+     See also <function>ftp_rawlist</function>.
     </para>
    </refsect1>
   </refentry>

-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to