Bolt\Extension\ConfigTrait::copyDistFile PHP Method

copyDistFile() private method

Copy config.yml.dist to config/extensions.
private copyDistFile ( Bolt\Filesystem\Handler\YamlFile $file )
$file Bolt\Filesystem\Handler\YamlFile
    private function copyDistFile(YamlFile $file)
    {
        $app = $this->getContainer();
        $filesystem = $app['filesystem']->getFilesystem('extensions');
        /** @var YamlFile $distFile */
        $distFile = $filesystem->get(sprintf('%s/config/config.yml.dist', $this->getBaseDirectory()->getPath()), new YamlFile());
        if (!$distFile->exists()) {
            throw new \RuntimeException(sprintf('No config.yml.dist file found at extensions://%s', $this->getBaseDirectory()->getPath()));
        }
        $file->write($distFile->read());
        $app['logger.system']->info(sprintf('Copied %s to %s', $distFile->getFullPath(), $file->getFullPath()), ['event' => 'extensions']);
    }