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>
15
-
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>resumepos</parameter><initializer>0</initializer></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
+
<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_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,9 +73,34 @@
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>
79
+

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

81
104
<refsect1 role="examples">
82
105
&reftitle.examples;
83
106
<para>
...
...
@@ -87,15 +110,15 @@
87
110
<![CDATA[
88
111
<?php
89
112

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

97
120
// Continue downloading...
98
-
$ret = ftp_nb_continue($my_connection);
121
+
$ret = ftp_nb_continue($ftp);
99
122
}
100
123
if ($ret != FTP_FINISHED) {
101
124
echo "There was an error downloading the file...";
...
...
@@ -111,10 +134,10 @@ if ($ret != FTP_FINISHED) {
111
134
<![CDATA[
112
135
<?php
113
136

114
-
// Initate
115
-
$ret = ftp_nb_get($my_connection, "test", "README", FTP_BINARY,
137
+
// Initiate
138
+
$ret = ftp_nb_get($ftp, "test", "README", FTP_BINARY,
116
139
filesize("test"));
117
-
// OR: $ret = ftp_nb_get($my_connection, "test", "README",
140
+
// OR: $ret = ftp_nb_get($ftp, "test", "README",
118
141
// FTP_BINARY, FTP_AUTORESUME);
119
142
while ($ret == FTP_MOREDATA) {
120
143
...
...
@@ -122,7 +145,7 @@ while ($ret == FTP_MOREDATA) {
122
145
echo ".";
123
146

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

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

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

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

182
204
<!-- Keep this comment at the end of the file
183
205
Local variables:
184
206
mode: sgml
185
207