From: Côme Bernigaud Date: Mon, 29 Jun 2015 12:31:20 +0000 (+0200) Subject: Deprecating ldap_sort the right way X-Git-Tag: php-7.1.0alpha3~25^2~112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=667e9bd4177e40a52b4f0cd6bfed5737c2694a47;p=php Deprecating ldap_sort the right way --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 5d47fb6624..a7e7522607 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2001,8 +2001,6 @@ PHP_FUNCTION(ldap_sort) size_t sflen; zend_resource *le; - php_error_docref(NULL, E_DEPRECATED, "Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions"); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link, &result, &sortfilter, &sflen) != SUCCESS) { RETURN_FALSE; } @@ -3279,7 +3277,7 @@ 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_FE(ldap_sort, arginfo_ldap_sort) + 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 index 25fec5e18e..e14381f8c7 100644 --- a/ext/ldap/tests/ldap_sort_basic.phpt +++ b/ext/ldap/tests/ldap_sort_basic.phpt @@ -51,7 +51,7 @@ ldap_delete($link, "cn=userE,$base"); remove_dummy_data($link, $base); ?> --EXPECTF-- -Deprecated: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +Deprecated: Function ldap_sort() is deprecated in %s.php on line %d bool(true) array(7) { ["count"]=> diff --git a/ext/ldap/tests/ldap_sort_error.phpt b/ext/ldap/tests/ldap_sort_error.phpt index 59d36323bb..26781638d1 100644 --- a/ext/ldap/tests/ldap_sort_error.phpt +++ b/ext/ldap/tests/ldap_sort_error.phpt @@ -18,27 +18,27 @@ var_dump(ldap_sort($link, $link, "sn")); ?> ===DONE=== --EXPECTF-- -Deprecated: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +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: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +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: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +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: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +Deprecated: Function ldap_sort() is deprecated in %s.php on line %d Warning: ldap_sort() expects parameter 3 to be %binary_string_optional%, resource given in %s on line %d bool(false) -Deprecated: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +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) diff --git a/ext/ldap/tests/ldap_sort_variation.phpt b/ext/ldap/tests/ldap_sort_variation.phpt index 501f42940a..bb121b63cb 100644 --- a/ext/ldap/tests/ldap_sort_variation.phpt +++ b/ext/ldap/tests/ldap_sort_variation.phpt @@ -51,7 +51,7 @@ ldap_delete($link, "cn=userE,$base"); remove_dummy_data($link, $base); ?> --EXPECTF-- -Deprecated: ldap_sort(): Usage of ldap_sort is deprecated and will be removed in one of the next PHP-versions in %s.php on line %d +Deprecated: Function ldap_sort() is deprecated in %s.php on line %d bool(true) array(7) { ["count"]=>