reference/ftp/functions/ftp-rename.xml
6ce59dacb46cddfc09b3a44f25632db264ab786a
...
...
@@ -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.
...
...
@@ -53,9 +51,27 @@
53
51
&reftitle.returnvalues;
54
52
<para>
55
53
&return.success; Upon failure (such as attempting to rename a non-existent
56
-
file), an <literal>E_WARNING</literal> error will be emitted.
54
+
file), an <constant>E_WARNING</constant> error will be emitted.
57
55
</para>
58
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
+
59
75
<refsect1 role="examples">
60
76
&reftitle.examples;
61
77
<para>
...
...
@@ -67,21 +83,22 @@
67
83
$old_file = 'somefile.txt.bak';
68
84
$new_file = 'somefile.txt';
69
85

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

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

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

83
-
// close the connection
84
-
ftp_close($conn_id);
99
+
// Close the connection
100
+
ftp_close($ftp);
101
+

85
102
?>
86
103
]]>
87
104
</programlisting>
...
...
@@ -89,7 +106,6 @@ ftp_close($conn_id);
89
106
</para>
90
107
</refsect1>
91
108
</refentry>
92
-

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