reference/ftp/functions/ftp-rename.xml
4d1c34c9b7a30cfc3a59641122c707a2812cfed7
...
...
@@ -9,9 +9,9 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>ftp_rename</methodname>
12
-
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
13
-
<methodparam><type>string</type><parameter>oldname</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>newname</parameter></methodparam>
12
+
<methodparam><type>FTP\Connection</type><parameter>ftp</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>from</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>to</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
<function>ftp_rename</function> renames a file or a directory on the FTP
...
...
@@ -23,15 +23,13 @@
23
23
<para>
24
24
<variablelist>
25
25
<varlistentry>
26
-
<term><parameter>ftp_stream</parameter></term>
26
+
<term><parameter>ftp</parameter></term>
27
27
<listitem>
28
-
<para>
29
-
The link identifier of the FTP connection.
30
-
</para>
28
+
&ftp.parameter.ftp;
31
29
</listitem>
32
30
</varlistentry>
33
31
<varlistentry>
34
-
<term><parameter>oldname</parameter></term>
32
+
<term><parameter>from</parameter></term>
35
33
<listitem>
36
34
<para>
37
35
The old file/directory name.
...
...
@@ -39,7 +37,7 @@
39
37
</listitem>
40
38
</varlistentry>
41
39
<varlistentry>
42
-
<term><parameter>newname</parameter></term>
40
+
<term><parameter>to</parameter></term>
43
41
<listitem>
44
42
<para>
45
43
The new name.
...
...
@@ -52,9 +50,28 @@
52
50
<refsect1 role="returnvalues">
53
51
&reftitle.returnvalues;
54
52
<para>
55
-
&return.success;
53
+
&return.success; Upon failure (such as attempting to rename a non-existent
54
+
file), an <literal>E_WARNING</literal> error will be emitted.
56
55
</para>
57
56
</refsect1>
57
+

58
+
<refsect1 role="changelog">
59
+
&reftitle.changelog;
60
+
<informaltable>
61
+
<tgroup cols="2">
62
+
<thead>
63
+
<row>
64
+
<entry>&Version;</entry>
65
+
<entry>&Description;</entry>
66
+
</row>
67
+
</thead>
68
+
<tbody>
69
+
&ftp.changelog.ftp-param;
70
+
</tbody>
71
+
</tgroup>
72
+
</informaltable>
73
+
</refsect1>
74
+
58
75
<refsect1 role="examples">
59
76
&reftitle.examples;
60
77
<para>
...
...
@@ -67,20 +84,20 @@ $old_file = 'somefile.txt.bak';
67
84
$new_file = 'somefile.txt';
68
85

69
86
// set up basic connection
70
-
$conn_id = ftp_connect($ftp_server);
87
+
$ftp = ftp_connect($ftp_server);
71
88

72
89
// login with username and password
73
-
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
90
+
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
74
91

75
92
// try to rename $old_file to $new_file
76
-
if (ftp_rename($conn_id, $old_file, $new_file)) {
93
+
if (ftp_rename($ftp, $old_file, $new_file)) {
77
94
echo "successfully renamed $old_file to $new_file\n";
78
95
} else {
79
96
echo "There was a problem while renaming $old_file to $new_file\n";
80
97
}
81
98

82
99
// close the connection
83
-
ftp_close($conn_id);
100
+
ftp_close($ftp);
84
101
?>
85
102
]]>
86
103
</programlisting>
...
...
@@ -88,7 +105,6 @@ ftp_close($conn_id);
88
105
</para>
89
106
</refsect1>
90
107
</refentry>
91
-

92
108
<!-- Keep this comment at the end of the file
93
109
Local variables:
94
110
mode: sgml
95
111