Closed alexbilbie closed 8 years ago
Why to tie with frameworks when it's an independent library?
StackPHP is not a framework. It's a framework interoperability tool.
@hannesvdvreken why to tie with anything?
I've taken it and without any problems used in symfony. If one needs integration with something - why not make it a separate project, that refers to this library as a dependency?
Yeah, but people like libraries with utility classes that they can just use to tie it in their application in no time.
So why put everything into one repository/project?
Doesn't splitting it into different projects each one with its own particular responsibility make it better design?
It's better to add a stackphp middleware than to add framework specific classes for every single framework.
@hannesvdvreken the question was: why to add it to the library? Why not create a separate project that provides integration?
Composition, you know.
StackPHP will only be a dev dependency.
@hannesvdvreken the question is still: why a library need to know about environment it will be used in? Why not just leave a library to be a pure library.
And any integration, even as simple or as trivial as another dependency (but still biased and opinionated) to be another project?
I would agree with you if it would be symfony or zend specific classes, but StackPHP is meant to be used in any application. So it's optional but also an invitation to use good app design.
This will be my last response, sorry, as I don't have more time to discuss. Have a nice day.
It violates SRP.
But hey, it's your project, design it as you wish.
I just noticed this is a 7 month old issue. Don't worry about it, it probably will not be executed any time soon ;-)
I've just woken up in my timezone so to answer your questions, the middleware will be a single class with no additional dependencies required because anyone implementing it will already have pulled them in themselves. On Fri, 20 Mar 2015 at 07:04 Hannes Van De Vreken notifications@github.com wrote:
I would agree with you if it would be symfony or zend specific classes, but StackPHP is meant to be used in any application. So it's optional but also an invitation to use good app design.
This will be my last response, sorry, as I don't have more time to discuss. Have a nice day.
— Reply to this email directly or view it on GitHub https://github.com/thephpleague/oauth2-server/issues/200#issuecomment-83941052 .
As I said: just a dev dependency.
just a dev dependency.
Dev dependencies are not installed by default (or at all) when a library is a dependency itself. I cannot see how it can be a pure dev dependency :-)
What's the dev dependency you're referring to? As I said implementing the middleware won't result in any new dependencies being added to the project On Fri, 20 Mar 2015 at 07:08 Ivan Kurnosov notifications@github.com wrote:
just a dev dependency.
Dev dependencies are not installed by default when a library is a dependency itself. I cannot see how it can be a pure dev dependency :-)
— Reply to this email directly or view it on GitHub https://github.com/thephpleague/oauth2-server/issues/200#issuecomment-83941347 .
@alexbilbie middleware is integration. Why not have it separately?
OAuth library provides the protocol implementation, why spoil it with information about the environment it will be hosted in?
Especially keeping in mind that StackPHP is not an industry standard and not everyone follows them.
@hannesvdvreken it will not be a dev dependency. It will be a middleware (in terms of StackPHP) implementation.
So a class that has nothing to do with the library (and OAuth2 protocol) directly, just a glue layer with a specific "architecture"
@alexbilbie simple example: https://github.com/thecodingmachine/silex-middleware
So they implemented a middleware for silex outside of silex, not as a part of it.
I agree. It'll be a separate package. But as that separate package doesn't exist yet I'm just tracking it in here.
White begins and wins!
Sorry for being nasty and/or annoying, I wish the project the best design :-)
Closing for now; v5 will include PSR7 middleware
Integration with StackPHP