1 | <?php |
||
2 | |||
3 | namespace rAPId\Data; |
||
4 | |||
5 | use EasyDb\Core\Config as EasyDbConfig; |
||
6 | use EasyDb\Core\ConnectionPool; |
||
7 | use EasyDb\Core\DB as EasyDb; |
||
8 | use rAPId\Config\Config; |
||
9 | |||
10 | class DB |
||
11 | { |
||
12 | /** |
||
13 | * @param string $key |
||
14 | * |
||
15 | * @return EasyDb |
||
16 | */ |
||
17 | public static function getDB($key = 'primary') { |
||
18 | |||
19 | $config = Config::val("db.$key"); |
||
20 | $easy_db_config = new EasyDbConfig($config); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
21 | |||
22 | return ConnectionPool::getDbInstance($easy_db_config); |
||
23 | } |
||
24 | } |