Skip to content
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

Having own specific namespace to prevent conflicts #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

smuuf
Copy link

@smuuf smuuf commented Aug 24, 2016

Hi, I'm proposing this to avoid namespace conflicts when having multiple libraries dealing with OAuth2 and both have - let's admit it - pretty silly general OAuth2 namespace, which bears a high probability of conflicts with other libraries.

Basically this pull request changes stuff like:

<?php

namespace OAuth2\GrantType;

to

<?php

namespace Adoy\OAuth2\GrantType;

I know this is a BC break, so I'm not expecting this to be merged any time soon, but I figured even some day will be better than never. :)

The reason I had a conflict was this OAuth2 server library (https://github.com/bshaffer/oauth2-server-php), that - unfortunately - used the same generic OAuth2 namespace and thus class name conflicts appeared. It's only because adoy/PHP-OAuth2 had fewer files I decided to namespace this OAuth2 client library and not the OAuth2 server lib. to resolve the problem, so please don't take this personally :D

I know my solution could have remained being just a fork, but I figured that if it could help other people to prevent the same problem, then I might as well propose a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant