-
Notifications
You must be signed in to change notification settings - Fork 26
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
PSR-0 compatibility #4
Comments
That makes sense, but since this package has so many installs on Packagist which does not support renaming of projects without removing them first I'm hesitant to do so. I might look into this more when I get a chance, maybe that's no longer the case. |
AFAIK packagist still sucks in this regard. They don't allow you to remove packages either if they have more than 50 installs, so this wouldn't work anyways. But my request is not such much about the name in composer.json, but rather the namespace used in the PHP classes themselves. Right now, you instantiate the widget like this: $captcha = new Captcha\Captcha(); My proposal would be to use something like this instead: $captcha = new AlekseyKorzun\ReCaptcha\Captcha(); The packagist setup doesn't have to change for this (but you might need to update the autoloader configuration in composer.json) |
Why not just AlekseyKorzun\ReCaptcha ? Any opinion on that? |
|
Gotcha, that makes sense I did not look at the document they drafted in a while now. I might do this this weekend, still need to figure out what kind of impact this will do to users not using composer/packagist/etc. |
@flack I think this is resolved. Just came across this... lol |
Right now, this package uses
Captcha
as its only namespace, which is a bit unfortunate, since it is a very generic namespace which increases the risk of collisions when used e.g. in an environment where multiple captcha implementations are integrated.It would be better if the namespace would be something like
AlekseyKorzun\ReCaptcha
, i.e. have a vendor namespace as defined in PSR-0 (https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md). If there is a vendor namespace, then the package namespace itself becomes less important, except of course when you decide to implement another captcha mechanism :-)I know this is a bit inconvenient to implement, since it will break backwards compatibility, but maybe you could do it for a new (major) release.
The text was updated successfully, but these errors were encountered: