We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d51b8f9 commit 49d1cdcCopy full SHA for 49d1cdc
ext/ldap/tests/ldap_connect_ldap_conf.phpt
@@ -0,0 +1,26 @@
1
+--TEST--
2
+ldap_connect() - Connection using default host from openldap's ldap.conf
3
+--CREDITS--
4
+David Caldwell <david@galvanix.com>
5
+--SKIPIF--
6
+<?php
7
+require_once('skipif.inc');
8
+ob_start();
9
+phpinfo();
10
+if (!preg_match("/vendor name => openldap/i", ob_get_clean()))
11
+ die("skip not openldap");
12
+?>
13
+--FILE--
14
15
+$conf=tempnam("/tmp","ldap.conf");
16
+file_put_contents($conf, "uri ldaps://example.com:3141/");
17
+putenv("LDAPCONF=$conf");
18
+$link = ldap_connect();
19
+ldap_get_option($link, LDAP_OPT_HOST_NAME, $host);
20
+var_dump($host);
21
+unlink($conf);
22
23
+===DONE===
24
+--EXPECTF--
25
+string(16) "example.com:3141"
26
0 commit comments