These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * @file |
||
4 | * Example settings to connect to MongoDB. |
||
5 | * |
||
6 | * This is the default data to add to your settings.local.php. |
||
7 | * |
||
8 | * Using this format instead of raw settings enables easier enabling/disabling |
||
9 | * of the MongoDB features by just commenting the last line out. |
||
10 | */ |
||
11 | |||
12 | $configureMongoDb = function (array $settings): array { |
||
13 | $settings['mongodb'] = [ |
||
14 | 'clients' => [ |
||
15 | // Client alias => connection constructor parameters. |
||
16 | 'default' => [ |
||
17 | 'uri' => 'mongodb://localhost:27017', |
||
18 | 'uriOptions' => [], |
||
19 | 'driverOptions' => [], |
||
20 | ], |
||
21 | ], |
||
22 | 'databases' => [ |
||
23 | // Database alias => [ client_alias, database_name ] |
||
24 | 'default' => ['default', 'drupal'], |
||
25 | 'logger' => ['default', 'logger'], |
||
26 | ], |
||
27 | ]; |
||
28 | |||
29 | return $settings; |
||
30 | }; |
||
31 | |||
32 | $settings = $configureMongoDb($settings); |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
33 |