reference/ftp/functions/ftp-get.xml
4d1c34c9b7a30cfc3a59641122c707a2812cfed7
...
...
@@ -9,11 +9,11 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>bool</type><methodname>ftp_get</methodname>
12
-
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
13
-
<methodparam><type>string</type><parameter>local_file</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
15
-
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>resumepos</parameter><initializer>0</initializer></methodparam>
12
+
<methodparam><type>FTP\Connection</type><parameter>ftp</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>local_filename</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>remote_filename</parameter></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>FTP_BINARY</constant></initializer></methodparam>
16
+
<methodparam choice="opt"><type>int</type><parameter>offset</parameter><initializer>0</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
<function>ftp_get</function> retrieves a remote file from the FTP server,
...
...
@@ -25,15 +25,13 @@
25
25
<para>
26
26
<variablelist>
27
27
<varlistentry>
28
-
<term><parameter>ftp_stream</parameter></term>
28
+
<term><parameter>ftp</parameter></term>
29
29
<listitem>
30
-
<para>
31
-
The link identifier of the FTP connection.
32
-
</para>
30
+
&ftp.parameter.ftp;
33
31
</listitem>
34
32
</varlistentry>
35
33
<varlistentry>
36
-
<term><parameter>local_file</parameter></term>
34
+
<term><parameter>local_filename</parameter></term>
37
35
<listitem>
38
36
<para>
39
37
The local file path (will be overwritten if the file already exists).
...
...
@@ -41,7 +39,7 @@
41
39
</listitem>
42
40
</varlistentry>
43
41
<varlistentry>
44
-
<term><parameter>remote_file</parameter></term>
42
+
<term><parameter>remote_filename</parameter></term>
45
43
<listitem>
46
44
<para>
47
45
The remote file path.
...
...
@@ -58,7 +56,7 @@
58
56
</listitem>
59
57
</varlistentry>
60
58
<varlistentry>
61
-
<term><parameter>resumepos</parameter></term>
59
+
<term><parameter>offset</parameter></term>
62
60
<listitem>
63
61
<para>
64
62
The position in the remote file to start downloading from.
...
...
@@ -74,6 +72,31 @@
74
72
&return.success;
75
73
</para>
76
74
</refsect1>
75
+

76
+
<refsect1 role="changelog">
77
+
&reftitle.changelog;
78
+
<informaltable>
79
+
<tgroup cols="2">
80
+
<thead>
81
+
<row>
82
+
<entry>&Version;</entry>
83
+
<entry>&Description;</entry>
84
+
</row>
85
+
</thead>
86
+
<tbody>
87
+
&ftp.changelog.ftp-param;
88
+
<row>
89
+
<entry>7.3.0</entry>
90
+
<entry>
91
+
The <parameter>mode</parameter> parameter is now optional. Formerly it
92
+
has been mandatory.
93
+
</entry>
94
+
</row>
95
+
</tbody>
96
+
</tgroup>
97
+
</informaltable>
98
+
</refsect1>
99
+

77
100
<refsect1 role="examples">
78
101
&reftitle.examples;
79
102
<para>
...
...
@@ -88,20 +111,20 @@ $local_file = 'local.zip';
88
111
$server_file = 'server.zip';
89
112

90
113
// set up basic connection
91
-
$conn_id = ftp_connect($ftp_server);
114
+
$ftp = ftp_connect($ftp_server);
92
115

93
116
// login with username and password
94
-
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
117
+
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
95
118

96
119
// try to download $server_file and save to $local_file
97
-
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
120
+
if (ftp_get($ftp, $local_file, $server_file, FTP_BINARY)) {
98
121
echo "Successfully written to $local_file\n";
99
122
} else {
100
123
echo "There was a problem\n";
101
124
}
102
125

103
126
// close the connection
104
-
ftp_close($conn_id);
127
+
ftp_close($ftp);
105
128

106
129
?>
107
130
]]>
...
...
@@ -109,29 +132,6 @@ ftp_close($conn_id);
109
132
</example>
110
133
</para>
111
134
</refsect1>
112
-
<refsect1 role="changelog">
113
-
&reftitle.changelog;
114
-
<para>
115
-
<informaltable>
116
-
<tgroup cols="2">
117
-
<thead>
118
-
<row>
119
-
<entry>&Version;</entry>
120
-
<entry>&Description;</entry>
121
-
</row>
122
-
</thead>
123
-
<tbody>
124
-
<row>
125
-
<entry>4.3.0</entry>
126
-
<entry>
127
-
<parameter>resumepos</parameter> was added.
128
-
</entry>
129
-
</row>
130
-
</tbody>
131
-
</tgroup>
132
-
</informaltable>
133
-
</para>
134
-
</refsect1>
135
135
<refsect1 role="seealso">
136
136
&reftitle.seealso;
137
137
<para>
...
...
@@ -144,7 +144,6 @@ ftp_close($conn_id);
144
144
</para>
145
145
</refsect1>
146
146
</refentry>
147
-

148
147
<!-- Keep this comment at the end of the file
149
148
Local variables:
150
149
mode: sgml
151
150