diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index c61d6944..5e4dba45 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -194,6 +194,10 @@ private function createPersistenceNode(): NodeDefinition // In-memory persistence ->scalarNode('in_memory') ->end() + // Extensibility point + ->scalarNode('custom') + ->cannotBeEmpty() + ->end() ->end() ; diff --git a/src/DependencyInjection/LeagueOAuth2ServerExtension.php b/src/DependencyInjection/LeagueOAuth2ServerExtension.php index dcff3006..4f091fc7 100644 --- a/src/DependencyInjection/LeagueOAuth2ServerExtension.php +++ b/src/DependencyInjection/LeagueOAuth2ServerExtension.php @@ -238,7 +238,12 @@ private function configurePersistence(LoaderInterface $loader, ContainerBuilder $loader->load('storage/doctrine.php'); $this->configureDoctrinePersistence($container, $config, $persistenceConfig); break; + case 'custom': + $persistenceMethod = $persistenceConfig; + break; } + + $container->setParameter('league.oauth2_server.persistence.method', $persistenceMethod); } private function configureDoctrinePersistence(ContainerBuilder $container, array $config, array $persistenceConfig): void