Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;

use function count;
use function explode;
use function in_array;
use function is_array;
use function is_string;
Expand Down Expand Up @@ -428,7 +429,20 @@ private function addConnectionsSection(ArrayNodeDefinition $rootNode): void
->end()
->end()
->arrayNode('extraOptions')
->prototype('variable')->end()
->children()
->scalarNode('mongocryptdURI')->end()
->booleanNode('mongocryptdBypassSpawn')->end()
->scalarNode('mongocryptdSpawnPath')->end()
->arrayNode('mongocryptdSpawnArgs')
->beforeNormalization()
->ifString()
->then(static fn ($v) => explode(' ', $v))
->end()
->prototype('scalar')->cannotBeEmpty()->end()
->end()
->scalarNode('cryptSharedLibPath')->end()
->booleanNode('cryptSharedLibRequired')->end()
->end()
->end()
->booleanNode('bypassQueryAnalysis')->end()
->arrayNode('tlsOptions')
Expand Down
2 changes: 1 addition & 1 deletion tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function testFullConfiguration(array $config): void
'mongocryptdURI' => 'mongodb://localhost:27020',
'mongocryptdBypassSpawn' => true,
'mongocryptdSpawnPath' => '%kernel.project_dir%/bin/mongocryptd',
'mongocryptdSpawnArgs' => '--pidfilepath=%kernel.project_dir%/var/mongocryptd.pid --idleShutdownTimeoutSecs=60',
'mongocryptdSpawnArgs' => ['--pidfilepath=%kernel.project_dir%/var/mongocryptd.pid', '--idleShutdownTimeoutSecs=60'],
'cryptSharedLibPath' => '%kernel.project_dir%/bin/mongo_crypt_v1.dylib',
'cryptSharedLibRequired' => true,
],
Expand Down
4 changes: 3 additions & 1 deletion tests/DependencyInjection/Fixtures/config/yml/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ doctrine_mongodb:
mongocryptdURI: 'mongodb://localhost:27020'
mongocryptdBypassSpawn: true
mongocryptdSpawnPath: '%kernel.project_dir%/bin/mongocryptd'
mongocryptdSpawnArgs: '--pidfilepath=%kernel.project_dir%/var/mongocryptd.pid --idleShutdownTimeoutSecs=60'
mongocryptdSpawnArgs:
- '--pidfilepath=%kernel.project_dir%/var/mongocryptd.pid'
- '--idleShutdownTimeoutSecs=60'
cryptSharedLibPath: '%kernel.project_dir%/bin/mongo_crypt_v1.dylib'
cryptSharedLibRequired: true

Expand Down