reference/ftp/functions/ftp-connect.xml
4d1c34c9b7a30cfc3a59641122c707a2812cfed7
...
...
@@ -8,14 +8,14 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>resource</type><methodname>ftp_connect</methodname>
12
-
<methodparam><type>string</type><parameter>host</parameter></methodparam>
11
+
<type class="union"><type>FTP\Connection</type><type>false</type></type><methodname>ftp_connect</methodname>
12
+
<methodparam><type>string</type><parameter>hostname</parameter></methodparam>
13
13
<methodparam choice="opt"><type>int</type><parameter>port</parameter><initializer>21</initializer></methodparam>
14
14
<methodparam choice="opt"><type>int</type><parameter>timeout</parameter><initializer>90</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
<function>ftp_connect</function> opens an FTP connection to the
18
-
specified <parameter>host</parameter>.
18
+
specified <parameter>hostname</parameter>.
19
19
</para>
20
20
</refsect1>
21
21
<refsect1 role="parameters">
...
...
@@ -23,7 +23,7 @@
23
23
<para>
24
24
<variablelist>
25
25
<varlistentry>
26
-
<term><parameter>host</parameter></term>
26
+
<term><parameter>hostname</parameter></term>
27
27
<listitem>
28
28
<para>
29
29
The FTP server address. This parameter shouldn't have any trailing
...
...
@@ -44,7 +44,7 @@
44
44
<term><parameter>timeout</parameter></term>
45
45
<listitem>
46
46
<para>
47
-
This parameter specifies the timeout for all subsequent network operations.
47
+
This parameter specifies the timeout in seconds for all subsequent network operations.
48
48
If omitted, the default value is 90 seconds. The timeout can be changed and
49
49
queried at any time with <function>ftp_set_option</function> and
50
50
<function>ftp_get_option</function>.
...
...
@@ -57,9 +57,33 @@
57
57
<refsect1 role="returnvalues">
58
58
&reftitle.returnvalues;
59
59
<para>
60
-
Returns a FTP stream on success or &false; on error.
60
+
Returns an <classname>FTP\Connection</classname> instance on success,&return.falseforfailure;.
61
61
</para>
62
62
</refsect1>
63
+

64
+
<refsect1 role="changelog">
65
+
&reftitle.changelog;
66
+
<informaltable>
67
+
<tgroup cols="2">
68
+
<thead>
69
+
<row>
70
+
<entry>&Version;</entry>
71
+
<entry>&Description;</entry>
72
+
</row>
73
+
</thead>
74
+
<tbody>
75
+
<row>
76
+
<entry>8.1.0</entry>
77
+
<entry>
78
+
Returns an <classname>FTP\Connection</classname> instance now;
79
+
previously, a &resource; was returned.
80
+
</entry>
81
+
</row>
82
+
</tbody>
83
+
</tgroup>
84
+
</informaltable>
85
+
</refsect1>
86
+
63
87
<refsect1 role="examples">
64
88
&reftitle.examples;
65
89
<para>
...
...
@@ -72,7 +96,7 @@
72
96
$ftp_server = "ftp.example.com";
73
97

74
98
// set up a connection or die
75
-
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
99
+
$ftp = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
76
100

77
101
?>
78
102
]]>
...
...
@@ -90,7 +114,6 @@ $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
90
114
</para>
91
115
</refsect1>
92
116
</refentry>
93
-

94
117
<!-- Keep this comment at the end of the file
95
118
Local variables:
96
119
mode: sgml
97
120