private function getYamlConfiguration(ConnectionAdapterInterface $connection, $stage, $configurationFile, $configurationDistributionFile)
    {
        $configuration = array();
        if ($connection->isFile($configurationFile)) {
            $configuration = Yaml::parse($connection->getContents($configurationFile));
        }

        $distributionConfiguration = array();
        if ($connection->isFile($configurationDistributionFile)) {
            $distributionConfiguration = Yaml::parse($connection->getContents($configurationDistributionFile));
        }

        $stageSpecificConfiguration = array();
        if (isset($this->stageSpecificConfigurations[$stage])) {
            $stageSpecificConfiguration = $this->stageSpecificConfigurations[$stage];
        }

        $configuration = array_replace_recursive($distributionConfiguration, $configuration, $this->configuration, $stageSpecificConfiguration);
        foreach ($this->generateValueForParameters as $generateValueForParameter) {
            $this->findKeyAndGenerateValue($configuration, explode('.', $generateValueForParameter));
        }
        $configuration = $this->addEnvironmentVariables($configuration);

        return Yaml::dump($configuration);
    }