Symfony\Installer\DownloadCommand::createGitIgnore PHP Method

createGitIgnore() protected method

Creates the appropriate .gitignore file for a Symfony project if it doesn't exist.
protected createGitIgnore ( )
    protected function createGitIgnore()
    {
        if (!is_file($path = $this->projectDir . '/.gitignore')) {
            try {
                $client = $this->getGuzzleClient();
                $response = $client->get(sprintf('https://raw.githubusercontent.com/symfony/symfony-standard/v%s/.gitignore', $this->getInstalledSymfonyVersion()));
                $this->fs->dumpFile($path, $response->getBody()->getContents());
            } catch (\Exception $e) {
                // don't throw an exception in case the .gitignore file cannot be created,
                // because this is just an enhancement, not something mandatory for the project
            }
        }
        return $this;
    }