Skip to content

Commit

Permalink
Merge pull request #33 from nanasess/fix-remove-bundle
Browse files Browse the repository at this point in the history
プラグイン無効時にはConvertExceptionToResponseListenerを外す
  • Loading branch information
Kiyotaka Oku committed Jul 17, 2020
2 parents b07a2c9 + 9523199 commit 24dc2b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions DependencyInjection/Compiler/ApiCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ public function process(ContainerBuilder $container)
{
$this->configureAllowList($container);
$this->configureKeyPair($container);

$plugins = $container->getParameter('eccube.plugins.enabled');
if (!in_array('Api', $plugins)) {
if ($container->hasDefinition('Trikoder\Bundle\OAuth2Bundle\EventListener\ConvertExceptionToResponseListener')) {
$def = $container->getDefinition('Trikoder\Bundle\OAuth2Bundle\EventListener\ConvertExceptionToResponseListener');
$def->clearTags();
}
}
}

private function configureAllowList(ContainerBuilder $container)
Expand Down

0 comments on commit 24dc2b6

Please sign in to comment.