reference/ftp/functions/ftp-nb-get.xml
ce3f60dc2f3ef847d44a08d84506464acff45bb6
...
...
@@ -8,12 +8,12 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>int</type><methodname>ftp_nb_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>
11
+
<type class="union"><type>int</type><type>false</type></type><methodname>ftp_nb_get</methodname>
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
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>resumepos</parameter><initializer>0</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_nb_get</function> retrieves a remote file from the FTP server,
...
...
@@ -30,15 +30,13 @@
30
30
<para>
31
31
<variablelist>
32
32
<varlistentry>
33
-
<term><parameter>ftp_stream</parameter></term>
33
+
<term><parameter>ftp</parameter></term>
34
34
<listitem>
35
-
<para>
36
-
The link identifier of the FTP connection.
37
-
</para>
35
+
&ftp.parameter.ftp;
38
36
</listitem>
39
37
</varlistentry>
40
38
<varlistentry>
41
-
<term><parameter>local_file</parameter></term>
39
+
<term><parameter>local_filename</parameter></term>
42
40
<listitem>
43
41
<para>
44
42
The local file path (will be overwritten if the file already exists).
...
...
@@ -46,7 +44,7 @@
46
44
</listitem>
47
45
</varlistentry>
48
46
<varlistentry>
49
-
<term><parameter>remote_file</parameter></term>
47
+
<term><parameter>remote_filename</parameter></term>
50
48
<listitem>
51
49
<para>
52
50
The remote file path.
...
...
@@ -63,7 +61,7 @@
63
61
</listitem>
64
62
</varlistentry>
65
63
<varlistentry>
66
-
<term><parameter>resumepos</parameter></term>
64
+
<term><parameter>offset</parameter></term>
67
65
<listitem>
68
66
<para>The position in the remote file to start downloading from.</para>
69
67
</listitem>
...
...
@@ -75,7 +73,7 @@
75
73
&reftitle.returnvalues;
76
74
<para>
77
75
Returns <constant>FTP_FAILED</constant> or <constant>FTP_FINISHED</constant>
78
-
or <constant>FTP_MOREDATA</constant>.
76
+
or <constant>FTP_MOREDATA</constant>, or &false; on failure to open the local file.
79
77
</para>
80
78
</refsect1>
81
79

...
...
@@ -90,6 +88,7 @@
90
88
</row>
91
89
</thead>
92
90
<tbody>
91
+
&ftp.changelog.ftp-param;
93
92
<row>
94
93
<entry>7.3.0</entry>
95
94
<entry>
...
...
@@ -112,14 +111,14 @@
112
111
<?php
113
112

114
113
// Initiate the download
115
-
$ret = ftp_nb_get($my_connection, "test", "README", FTP_BINARY);
114
+
$ret = ftp_nb_get($ftp, "test", "README", FTP_BINARY);
116
115
while ($ret == FTP_MOREDATA) {
117
116
118
117
// Do whatever you want
119
118
echo ".";
120
119

121
120
// Continue downloading...
122
-
$ret = ftp_nb_continue($my_connection);
121
+
$ret = ftp_nb_continue($ftp);
123
122
}
124
123
if ($ret != FTP_FINISHED) {
125
124
echo "There was an error downloading the file...";
...
...
@@ -136,9 +135,9 @@ if ($ret != FTP_FINISHED) {
136
135
<?php
137
136

138
137
// Initiate
139
-
$ret = ftp_nb_get($my_connection, "test", "README", FTP_BINARY,
138
+
$ret = ftp_nb_get($ftp, "test", "README", FTP_BINARY,
140
139
filesize("test"));
141
-
// OR: $ret = ftp_nb_get($my_connection, "test", "README",
140
+
// OR: $ret = ftp_nb_get($ftp, "test", "README",
142
141
// FTP_BINARY, FTP_AUTORESUME);
143
142
while ($ret == FTP_MOREDATA) {
144
143
...
...
@@ -146,7 +145,7 @@ while ($ret == FTP_MOREDATA) {
146
145
echo ".";
147
146

148
147
// Continue downloading...
149
-
$ret = ftp_nb_continue($my_connection);
148
+
$ret = ftp_nb_continue($ftp);
150
149
}
151
150
if ($ret != FTP_FINISHED) {
152
151
echo "There was an error downloading the file...";
...
...
@@ -166,16 +165,16 @@ if ($ret != FTP_FINISHED) {
166
165
<?php
167
166

168
167
// Disable Autoseek
169
-
ftp_set_option($my_connection, FTP_AUTOSEEK, false);
168
+
ftp_set_option($ftp, FTP_AUTOSEEK, false);
170
169

171
170
// Initiate
172
-
$ret = ftp_nb_get($my_connection, "newfile", "README", FTP_BINARY, 100);
171
+
$ret = ftp_nb_get($ftp, "newfile", "README", FTP_BINARY, 100);
173
172
while ($ret == FTP_MOREDATA) {
174
173

175
174
/* ... */
176
175
177
176
// Continue downloading...
178
-
$ret = ftp_nb_continue($my_connection);
177
+
$ret = ftp_nb_continue($ftp);
179
178
}
180
179
?>
181
180
]]>
...
...
@@ -202,7 +201,6 @@ while ($ret == FTP_MOREDATA) {
202
201
</para>
203
202
</refsect1>
204
203
</refentry>
205
-

206
204
<!-- Keep this comment at the end of the file
207
205
Local variables:
208
206
mode: sgml
209
207