some users notes integration, examples, see also and typos

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@129179 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2003-05-29 14:49:37 +00:00
parent aefc2c1956
commit d251962578
8 changed files with 130 additions and 13 deletions

View file

@ -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>

View file

@ -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>
@ -35,6 +37,24 @@
</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>

View file

@ -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 $ftp_user@$ftp_server\n";
} else {
echo "Couldn't connect as $ftp_user\n";
}
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>

View file

@ -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>
@ -19,6 +19,9 @@
<para>
Returns the newly created directory name on success or &false; on error.
</para>
<para>
See also <function>ftp_rmdir</function>.
</para>
</refsect1>
</refentry>

View file

@ -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>
@ -17,6 +17,36 @@
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>

View file

@ -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>
@ -20,6 +20,9 @@
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>

View file

@ -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,10 +15,15 @@
</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>

View file

@ -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,13 +14,17 @@
<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>