(PHP 4 >= 4.0.4, PHP 5, PHP 7)
ldap_get_option — 指定したオプションの現在の値を得る
retval を、指定したオプションの値として設定します。
link_identifierldap_connect() が返す LDAP リンク ID。
option
パラメータ option は以下のいずれかとなります。
| オプション | 型 |
|---|---|
LDAP_OPT_DEREF |
integer |
LDAP_OPT_SIZELIMIT |
integer |
LDAP_OPT_TIMELIMIT |
integer |
LDAP_OPT_NETWORK_TIMEOUT |
integer |
LDAP_OPT_PROTOCOL_VERSION |
integer |
LDAP_OPT_ERROR_NUMBER |
integer |
LDAP_OPT_REFERRALS |
bool |
LDAP_OPT_RESTART |
bool |
LDAP_OPT_HOST_NAME |
string |
LDAP_OPT_ERROR_STRING |
string |
LDAP_OPT_MATCHED_DN |
string |
LDAP_OPT_SERVER_CONTROLS |
array |
LDAP_OPT_CLIENT_CONTROLS |
array |
retvalこれが、オプションの値として設定されます。
成功した場合に TRUE を、失敗した場合に FALSE を返します。
例1 プロトコルのバージョンを調べる
<?php
// $ds はディレクトリサーバーへの有効なリンクIDです
if (ldap_get_option($ds, LDAP_OPT_PROTOCOL_VERSION, $version)) {
echo "使用中のプロトコルのバージョン: $version\n";
} else {
echo "プロトコルのバージョンを決定することができません\n";
}
?>
注意:
この関数は、OpenLDAP 2.x.x または Netscape Directory SDK x.x を使用した場合にのみ利用可能です。