Skip to content

[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

Closed
wants to merge 15 commits into from
Closed

Conversation

luispabon
Copy link

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

@luispabon
Copy link
Author

I think Travis is playing up, some of the containers running the tests are missing the mongo extension.

@luispabon
Copy link
Author

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.

@luispabon
Copy link
Author

@stof any thoughts on this PR?

{
use ContainerAwareTrait;
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

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

👍

Copy link
Author

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?

Copy link
Member

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)

Copy link
Author

Choose a reason for hiding this comment

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

roger

@luispabon
Copy link
Author

All concerns addressed except for the one regarding TokenStorageCompilerPass, please see comment above @stof .

@luispabon luispabon closed this Dec 17, 2015
@luispabon luispabon reopened this Dec 17, 2015
@luispabon luispabon closed this Dec 18, 2015
@luispabon luispabon reopened this Dec 18, 2015
Luis Pabon added 2 commits December 18, 2015 16:25
… support the new mongodb php driver extension - they're still stuck on legacy mongo extension
@luispabon
Copy link
Author

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.

@luispabon
Copy link
Author

@stof
Copy link
Member

stof commented Dec 21, 2015

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();
Copy link
Member

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

@luispabon
Copy link
Author

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();
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

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

done on both accounts

@stof
Copy link
Member

stof commented Dec 21, 2015

@luispabon no. tests relying on mongo should simply be skipped if the mongo extension is not available

@luispabon
Copy link
Author

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.*
Copy link
Member

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.

@luispabon
Copy link
Author

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.

@stof
Copy link
Member

stof commented Dec 21, 2015

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.

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)

@luispabon
Copy link
Author

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.

@stof
Copy link
Member

stof commented Dec 21, 2015

We're blocked by oauth2-php atm.

The PR has been merged, even though it is not released yet

@luispabon
Copy link
Author

👍

@@ -20,17 +20,14 @@ matrix:
- php: 5.6
env: SYMFONY_VERSION=2.6.*
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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

@luispabon
Copy link
Author

Addressed the remaining concerns. Still blocked on oauth2-php, unless we switch to dev_master.

@luispabon
Copy link
Author

I won't be near a computer for the next 10 days, please feel free to complete this as needed.

@GuilhemN
Copy link
Member

Closed in favor of #374

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.

4 participants