reference/ftp/functions/ftp-ssl-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_ssl_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_ssl_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_ssl_connect</function> opens an <emphasis>explicit</emphasis> SSL-FTP connection to the
18
-
specified <parameter>host</parameter>. That implies that
18
+
specified <parameter>hostname</parameter>. That implies that
19
19
<function>ftp_ssl_connect</function> will succeed even if the server is not
20
20
configured for SSL-FTP, or its certificate is invalid. Only when
21
21
<function>ftp_login</function> is called, the client will send the
...
...
@@ -25,11 +25,11 @@
25
25
<note>
26
26
<title>Why this function may not exist</title>
27
27
<para>
28
-
<function>ftp_ssl_connect</function> is only available if both
28
+
Before PHP 7.0.0, <function>ftp_ssl_connect</function> was only available if both
29
29
the ftp module and the <link linkend="ref.openssl">OpenSSL</link>
30
-
support is built statically into php, this means that on Windows this
31
-
function will be undefined in the official PHP builds. To make this
32
-
function available on Windows you must compile your own PHP binaries.
30
+
support have been built statically into php; this means that on Windows this
31
+
function had been undefined in the official PHP builds. To have this
32
+
function available on Windows, it had been necessary to compile own PHP binaries.
33
33
</para>
34
34
</note>
35
35
<note>
...
...
@@ -44,7 +44,7 @@
44
44
<para>
45
45
<variablelist>
46
46
<varlistentry>
47
-
<term><parameter>host</parameter></term>
47
+
<term><parameter>hostname</parameter></term>
48
48
<listitem>
49
49
<para>
50
50
The FTP server address. This parameter shouldn't have any trailing
...
...
@@ -78,33 +78,31 @@
78
78
<refsect1 role="returnvalues">
79
79
&reftitle.returnvalues;
80
80
<para>
81
-
Returns a SSL-FTP stream on success or &false; on error.
81
+
Returns an <classname>FTP\Connection</classname> instance on success,&return.falseforfailure;.
82
82
</para>
83
83
</refsect1>
84
84

85
85
<refsect1 role="changelog">
86
86
&reftitle.changelog;
87
-
<para>
88
-
<informaltable>
89
-
<tgroup cols="2">
90
-
<thead>
91
-
<row>
92
-
<entry>&Version;</entry>
93
-
<entry>&Description;</entry>
94
-
</row>
95
-
</thead>
96
-
<tbody>
97
-
<row>
98
-
<entry>5.2.2</entry>
99
-
<entry>
100
-
The function was changed to return &false; when it can't use an SSL
101
-
connection, instead of falling back to a non-SSL one as previously.
102
-
</entry>
103
-
</row>
104
-
</tbody>
105
-
</tgroup>
106
-
</informaltable>
107
-
</para>
87
+
<informaltable>
88
+
<tgroup cols="2">
89
+
<thead>
90
+
<row>
91
+
<entry>&Version;</entry>
92
+
<entry>&Description;</entry>
93
+
</row>
94
+
</thead>
95
+
<tbody>
96
+
<row>
97
+
<entry>8.1.0</entry>
98
+
<entry>
99
+
Returns an <classname>FTP\Connection</classname> instance now;
100
+
previously, a &resource; was returned.
101
+
</entry>
102
+
</row>
103
+
</tbody>
104
+
</tgroup>
105
+
</informaltable>
108
106
</refsect1>
109
107

110
108
<refsect1 role="examples">
...
...
@@ -117,20 +115,20 @@
117
115
<?php
118
116

119
117
// set up basic ssl connection
120
-
$conn_id = ftp_ssl_connect($ftp_server);
118
+
$ftp = ftp_ssl_connect($ftp_server);
121
119

122
120
// login with username and password
123
-
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
121
+
$login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);
124
122

125
123
if (!$login_result) {
126
124
// PHP will already have raised an E_WARNING level message in this case
127
125
die("can't login");
128
126
}
129
127

130
-
echo ftp_pwd($conn_id); // /
128
+
echo ftp_pwd($ftp);
131
129

132
130
// close the ssl connection
133
-
ftp_close($conn_id);
131
+
ftp_close($ftp);
134
132
?>
135
133
]]>
136
134
</programlisting>
...
...
@@ -146,7 +144,6 @@ ftp_close($conn_id);
146
144
</para>
147
145
</refsect1>
148
146
</refentry>
149
-

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