-
Notifications
You must be signed in to change notification settings - Fork 452
[Extended] Remove deprecated code and add new implementation for Symfony 3.0 #371
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
Conversation
I think Travis is playing up, some of the containers running the tests are missing the mongo extension. |
It's definitely a travis issue, they've borked their containers. Modified travis config to test stable symfony 2.8/3 on php 5.6/7. |
@stof any thoughts on this PR? |
{ | ||
use ContainerAwareTrait; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not good as the bundle supports PHP 5.3. Implement the interface without using the trait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as per php 5.4... it's not supported any longer. Do you want to burden yourself with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, I'm quite sure that some people still run it when they run the Symfony 2.3 LTS. And it would not be good to force to run an unmaintained version of the bundle for something related to security.
And given that this bundle is low maintenance, I don't think maintaining 2 branches just to avoid 4 small lines of codes here. There is no burden here.
I think dropping support for them might be done at the same time we drop support for Symfony 2.3 (which reaches end of maintenance in 6 months)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roger
All concerns addressed except for the one regarding |
… support the new mongodb php driver extension - they're still stuck on legacy mongo extension
Okay, this bundle cannot support PHP7 for the time being as doctrine/mongo-odm and dependencies depend on the legacy mongo extension, instead of the new mongodb extension. oauth2-php needs updating also to symfony 3 as it depends on httpfoundation 2.0 I'm trying to fix the latter. |
We can totally support PHP 7, as there is no hard dependency on the ODM. It is an optional dependency. |
@@ -127,10 +146,15 @@ protected function getRedirectionUrl(UserInterface $user) | |||
protected function getClient() | |||
{ | |||
if (null === $this->client) { | |||
if (null === $clientId = $this->container->get('request')->get('client_id')) { | |||
try { | |||
$request = $this->container->get('request_stack')->getCurrentRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to handle the case of $request
being null
here to be safe
Understood, but you must realise builds will fail, and I imagine tests also, on PHP7 until doctrine/mongo upgrades to the new extension. |
@@ -41,13 +59,19 @@ public function isRejected() | |||
|
|||
public function process() | |||
{ | |||
try { | |||
$request = $this->container->get('request_stack')->getCurrentRequest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here about handling of null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done on both accounts
@luispabon no. tests relying on mongo should simply be skipped if the mongo extension is not available |
Fair do's, although that's out of scope for this particular PR. This is symfony 3.0 compat only. Builds will still fail due to composer not being able to resolve dependencies. I've moved php7 to allow_failures on travis. |
env: SYMFONY_VERSION=2.8.*@dev | ||
env: SYMFONY_VERSION=2.8.* | ||
- php: 7.0 | ||
env: SYMFONY_VERSION=2.8.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no reason to run tests for Symfony 2.8 twice, on 5.6 and 7.0. The bundle is already tested on both different versions of PHP, and Symfony itself too.
Also @stof, if you have any hand on the FOS oauth2-php, we need this FriendsOfSymfony/oauth2-php#88 merged and a new release cut. Otherwise composer won't be able to resolve working dependencies when using this alongside symfony 3. |
Given that running tests on PHP 7 is something you added, it is in the scope. Otherwise, you should not add PHP 7 at all in this PR, and do a separate PR for it (which might indeed be a good idea though) |
Fair enough, php7 was on the original PR and I expanded travis config for it. I've removed it entirely, best left for a different PR. I've also bumped all symfony components to allow for 3.0. Will have a look at the token compiler pass when I have some time. We're blocked by oauth2-php atm. |
The PR has been merged, even though it is not released yet |
👍 |
@@ -20,17 +20,14 @@ matrix: | |||
- php: 5.6 | |||
env: SYMFONY_VERSION=2.6.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest removing 2.5 and 2.6 here, as they reached end of maintenance. This will avoid making the Travis build too big.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. The travis config is also asking for php 5.4 and 5.5, although they're not being tested. 5.3 is tested however. Anything you'd like to do about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHP 5.4 and 5.5 are tested. They are running on builds which are not modifying the Symfony requirement
Addressed the remaining concerns. Still blocked on oauth2-php, unless we switch to dev_master. |
I won't be near a computer for the next 10 days, please feel free to complete this as needed. |
Closed in favor of #374 |
This is meant to supersede #358 as @ghostika seems to have gone away. I believe it now addresses all the issues raised, please code review.
@sekl, it has your patch in it, although not entirely sure why the link to your github user got lost on my cherry pick.
Closes #366