Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Ldap] Fixed issue with legacy client initialisation #18944

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

Merged
merged 1 commit into from
Jun 8, 2016
Merged

[Ldap] Fixed issue with legacy client initialisation #18944

merged 1 commit into from
Jun 8, 2016

Conversation

csarrazi
Copy link
Contributor

@csarrazi csarrazi commented Jun 1, 2016

Q A
Branch? 3.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #18725 (comment)
License MIT
Doc PR

Thanks @uvups for noticing this.

@fabpot
Copy link
Member

fabpot commented Jun 1, 2016

Any way to add some tests?

@csarrazi
Copy link
Contributor Author

csarrazi commented Jun 1, 2016

Sure! I'll try to find some time for this tomorrow

@uvups
Copy link

uvups commented Jun 2, 2016

@csarrazi This fix worked for me. Thanks

@@ -24,13 +24,22 @@

public function __construct($host = null, $port = 389, $version = 3, $useSsl = false, $useStartTls = false, $optReferrals = false, LdapInterface $ldap = null)
{
if ((bool) $useSsl) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to cast explicitly here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. However this was kept to ensure the previous behaviour.

I can remove the cast, if needed.

@stof
Copy link
Member

stof commented Jun 2, 2016

btw, this class is missing its deprecation warning

@csarrazi
Copy link
Contributor Author

csarrazi commented Jun 2, 2016

You mean in the constructor, right?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Jun 8, 2016

@csarrazi stof means after the namespace declaration. See grep '^@trigger' src/ -r (on 2.8)

@csarrazi
Copy link
Contributor Author

csarrazi commented Jun 8, 2016

Ok. I'll check this tonight! Thanks for the info @nicolas-grekas!

@csarrazi
Copy link
Contributor Author

csarrazi commented Jun 8, 2016

@nicolas-grekas @stof Done.

@@ -11,6 +11,8 @@

namespace Symfony\Component\Ldap;

@trigger_error('The '.__NAMESPACE__.'\LdapClient class is deprecated since version 3.1 and will be removed in 4.0. Use directly the Ldap class instead.', E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the Ldap class directly instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@nicolas-grekas
Copy link
Member

👍
Just wondering: do the added tests make sense on the Ldap class also? Or will it be OK to just remove them when doing 4.0?

@csarrazi
Copy link
Contributor Author

csarrazi commented Jun 8, 2016

It will be okay to remove them for 4.0. The LdapClientTest tests only happen to test the BC layer:

  • whether the Ldap class is properly encapsulated or not in the LdapClient class;
  • the BC-compatible find() method;
  • the config change between the two classes.

@fabpot
Copy link
Member

fabpot commented Jun 8, 2016

Thank you @csarrazi.

@fabpot fabpot merged commit 6804efe into symfony:3.1 Jun 8, 2016
fabpot added a commit that referenced this pull request Jun 8, 2016
…razi)

This PR was merged into the 3.1 branch.

Discussion
----------

[Ldap] Fixed issue with legacy client initialisation

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18725 (comment)
| License       | MIT
| Doc PR        |

Thanks @uvups for noticing this.

Commits
-------

6804efe Fixed issue with legacy client initialization
@csarrazi csarrazi deleted the fix/ldap-legacy-compatibility branch June 8, 2016 11:30
@fabpot fabpot mentioned this pull request Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants