Skip to content
This repository was archived by the owner on Nov 14, 2019. It is now read-only.

Commit 70771ec

Browse files
committed
feature #245 Using Guzzle instead of file_get_contents to fetch .gitignore file (marius.puiu, mariuspuiu)
This PR was merged into the 1.0-dev branch. Discussion ---------- Using Guzzle instead of file_get_contents to fetch .gitignore file Fixing issue #242 Replaced `file_get_contents` to get `.gitignore` file with `Guzzle` (to bypass proxy issues). Commits ------- ca2db3a Reverted DownloadCommand.php permissions 352f4d9 Using Guzzle instead of file_get_contents to fetch .gitignore file (issue #242)
2 parents ee9a334 + ca2db3a commit 70771ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Installer/DownloadCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,14 @@ protected function createGitIgnore()
320320
{
321321
if (!is_file($path = $this->projectDir.'/.gitignore')) {
322322
try {
323-
$this->fs->dumpFile($path, @file_get_contents(sprintf(
323+
$client = $this->getGuzzleClient();
324+
325+
$response = $client->get(sprintf(
324326
'https://raw.githubusercontent.com/symfony/symfony-standard/v%s/.gitignore',
325327
$this->getInstalledSymfonyVersion()
326-
)));
328+
));
329+
330+
$this->fs->dumpFile($path, $response->getBody()->getContents());
327331
} catch (\Exception $e) {
328332
// don't throw an exception in case the .gitignore file cannot be created,
329333
// because this is just an enhancement, not something mandatory for the project

0 commit comments

Comments
 (0)