Permalink
Browse files

updated to last symfony security changes

  • Loading branch information...
1 parent b3bfbfc commit fcadd74fd7c42cc6dec3adffdab95d5a52fd1f13 @tecbot tecbot committed Nov 23, 2011
Showing with 9 additions and 6 deletions.
  1. +9 −0 FOSFacebookBundle.php
  2. +0 −6 README.md
@@ -11,8 +11,17 @@
namespace FOS\FacebookBundle;
+use FOS\FacebookBundle\DependencyInjection\Security\Factory\FacebookFactory;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class FOSFacebookBundle extends Bundle
{
+ public function build(ContainerBuilder $container)
+ {
+ parent::build($container);
+
+ $extension = $container->getExtension('security');
+ $extension->addSecurityListenerFactory(new FacebookFactory());
+ }
}
View
@@ -120,9 +120,6 @@ Installation
# application/config/config.yml
security:
- factories:
- - "%kernel.root_dir%/../vendor/bundles/FOS/FacebookBundle/Resources/config/security_factories.xml"
-
providers:
fos_facebook:
id: fos_facebook.auth
@@ -152,9 +149,6 @@ Installation
# application/config/config.yml
security:
- factories:
- - "%kernel.root_dir%/../vendor/bundles/FOS/FacebookBundle/Resources/config/security_factories.xml"
-
providers:
# choose the provider name freely
my_fos_facebook_provider:

19 comments on commit fcadd74

@lsmith77
Member

this breaks the code for 2.0 .. can you create a 2.0 branch with the old behavior?

@leek
leek commented on fcadd74 Nov 23, 2011

+1 for not breaking everything.

@acrozes

+1 for 2.0 branch ...

@stof
Member
stof commented on fcadd74 Nov 23, 2011

@lsmith77 A 2.0 branch or a versionning for the bundle itself ?

@lsmith77
Member

you mean a tag? sure we can also tag .. and add a composer.json ..

@arghav
Member
arghav commented on fcadd74 Nov 23, 2011

If we use tag what happens to the future changes to the bundle?

@leek
leek commented on fcadd74 Nov 23, 2011

It's not that hard guys, make one tag for the latest commit that is still compatible with Symfony 2.0.x and master can be the version that is up to date with Symfony's master.

This is done all over in Symfony2 already - not sure why none of the FOS bundles utilize this.

@stof
Member
stof commented on fcadd74 Nov 23, 2011

I mean tagging it as a 1.0.0 version. Using the Symfony2 versionning for bundles does not really make sense as we will have a different release cycle. And for instance, FOSUserBundle has a 1.0.0 tag (and will have a 1.1 release as soon as I have time to finish my current work on the Propel integration)

@stof
Member
stof commented on fcadd74 Nov 23, 2011

@kertz we can create a branch based on the tag if we need to do changes for the 1.0 version.

@leek
leek commented on fcadd74 Nov 23, 2011

IMO, a version number for the the bundle itself isn't helpful without some context (ie; what Symfony version it is compatible with).

Right now, if I were to install Symfony standard 2.0.6 and follow the install instructions with this bundle - it would throw a fatal error. This is unacceptable.

@arghav
Member
arghav commented on fcadd74 Nov 23, 2011

@stof sounds good.

@stof
Member
stof commented on fcadd74 Nov 23, 2011

@leek of course we need to have a page giving the compatibility. but using 2.0 as first release of the bundle just because it is compatible with Symfony 2.0 does not make sense. What if we don't need any change for Symfony 2.2 but again for 2.3 ? Will we release 2.0, 2.1 and then 2.3 ?

@leek
leek commented on fcadd74 Nov 23, 2011

@stof The tagged version doesn't have to mean the version number of the bundle.

Take a look at the DoctrineMongoDBBundle as an example. This method works perfectly IMO.

Either way, let's get some sort of versioning here so that I don't have to version to a hash :)

@AD7six
AD7six commented on fcadd74 Nov 24, 2011

@stof creating a branch or tag to say "this code will work with symfony 2.0" does not mean "use the symfony version numbers with your own code".

Creating a branch/tag so that it can be pointed at, (and updating the readme) will prevent anybody who installs latest symfony stable and this bundle - dutifully following the instructions in the readme - from seeing this:

$ php bin/vendors update
....
PHP Fatal error:  Call to undefined method Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension::addSecurityListenerFactory() in /home/andy/www/apps/project/vendor/bundles/FOS/FacebookBundle/FOSFacebookBundle.php on line 25
PHP Stack trace:
PHP   1. {main}() /home/andy/www/apps/project/app/console:0
PHP   2. Symfony\Component\Console\Application->run() /home/andy/www/apps/project/app/console:22
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/andy/www/apps/project/vendor/symfony/src/Symfony/Component/Console/Application.php:118
PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() /home/andy/www/apps/project/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:66
PHP   5. Symfony\Component\HttpKernel\Kernel->boot() /home/andy/www/apps/project/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:80
PHP   6. Symfony\Component\HttpKernel\Kernel->initializeContainer() /home/andy/www/apps/project/app/bootstrap.php.cache:513
PHP   7. Symfony\Component\HttpKernel\Kernel->buildContainer() /home/andy/www/apps/project/app/bootstrap.php.cache:779
PHP   8. FOS\FacebookBundle\FOSFacebookBundle->build() /home/andy/www/apps/project/app/bootstrap.php.cache:848
$

Which leads to a lot of googling and annoyance. Of all the bundles in my deps file - FOSFacebookBundle is the only one that needs version=AHASH

C'mon - be helpful. You know you want to ;):

$ git branch 2.0 b3bfbfc2898d62ccb3ec697cafe32f374928d49c
$ git checkout 2.0
$ git push origin 2.0
@stof
Member
stof commented on fcadd74 Nov 24, 2011

@AD7six I already created a tag, releasing the 1.0.0 version of this bundle.

@AD7six
AD7six commented on fcadd74 Nov 24, 2011

Awesome stuff @stof :)

@kriswallsmith
Member

We should create a branch for Symfony 2.0 compatibility, otherwise there is no way to submit a bugfix PR.

@jmikola
Member

I concur with @kriswallsmith. Moving forward, we should maintain a 2.0 branch. I'm already a bit confused by d01d6f9, which follows this commit but still assumes master (with this non-BC commit) is to be tested against 2.0.

@lsmith77
Member

ok .. 2.0 branch is created. .travis.yml adjusted accordingly.

Please sign in to comment.