Sylius: Container can't build after removal of HWIOAuth

Created on 12 May 2016  路  3Comments  路  Source: Sylius/Sylius

I spent about 30 minutes trying to make sure this isn't a problem with me, and I am surprised its not reported yet. I am baffled as to how Travis CI runs, and would love any help on this.

After the parameters cleanup and the removal of HWIOAuth by default, my Symfony container is never able to build.

I tried to look into it, and it seems like Symfony shouldn't care because the sylius.oauth.user_provider service is lazy, but it breaks when the container tries to if ($definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) {, which causes the class to be parsed by PHP.

Full Stack Trace:

[11-May-2016 19:25:01 America/Vancouver] PHP Fatal error:  Interface 'HWI\Bundle\OAuthBundle\Connect\AccountConnectorInterface' not found in /www/shocke/vendor/sylius/sylius/src/Sylius/Bundle/UserBundle/OAuth/UserProvider.php on line 35
[11-May-2016 19:25:01 America/Vancouver] PHP Stack trace:
[11-May-2016 19:25:01 America/Vancouver] PHP   1. {main}() /www/shocke/web/app_dev.php:0
[11-May-2016 19:25:01 America/Vancouver] PHP   2. Symfony\Component\HttpKernel\Kernel->handle() /www/shocke/web/app_dev.php:13
[11-May-2016 19:25:01 America/Vancouver] PHP   3. Symfony\Component\HttpKernel\Kernel->boot() /www/shocke/app/bootstrap.php.cache:2512
[11-May-2016 19:25:01 America/Vancouver] PHP   4. Symfony\Component\HttpKernel\Kernel->initializeContainer() /www/shocke/app/bootstrap.php.cache:2481
[11-May-2016 19:25:01 America/Vancouver] PHP   5. Symfony\Component\DependencyInjection\ContainerBuilder->compile() /www/shocke/app/bootstrap.php.cache:2703
[11-May-2016 19:25:01 America/Vancouver] PHP   6. class_exists() /www/shocke/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:597
[11-May-2016 19:25:01 America/Vancouver] PHP   7. spl_autoload_call() /www/shocke/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:597
[11-May-2016 19:25:01 America/Vancouver] PHP   8. Composer\Autoload\ClassLoader->loadClass() /www/shocke/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:597
[11-May-2016 19:25:01 America/Vancouver] PHP   9. Composer\Autoload\includeFile() /www/shocke/vendor/composer/ClassLoader.php:301
[11-May-2016 19:25:01 America/Vancouver] PHP  10. include() /www/shocke/vendor/composer/ClassLoader.php:412

Edit: I see HWIOAuth in require-dev, I wonder why this isn't working for me.
Edit 2: I figured it out, see comment.

Most helpful comment

Ok so this is a bug with Sylius-Standard. Anything in require-dev for sylius will not be loaded in symfony-standard unless it is also explicitly set in the projects require-dev

@pjedrzejewski: I thin the right solution is to actually remove the definition of the lazy service, and also remove hwi oauth from composer completely. Once the cookbook is out for hwi oauth integration, it can list all the necessary steps. What do you think?

All 3 comments

I also made sure I took the changes in https://github.com/Sylius/Sylius-Standard/pull/95 into account (most importantly, removing the reference to the user provider in the security.yml).

Ok so this is a bug with Sylius-Standard. Anything in require-dev for sylius will not be loaded in symfony-standard unless it is also explicitly set in the projects require-dev

@pjedrzejewski: I thin the right solution is to actually remove the definition of the lazy service, and also remove hwi oauth from composer completely. Once the cookbook is out for hwi oauth integration, it can list all the necessary steps. What do you think?

Should be fixed in #5024, thanks @inssein for reporting!

Was this page helpful?
0 / 5 - 0 ratings