Skip to content

Commit

Permalink
fixed config
Browse files Browse the repository at this point in the history
  • Loading branch information
JanHuang committed Feb 10, 2017
1 parent 8644d5a commit 31f4653
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/ServiceProvider/CacheServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public function register(Container $container)
return $this->cache;
});

config()->merge($config);

unset($config);
}
}
6 changes: 5 additions & 1 deletion src/ServiceProvider/ConfigServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class ConfigServiceProvider implements ServiceProviderInterface
*/
public function register(Container $container)
{
$container->add('config', new Config($container->get('config')));
$config = new Config($container->get('config'));

$config->load(app()->getAppPath() . '/config/config.php');

$container->add('config', $config);
}
}
1 change: 1 addition & 0 deletions tests/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function testConfigurationServiceProvider()
$app = $this->createApplication();

$this->assertEquals('fast-d', $app->get('config')->get('name'));
$this->assertEquals('bar', config()->get('foo'));
}

public function testLoggerServiceProvider()
Expand Down
5 changes: 0 additions & 5 deletions tests/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
])
],

/**
* User custom configure
*/
'config' => include __DIR__ . '/config.php',

/**
* Database config
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
*/

return [

'foo' => 'bar'
];

0 comments on commit 31f4653

Please sign in to comment.