Skip to content
This repository was archived by the owner on Jan 3, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/DerAlex/Silex/YamlConfigServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
******************************************************************************/
namespace DerAlex\Silex;

use Silex\Application;
use Silex\ServiceProviderInterface;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use Symfony\Component\Yaml\Yaml;


Expand All @@ -35,16 +35,16 @@ public function __construct($file) {
$this->file = $file;
}

public function register(Application $app) {
public function register(Container $pimple) {
$config = Yaml::parse(file_get_contents($this->file));

if (is_array($config)) {
$this->importSearch($config, $app);
$this->importSearch($config, $pimple);

if (isset($app['config']) && is_array($app['config'])) {
$app['config'] = array_replace_recursive($app['config'], $config);
if (isset($pimple['config']) && is_array($pimple['config'])) {
$pimple['config'] = array_replace_recursive($pimple['config'], $config);
} else {
$app['config'] = $config;
$pimple['config'] = $config;
}
}

Expand Down