com php-src: Implements extended error messages: ext/ldap/ldap.c
| From: | JulienPauli | Date: | Tue, 12 May 2015 08:06:54 +0000 |
| Subject: | com php-src: Implements extended error messages: ext/ldap/ldap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86670@lists.php.net to get a copy of this message | ||
Commit: 983b101f8e6ee9b2839b8da5910edc6ae214673c
Author: Andreas Heigl <andreas@heigl.org> Tue, 5 May 2015 21:30:29 +0200
Committer: Julien Pauli <jpauli@php.net> Tue, 12 May 2015 10:06:54 +0200
Parents: 5cf78b81eac3f7dd71ac8652db9973f5e432c3fd
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=983b101f8e6ee9b2839b8da5910edc6ae214673c
Log:
Implements extended error messages
This commit introduces a new constant that can be used to retrieve more
detailed error messages.
This fixes #47222
The new constant LDAP_OPT_DIAGNOSTIC_MESSAGE is defined in PHP when the
underlying library provides (and understands) it. This is the case in
the current OpenLDAP-implementation.
Tanks to Johnny Willer who provided the solution at http://stackoverflow.com/questions/28765077/get-number-of-ad-errors-with-ldap-and-php-ldap-function-return-unprecise-error/28816473#28816473
Bugs:
https://bugs.php.net/47222
https://bugs.php.net/28816473
Changed paths:
M ext/ldap/ldap.c
Diff:
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index c64b13b..b1fc1e4 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -191,6 +191,10 @@ PHP_MINIT_FUNCTION(ldap)
REGISTER_LONG_CONSTANT("LDAP_OPT_DEBUG_LEVEL", LDAP_OPT_DEBUG_LEVEL, CONST_PERSISTENT |
CONST_CS);
#endif
+#ifdef LDAP_OPT_DIAGNOSTIC_MESSAGE
+ REGISTER_LONG_CONSTANT("LDAP_OPT_DIAGNOSTIC_MESSAGE", LDAP_OPT_DIAGNOSTIC_MESSAGE,
CONST_PERSISTENT | CONST_CS);
+#endif
+
#ifdef HAVE_LDAP_SASL
REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_MECH", LDAP_OPT_X_SASL_MECH, CONST_PERSISTENT |
CONST_CS);
REGISTER_LONG_CONSTANT("LDAP_OPT_X_SASL_REALM", LDAP_OPT_X_SASL_REALM, CONST_PERSISTENT
| CONST_CS);