8000 [LDAP] Deprecated functions will be removed in PHP 8.0 · Issue #38352 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[LDAP] Deprecated functions will be removed in PHP 8.0 #38352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
michaljusiega opened this issue Sep 30, 2020 · 3 comments
Closed

[LDAP] Deprecated functions will be removed in PHP 8.0 #38352

michaljusiega opened this issue Sep 30, 2020 · 3 comments
Labels
Bug Help wanted Issues and PRs which are looking for volunteers to complete them. Ldap Status: Needs Review

Comments

@michaljusiega
Copy link
Contributor
michaljusiega commented Sep 30, 2020

Symfony version(s) affected: since 4.3.x

Description
Deprecated functions since PHP 7.4:

ldap_control_paged_result()
ldap_control_paged_result_response()

used in LDAP component
https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php#L100
https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Ldap/Adapter/ExtLdap/Query.php#L136

will be not available in PHP 8.0
See php/php-src#6235 or php/php-src@550a4f2

How to reproduce

Possible Solution
Checking PHP Version or if method exist ?

Additional context

@michaljusiega
Copy link
Contributor Author

Changes has been merged in php/php-src@550a4f2

@MCMic
Copy link
MCMic commented Oct 1, 2020

See example 5 of https://www.php.net/manual/en/ldap.examples-controls.php to see how to use the new API to use pagination controls (added in PHP 7.3).

@chalasr chalasr added the Help wanted Issues and PRs which are looking for volunteers to complete them. label Oct 1, 2020
@chalasr
Copy link
Member
chalasr commented Oct 1, 2020

PR welcome. Don't hesitate to ping me for guidance (e.g. on slack).

nicolas-grekas added a commit that referenced this issue Oct 7, 2020
…P >= 7.3 (lucasaba)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Ldap] Bypass the use of `ldap_control_paged_result` on PHP >= 7.3

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38352
| License       | MIT
| Doc PR        |

As stated on #38352 [ldap_control_paged_result](https://www.php.net/manual/en/function.ldap-control-paged-result.php) and [ldap_control_paged_result_response](https://www.php.net/manual/en/function.ldap-control-paged-result-response.php) have been deprecated since PHP 7.4 and will be removed on PHP 8.0.

With this fix, Query uses serverctrls to handle LDAP results pagination.

Since `serverctrls` where introduced in PHP 7.3 and they are the only way to circumvent the usage of `ldap_control_paged_result`, I've added a new Query class implementation which uses `serverctrls` to control pagination.

To do so I've also had to update the LDAP Adapter in order to use the new class if PHP version 7.3 or greater are found

Commits
-------

d332b30 [Ldap] Bypass the use of `ldap_control_paged_result` on PHP >= 7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Help wanted Issues and PRs which are looking for volunteers to complete them. Ldap Status: Needs Review
Projects
None yet
Development

No branches or pull requests

6 participants
0