svn: /phpdoc/en/trunk/reference/ldap/functions/ ldap-connect.xml
| From: | Peter Cowburn | Date: | Sat, 30 Jan 2016 12:57:21 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/ldap/functions/ ldap-connect.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-14016@lists.php.net to get a copy of this message | ||
salathe Sat, 30 Jan 2016 12:57:21 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=338549
Log:
Clarify what ldap_connect actually does and what parameters are accepted (and which not)
--
Provided by Andreas Heigl (andreas@heigl.org)
Changed paths:
U phpdoc/en/trunk/reference/ldap/functions/ldap-connect.xml
Modified: phpdoc/en/trunk/reference/ldap/functions/ldap-connect.xml
===================================================================
--- phpdoc/en/trunk/reference/ldap/functions/ldap-connect.xml 2016-01-30 12:57:16 UTC (rev 338548)
+++ phpdoc/en/trunk/reference/ldap/functions/ldap-connect.xml 2016-01-30 12:57:21 UTC (rev 338549)
@@ -10,13 +10,18 @@
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>ldap_connect</methodname>
- <methodparam
choice="opt"><type>string</type><parameter>hostname</parameter><initializer>&null;</initializer></methodparam>
+ <methodparam
choice="opt"><type>string</type><parameter>host</parameter><initializer>&null;</initializer></methodparam>
<methodparam
choice="opt"><type>int</type><parameter>port</parameter><initializer>389</initializer></methodparam>
</methodsynopsis>
<para>
- Establishes a connection to a LDAP server on a specified
- <parameter>hostname</parameter> and <parameter>port</parameter>.
+ Creates an LDAP link identifier and checks whether the given
+ <parameter>host</parameter> and <parameter>port</parameter> are
plausible.
</para>
+ <para>
+ Note: This function does <emphasis>not</emphasis> open a connection.
+ It checks whether the given parameters are plausibe and can be used
+ to open a connection as soon as one is needed.
+ </para>
</refsect1>
<refsect1 role="parameters">
@@ -24,21 +29,26 @@
<para>
<variablelist>
<varlistentry>
- <term><parameter>hostname</parameter></term>
+ <term><parameter>host</parameter></term>
<listitem>
<para>
- If you are using OpenLDAP 2.x.x you can specify a URL instead of the
- hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL
- support, configure PHP with SSL, and set this parameter as
- <literal>ldaps://hostname/</literal>.
+ This field supports using a hostname or, with OpenLDAP 2.x.x and
+ later, a full LDAP URI of the form <literal>ldap://hostname:port</literal>
+ or <literal>ldaps://hostname:port</literal> for SSL encryption.
</para>
+ <para>
+ You can also provide multiple LDAP-URIs separated by a space as one string
+ </para>
+ <para>
+ Note that <literal>hostname:port</literal> is not a supported LDAP URI as the
schema is missing.
+ </para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>port</parameter></term>
<listitem>
<para>
- The port to connect to. Not used when using URLs.
+ The port to connect to. Not used when using LDAP URIs.
</para>
</listitem>
</varlistentry>
@@ -49,7 +59,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- Returns a positive LDAP link identifier on success, or &false; on error.
+ Returns a positive LDAP link identifier when the provided hostname/port combination or LDAP URI
+ seems plausible. It's a syntactic check of the provided parameters but the server(s) will
not
+ be contacted! If the syntactic check fails it returns &false;.
When OpenLDAP 2.x.x is used, <function>ldap_connect</function> will always
return a <type>resource</type> as it does not actually connect but just
initializes the connecting parameters. The actual connect happens with