1--TEST-- 2ldap_connect() - Connection using default host from openldap's ldap.conf 3--CREDITS-- 4David Caldwell <david@galvanix.com> 5--SKIPIF-- 6<?php 7require_once('skipif.inc'); 8ob_start(); 9phpinfo(); 10if (!preg_match("/vendor name => openldap/i", ob_get_clean())) 11 die("skip not openldap"); 12?> 13--FILE-- 14<?php 15$conf=tempnam("/tmp","ldap.conf"); 16file_put_contents($conf, "uri ldaps://example.com:3141/"); 17putenv("LDAPCONF=$conf"); 18$link = ldap_connect(); 19ldap_get_option($link, LDAP_OPT_HOST_NAME, $host); 20var_dump($host); 21unlink($conf); 22?> 23--EXPECT-- 24string(16) "example.com:3141" 25