protected function readConfig()
    {
        if (!$this->configLocator) {
            throw new \RuntimeException('No FileLocator for config file.');
        }

        // Get kernel environment
        $env = ($this->container->hasParameter('kernel.env')) ?
            $this->container->getParameter('kernel.env') :
            'prod';

        // Build file names
        $coreConfig = 'core.yml';
        $appConfig = 'app_' . $env . '.yml';

        $yamlLoader = new YamlFileLoader($this->container, $this->configLocator);

        // Load the yaml files, core config is required
        try {
            $yamlLoader->load($coreConfig);
        } catch (\InvalidArgumentException $e) {
            throw new ConfigFileException($coreConfig);
        }

        // Application config can be skipped if it doesn't exist.
        try {
            $yamlLoader->load($appConfig);
        } catch (\InvalidArgumentException $e) {}
    }