Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89073 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5600 invoked from network); 5 Nov 2015 03:27:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2015 03:27:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=come@opensides.be; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=come@opensides.be; sender-id=pass Received-SPF: pass (pb1.pair.com: domain opensides.be designates 195.154.20.141 as permitted sender) X-PHP-List-Original-Sender: come@opensides.be X-Host-Fingerprint: 195.154.20.141 smtp.opensides.be Received: from [195.154.20.141] ([195.154.20.141:58849] helo=smtp.opensides.be) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9D/C0-00752-79CCA365 for ; Wed, 04 Nov 2015 22:27:20 -0500 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id 118656370E for ; Thu, 5 Nov 2015 04:27:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id y-U5J-HQch-d for ; Thu, 5 Nov 2015 04:27:17 +0100 (CET) Received: from mcmic-probook.localnet (node-sux.pool-182-52.dynamic.totbb.net [182.52.146.25]) by smtp.opensides.be (Postfix) with ESMTPSA id 448A26276B for ; Thu, 5 Nov 2015 04:27:17 +0100 (CET) To: internals@lists.php.net Date: Thu, 05 Nov 2015 04:26:34 +0100 Message-ID: <1608805.4xW4o0UFHB@mcmic-probook> Organization: OpenSides User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: References: <3187501.to7rK1FKUl@mcmic-probook> <2680231.U9fny6VzaI@mcmic-probook> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [PHP-DEV] One last ldap_connect headache From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le mercredi 4 novembre 2015, 21:41:20 Bishop Bettini a =E9crit : >=20 > If one wanted truly robust (paranoid) code, you'd probably want to do= : >=20 > $port =3D getservbyname('ldap', 'tcp'); >=20 > if (isset($options['port']) && is_numeric($options['port'])) > $port =3D intval($options['port']); >=20 > $resource =3D ldap_connect($host, $port); >=20 > 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 getservbyna= me if one does not want to use 389 directly.