1 | <?php |
||
2 | /** |
||
3 | * Configuration file for database service. |
||
4 | */ |
||
5 | return [ |
||
6 | // Services to add to the container. |
||
7 | "services" => [ |
||
8 | "db" => [ |
||
9 | "shared" => true, |
||
10 | "callback" => function () { |
||
11 | $db = new \Anax\Database\Database(); |
||
12 | |||
13 | // Load the configuration files |
||
14 | $cfg = $this->get("configuration"); |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
15 | $config = $cfg->load("database"); |
||
16 | |||
17 | // Set the database configuration |
||
18 | $connection = $config["config"] ?? []; |
||
19 | $db->setOptions($connection); |
||
20 | |||
21 | return $db; |
||
22 | } |
||
23 | ], |
||
24 | ], |
||
25 | ]; |
||
26 |