Skip to content

Commit 96670e0

Browse files
author
Maxime Rault
committed
Add Lumen compatibility
1 parent dd65370 commit 96670e0

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/DB2ServiceProvider.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Cooperl\Database\DB2\Connectors\IBMConnector;
77
use Cooperl\Database\DB2\Connectors\ODBCZOSConnector;
88
use Illuminate\Support\ServiceProvider;
9-
use Config;
109

1110
/**
1211
* Class DB2ServiceProvider
@@ -39,18 +38,13 @@ public function boot()
3938
public function register()
4039
{
4140
// get the configs
42-
$conns = is_array(Config::get('laravel-db2::database.connections'))
43-
? Config::get('laravel-db2::database.connections')
44-
: [];
41+
$conns = is_array(config('laravel-db2::database.connections')) ? config('laravel-db2::database.connections') : [];
4542

4643
// Add my database configurations to the default set of configurations
47-
$this->app['config']['database.connections'] = array_merge(
48-
$conns,
49-
$this->app['config']['database.connections']
50-
);
44+
config(['database.connections' => array_merge($conns, config('database.connections'))]);
5145

5246
// Extend the connections with pdo_odbc and pdo_ibm drivers
53-
foreach (Config::get('database.connections') as $conn => $config) {
47+
foreach (config('database.connections') as $conn => $config) {
5448
// Only use configurations that feature a "odbc", "ibm" or "odbczos" driver
5549
if (!isset($config['driver']) || !in_array($config['driver'], ['odbc', 'ibm', 'odbczos'])) {
5650
continue;

0 commit comments

Comments
 (0)