Added documentation for ldap_get_option() and ldap_set_option().

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@34406 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Stig Venaas 2000-10-22 18:20:58 +00:00
parent 08d1ea483e
commit d6c1f6dc1d

View file

@ -903,6 +903,51 @@ return_value[i]["attribute"][j] = jth value of attribute in ith entry
</refentry>
<refentry id="function.ldap-get-option">
<refnamediv>
<refname>ldap_get_option</refname>
<refpurpose>Get the current value for given option</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>boolean <function>ldap_get_option</function></funcdef>
<paramdef>int <parameter>link_identifier</parameter></paramdef>
<paramdef>int <parameter>option</parameter></paramdef>
<paramdef>mixed <parameter>retval</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Sets <parameter>retval</parameter> to the value of the specified option,
and returns true on success and false on error.</para>
<para>
The parameter <parameter>option</parameter> can be one of:
LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT,
LDAP_OPT_PROTOCOL_VERSION, LDAP_OPT_ERROR_NUMBER, LDAP_OPT_REFERRALS,
LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING,
LDAP_OPT_MATCHED_DN. These are described in
<ulink url="http://www.openldap.org/devel/cvsweb.cgi/~checkout~/doc/drafts/draft-ietf-ldapext-ldap-c-api-xx.txt">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink></para>
<para>This function is only available when using OpenLDAP 2.x.x, and was
added in PHP 4.0.4</para>
<example>
<title>Check protocol version</title>
<programlisting role="php">
// $ds is a valid link identifier for a directory server
if (ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version))
echo "Using protocol version $version";
else
echo "Unable to determine protocol version $version";
</programlisting>
</example></para>
<para>
See also <function>ldap_set_option</function>.</para>
</refsect1>
</refentry>
<refentry id="function.ldap-get-values">
<refnamediv>
<refname>ldap_get_values</refname>
@ -1460,6 +1505,52 @@ print $info["count"]." entries returned&lt;p>";
</refentry>
<refentry id="function.ldap-set-option">
<refnamediv>
<refname>ldap_set_option</refname>
<refpurpose>Set the value of the given option</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>boolean <function>ldap_set_option</function></funcdef>
<paramdef>int <parameter>link_identifier</parameter></paramdef>
<paramdef>int <parameter>option</parameter></paramdef>
<paramdef>mixed <parameter>newval</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
Sets the value of the specified option to be
<parameter>newval</parameter>, and returns true on success and false
on error.</para>
<para>
The parameter <parameter>option</parameter> can be one of:
LDAP_OPT_DEREF, LDAP_OPT_SIZELIMIT, LDAP_OPT_TIMELIMIT,
LDAP_OPT_PROTOCOL_VERSION, LDAP_OPT_ERROR_NUMBER, LDAP_OPT_REFERRALS,
LDAP_OPT_RESTART, LDAP_OPT_HOST_NAME, LDAP_OPT_ERROR_STRING,
LDAP_OPT_MATCHED_DN. These are described in
<ulink url="http://www.openldap.org/devel/cvsweb.cgi/~checkout~/doc/drafts/draft-ietf-ldapext-ldap-c-api-xx.txt">draft-ietf-ldapext-ldap-c-api-xx.txt</ulink></para>
<para>This function is only available when using OpenLDAP 2.x.x, and was
added in PHP 4.0.4</para>
<example>
<title>Set protocol version</title>
<programlisting role="php">
// $ds is a valid link identifier for a directory server
if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3))
echo "Using LDAPv3";
else
echo "Failed to set protocol version to 3";
</programlisting>
</example></para>
<para>
See also <function>ldap_get_option</function>.</para>
</refsect1>
</refentry>
<refentry id="function.ldap-unbind">
<refnamediv>
<refname>ldap_unbind</refname>