src/Silex/Provider/YamlConfigServiceProvider.php
public function register(Application $app)
    {
        if (is_null($this->filename)) {
            throw new \RuntimeException('You must provide a valid config filename');
        }
        if (!file_exists($this->filename)) {
            throw new \RuntimeException(sprintf('Config path \'%s\' is not valid', $this->filename));
        }
        if (!is_readable($this->filename)) {
            throw new \RuntimeException(sprintf('Config path \'%s\' is not readable', $this->filename));
        }
        $parser = new YamlParser();
        $config = $parser->parse(file_get_contents($this->filename));
        if (is_array($config) && !empty($config)) {
            if (isset($app['config']) && is_array($app['config'])) {
                $config = array_replace_recursive($app['config'], $config);
            }
            $app['config'] = $config;
        }
    }
public function register(Application $app)
    {
        if (is_null($this->filename)) {
            throw new \RuntimeException('You must provide a valid config filename');
        }
        if (!file_exists($this->filename)) {
            throw new \RuntimeException(sprintf('Config path \'%s\' is not valid', $this->filename));
        }
        if (!is_readable($this->filename)) {
            throw new \RuntimeException(sprintf('Config path \'%s\' is not readable', $this->filename));
        }
        $parser = new YamlParser();
        $config = $parser->parse(file_get_contents($this->filename));
        if (is_array($config) && !empty($config)) {
            if (isset($app['config']) && is_array($app['config'])) {
                $config = array_replace_recursive($app['config'], $config);
            }
            $app['config'] = $config;
        }
    }
Register this provider.

@param Silex\Application $app

@author Ronan Chilvers <ronan@d3r.com>