ldap_get_option
(PHP 4 >= 4.0.4, PHP 5)
ldap_get_option — 指定したオプションの現在の値を得る
説明
bool ldap_get_option
( resource $link_identifier
, int $option
, mixed &$retval
)
retval を、指定したオプションの値として設定します。
パラメータ
- link_identifier
-
ldap_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 を返します。
例
Example#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 を使用した場合にのみ利用可能です。