Skip to content

Commit 5e98d65

Browse files
committed
DatabaseExtension: added support for constants in options values
1 parent ca96ac0 commit 5e98d65

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Bridges/DatabaseDI/DatabaseExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ private function setupDatabase($config, $name): void
6767
$builder = $this->getContainerBuilder();
6868

6969
foreach ((array) $config['options'] as $key => $value) {
70+
if (is_string($value) && preg_match('#^PDO::\w+\z#', $value)) {
71+
$config['options'][$key] = $value = constant($value);
72+
}
7073
if (preg_match('#^PDO::\w+\z#', $key)) {
7174
unset($config['options'][$key]);
7275
$config['options'][constant($key)] = $value;

0 commit comments

Comments
 (0)