note 58311 added to function.ldap-set-option

From: Date: Mon, 31 Oct 2005 09:59:15 +0000
Subject: note 58311 added to function.ldap-set-option
Groups: php.notes 
Request: Send a blank email to php-notes+get-97870@lists.php.net to get a copy of this message
it seems that ldap_set_option returns 1 for bogus ldap_connect -ions also. ldap_connect always returns a resource (documented in the comments of ldap_connect) so it is not possible to check if the ldap server is there or alive or what. and because ldap_set_option must be between ldap_connect and ldap_bind, there seems to be no sense in checking the return value. it is a bit strange that ldap_bind is the first function which can really check if a ldap resource is usable because it is the third function in line to use when working with openldap. <?php $connect = ldap_connect("whatever"); $set = ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); echo $set; ?> ---- Manual Page -- http://www.php.net/manual/en/function.ldap-set-option.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58311 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58311&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58311&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#97870) next »