reference/ftp/functions/ftp-nb-fget.xml
4d1c34c9b7a30cfc3a59641122c707a2812cfed7
...
...
@@ -9,11 +9,11 @@
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>int</type><methodname>ftp_nb_fget</methodname>
12
-
<methodparam><type>resource</type><parameter>ftp_stream</parameter></methodparam>
13
-
<methodparam><type>resource</type><parameter>handle</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>remote_file</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>FTP_IMAGE</constant></initializer></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>resource</type><parameter>stream</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_fget</function> retrieves a remote file from the FTP
...
...
@@ -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>handle</parameter></term>
39
+
<term><parameter>stream</parameter></term>
42
40
<listitem>
43
41
<para>
44
42
An open file pointer in which we store the data.
...
...
@@ -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>
...
...
@@ -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>
...
...
@@ -115,19 +114,19 @@
115
114
$file = 'index.php';
116
115
$fp = fopen($file, 'w');
117
116

118
-
$conn_id = ftp_connect($ftp_server);
117
+
$ftp = ftp_connect($ftp_server);
119
118

120
-
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
119
+
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
121
120

122
-
// Initate the download
123
-
$ret = ftp_nb_fget($conn_id, $fp, $file, FTP_BINARY);
121
+
// Initiate the download
122
+
$ret = ftp_nb_fget($ftp, $fp, $file, FTP_BINARY);
124
123
while ($ret == FTP_MOREDATA) {
125
124

126
125
// Do whatever you want
127
126
echo ".";
128
127

129
128
// Continue downloading...
130
-
$ret = ftp_nb_continue($conn_id);
129
+
$ret = ftp_nb_continue($ftp);
131
130
}
132
131
if ($ret != FTP_FINISHED) {
133
132
echo "There was an error downloading the file...";
...
...
@@ -154,7 +153,6 @@ fclose($fp);
154
153
</para>
155
154
</refsect1>
156
155
</refentry>
157
-

158
156
<!-- Keep this comment at the end of the file
159
157
Local variables:
160
158
mode: sgml
161
159