Re: One last ldap_connect headache

From: Date: Thu, 05 Nov 2015 03:26:34 +0000
Subject: Re: One last ldap_connect headache
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-89073@lists.php.net to get a copy of this message
Le mercredi 4 novembre 2015, 21:41:20 Bishop Bettini a écrit : > > If one wanted truly robust (paranoid) code, you'd probably want to do: > > $port = getservbyname('ldap', 'tcp'); > > if (isset($options['port']) && is_numeric($options['port'])) > $port = intval($options['port']); > > $resource = ldap_connect($host, $port); > > And this could go in a comment and solve the whole issue without code > changes. Ok, so we could just put in the documentation the tip about getservbyname if one does not want to use 389 directly.

« previous php.internals (#89073) next »