com php-src: Removed ldap_sort and LDAP_DEPRECATED bu ild flag: NEWS UPGRADING ext/ldap/config.m4 ext /ldap/config.w32 ext/ldap/ldap.c
ext/ldap/tests/lda p_sort_basic.phpt ext/ldap/tests/ldap_sort_error. phpt ext/ldap/tests/ldap_sort_variation.phpt

From: Date: Mon, 04 Feb 2019 12:10:05 +0000
Subject: com php-src: Removed ldap_sort and LDAP_DEPRECATED bu ild flag: NEWS UPGRADING ext/ldap/config.m4 ext /ldap/config.w32 ext/ldap/ldap.c
ext/ldap/tests/lda p_sort_basic.phpt ext/ldap/tests/ldap_sort_error. phpt ext/ldap/tests/ldap_sort_variation.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-104441@lists.php.net to get a copy of this message
Commit: f0ddc93f46b31d117ae1c18dbce2bf39f1b91b94 Author: Côme Chilliet <mcmic@php.net> Mon, 4 Feb 2019 13:04:46 +0100 Parents: 53ce98ca0c93ac5b7d9c756801ffadc36ea01ff9 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f0ddc93f46b31d117ae1c18dbce2bf39f1b91b94 Log: Removed ldap_sort and LDAP_DEPRECATED build flag ldap_sort was deprecated in PHP7, it is now removed. This allows removing the LDAP_DEPRECATED flag when building against openldap. Changed paths: M NEWS M UPGRADING M ext/ldap/config.m4 M ext/ldap/config.w32 M ext/ldap/ldap.c D ext/ldap/tests/ldap_sort_basic.phpt D ext/ldap/tests/ldap_sort_error.phpt D ext/ldap/tests/ldap_sort_variation.phpt

diff --git a/NEWS b/NEWS index 6e18690..538e02d 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,9 @@ PHP NEWS - Intl: . Removed deprecated INTL_IDNA_VARIANT_2003. (cmb) +- LDAP: + . Removed deprecated ldap_sort. (mcmic) + - phpdbg: . Fixed bug #76596 (phpdbg support for display_errors=stderr). (kabel) diff --git a/UPGRADING b/UPGRADING index 7d30e6e..a4b390f 100644 --- a/UPGRADING +++ b/UPGRADING @@ -68,6 +68,9 @@ PHP 8.0 UPGRADE NOTES RFC: https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003 . The deprecated Normalizer::NONE constant has been removed. +- LDAP: + . The deprecated function ldap_sort has been removed. + - Mbstring: . The mbstring.func_overload directive has been removed. The related MB_OVERLOAD_MAIL, MB_OVERLOAD_STRING, and MB_OVERLOAD_REGEX constants have diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4 index 6a34fb7..38bd8ee 100644 --- a/ext/ldap/config.m4 +++ b/ext/ldap/config.m4 @@ -90,7 +90,7 @@ PHP_ARG_WITH(ldap-sasl,for LDAP Cyrus SASL support, if test "$PHP_LDAP" != "no"; then - PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,-DLDAP_DEPRECATED=1) + PHP_NEW_EXTENSION(ldap, ldap.c, $ext_shared,,) if test "$PHP_LDAP" = "yes"; then for i in /usr/local /usr; do diff --git a/ext/ldap/config.w32 b/ext/ldap/config.w32 index a16a4fc..e1136b2 100644 --- a/ext/ldap/config.w32 +++ b/ext/ldap/config.w32 @@ -18,7 +18,6 @@ if (PHP_LDAP != "no") { AC_DEFINE('HAVE_LDAP', 1); AC_DEFINE('HAVE_LDAP_SASL', 1); AC_DEFINE('HAVE_LDAP_SASL_SASL_H', 1); - AC_DEFINE('LDAP_DEPRECATED', 1); AC_DEFINE('HAVE_LDAP_CONTROL_FIND', 1); AC_DEFINE('HAVE_LDAP_PARSE_EXTENDED_RESULT', 1); AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION_S', 1); diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index f58b09a..f7bb2ab 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2937,39 +2937,6 @@ cleanup: } /* }}} */ -/* {{{ proto bool ldap_sort(resource link, resource result, string sortfilter) - Sort LDAP result entries */ -PHP_FUNCTION(ldap_sort) -{ - zval *link, *result; - ldap_linkdata *ld; - char *sortfilter; - size_t sflen; - zend_resource *le; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) { - RETURN_FALSE; - } - - if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) { - RETURN_FALSE; - } - - le = Z_RES_P(result); - if (le->type != le_result) { - php_error_docref(NULL, E_WARNING, "Supplied resource is not a valid ldap result resource"); - RETURN_FALSE; - } - - if (ldap_sort_entries(ld->link, (LDAPMessage **) &le->ptr, sflen ? sortfilter : NULL, strcmp) != LDAP_SUCCESS) { - php_error_docref(NULL, E_WARNING, "%s", ldap_err2string(errno)); - RETURN_FALSE; - } - - RETURN_TRUE; -} -/* }}} */ - #if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP /* {{{ proto bool ldap_get_option(resource link, int option, mixed retval) Get the current value of various session-wide parameters */ @@ -4613,12 +4580,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_compare, 0, 0, 4) ZEND_ARG_INFO(0, servercontrols) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_sort, 0, 0, 3) - ZEND_ARG_INFO(0, link) - ZEND_ARG_INFO(0, result) - ZEND_ARG_INFO(0, sortfilter) -ZEND_END_ARG_INFO() - #ifdef LDAP_CONTROL_PAGEDRESULTS ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_control_paged_result, 0, 0, 2) ZEND_ARG_INFO(0, link) @@ -4817,7 +4778,6 @@ static const zend_function_entry ldap_functions[] = { PHP_FE(ldap_err2str, arginfo_ldap_err2str) PHP_FE(ldap_error, arginfo_ldap_resource) PHP_FE(ldap_compare, arginfo_ldap_compare) - PHP_DEP_FE(ldap_sort, arginfo_ldap_sort) #if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP PHP_FE(ldap_rename, arginfo_ldap_rename) diff --git a/ext/ldap/tests/ldap_sort_basic.phpt b/ext/ldap/tests/ldap_sort_basic.phpt deleted file mode 100644 index e14381f..0000000 --- a/ext/ldap/tests/ldap_sort_basic.phpt +++ /dev/null @@ -1,201 +0,0 @@ ---TEST-- -ldap_sort() - Basic ldap_sort test ---CREDITS-- -Patrick Allaert <patrickallaert@php.net> -# Belgian PHP Testfest 2009 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifbindfailure.inc'); ?> ---FILE-- -<?php -require "connect.inc"; - -$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); -insert_dummy_data($link, $base); -ldap_add($link, "cn=userC,$base", array( - "objectclass" => "person", - "cn" => "userC", - "sn" => "zzz", - "userPassword" => "oops", - "description" => "a user", -)); -ldap_add($link, "cn=userD,$base", array( - "objectclass" => "person", - "cn" => "userD", - "sn" => "aaa", - "userPassword" => "oops", - "description" => "another user", -)); -ldap_add($link, "cn=userE,$base", array( - "objectclass" => "person", - "cn" => "userE", - "sn" => "a", - "userPassword" => "oops", - "description" => "yet another user", -)); -$result = ldap_search($link, "$base", "(objectclass=person)", array("sn", "description")); -var_dump( - ldap_sort($link, $result, "sn"), - ldap_get_entries($link, $result) -); -?> -===DONE=== ---CLEAN-- -<?php -include "connect.inc"; - -$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); -ldap_delete($link, "cn=userC,$base"); -ldap_delete($link, "cn=userD,$base"); -ldap_delete($link, "cn=userE,$base"); -remove_dummy_data($link, $base); -?> ---EXPECTF-- -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d -bool(true) -array(7) { - ["count"]=> - int(6) - [0]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(1) "a" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(16) "yet another user" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userE,%s" - } - [1]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(3) "aaa" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(12) "another user" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userD,%s" - } - [2]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(7) "testSN1" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(6) "user A" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userA,%s" - } - [3]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(7) "testSN2" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(6) "user B" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userB,%s" - } - [4]=> - array(4) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(7) "testSN3" - } - [0]=> - string(2) "sn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userC,cn=userB,%s" - } - [5]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(3) "zzz" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(6) "a user" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userC,%s" - } -} -===DONE=== diff --git a/ext/ldap/tests/ldap_sort_error.phpt b/ext/ldap/tests/ldap_sort_error.phpt deleted file mode 100644 index c41b56a..0000000 --- a/ext/ldap/tests/ldap_sort_error.phpt +++ /dev/null @@ -1,45 +0,0 @@ ---TEST-- -ldap_sort() - Testing ldap_sort() that should fail ---CREDITS-- -Patrick Allaert <patrickallaert@php.net> -# Belgian PHP Testfest 2009 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> ---FILE-- -<?php -require "connect.inc"; - -$link = ldap_connect($host, $port); -var_dump(ldap_sort($link)); -var_dump(ldap_sort($link, $link)); -var_dump(ldap_sort($link, $link, $link, $link)); -var_dump(ldap_sort($link, $link, $link)); -var_dump(ldap_sort($link, $link, "sn")); -?> -===DONE=== ---EXPECTF-- -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d - -Warning: ldap_sort() expects exactly 3 parameters, 1 given in %s on line %d -bool(false) - -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d - -Warning: ldap_sort() expects exactly 3 parameters, 2 given in %s on line %d -bool(false) - -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d - -Warning: ldap_sort() expects exactly 3 parameters, 4 given in %s on line %d -bool(false) - -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d - -Warning: ldap_sort() expects parameter 3 to be string, resource given in %s on line %d -bool(false) - -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d - -Warning: ldap_sort(): Supplied resource is not a valid ldap result resource in %s on line %d -bool(false) -===DONE=== diff --git a/ext/ldap/tests/ldap_sort_variation.phpt b/ext/ldap/tests/ldap_sort_variation.phpt deleted file mode 100644 index bb121b6..0000000 --- a/ext/ldap/tests/ldap_sort_variation.phpt +++ /dev/null @@ -1,201 +0,0 @@ ---TEST-- -ldap_sort() - Basic ldap_sort test ---CREDITS-- -Patrick Allaert <patrickallaert@php.net> -# Belgian PHP Testfest 2009 ---SKIPIF-- -<?php require_once('skipif.inc'); ?> -<?php require_once('skipifbindfailure.inc'); ?> ---FILE-- -<?php -require "connect.inc"; - -$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); -insert_dummy_data($link, $base); -ldap_add($link, "cn=userC,$base", array( - "objectclass" => "person", - "cn" => "userC", - "sn" => "zzz", - "userPassword" => "oops", - "description" => "a user", -)); -ldap_add($link, "cn=userD,$base", array( - "objectclass" => "person", - "cn" => "userD", - "sn" => "aaa", - "userPassword" => "oops", - "description" => "another user", -)); -ldap_add($link, "cn=userE,$base", array( - "objectclass" => "person", - "cn" => "userE", - "sn" => "a", - "userPassword" => "oops", - "description" => "yet another user", -)); -$result = ldap_search($link, "$base", "(objectclass=person)", array("sn", "description")); -var_dump( - ldap_sort($link, $result, "description"), - ldap_get_entries($link, $result) -); -?> -===DONE=== ---CLEAN-- -<?php -include "connect.inc"; - -$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); -ldap_delete($link, "cn=userC,$base"); -ldap_delete($link, "cn=userD,$base"); -ldap_delete($link, "cn=userE,$base"); -remove_dummy_data($link, $base); -?> ---EXPECTF-- -Deprecated: Function ldap_sort() is deprecated in %s.php on line %d -bool(true) -array(7) { - ["count"]=> - int(6) - [0]=> - array(4) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(7) "testSN3" - } - [0]=> - string(2) "sn" - ["count"]=> - int(1) - ["dn"]=> - string(%d) "cn=userC,cn=userB,%s" - } - [1]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(3) "zzz" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(6) "a user" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userC,%s" - } - [2]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(3) "aaa" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(12) "another user" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userD,%s" - } - [3]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(7) "testSN1" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(6) "user A" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userA,%s" - } - [4]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(7) "testSN2" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(6) "user B" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userB,%s" - } - [5]=> - array(6) { - ["sn"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(1) "a" - } - [0]=> - string(2) "sn" - ["description"]=> - array(2) { - ["count"]=> - int(1) - [0]=> - string(16) "yet another user" - } - [1]=> - string(11) "description" - ["count"]=> - int(2) - ["dn"]=> - string(%d) "cn=userE,%s" - } -} -===DONE===
« previous php.cvs (#104441) next »