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

fix handling of missing patch version #120

Merged
merged 1 commit into from
Mar 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/Symfony/Installer/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Installer;

use GuzzleHttp\Client;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -53,7 +54,6 @@ protected function initialize(InputInterface $input, OutputInterface $output)
$this->projectDir = $this->fs->isAbsolutePath($directory) ? $directory : getcwd().DIRECTORY_SEPARATOR.$directory;
$this->projectName = basename($directory);
$this->version = trim($input->getArgument('version'));
$this->remoteFileUrl = 'http://symfony.com/download?v=Symfony_Standard_Vendors_'.$this->version;
}

protected function execute(InputInterface $input, OutputInterface $output)
Expand All @@ -62,6 +62,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this
->checkProjectName()
->checkSymfonyVersionIsInstallable()
->initializeRemoteFileUrl()
->download()
->extract()
->cleanUp()
Expand Down Expand Up @@ -382,4 +383,16 @@ protected function generateComposerProjectName()

return $name;
}

/**
* Builds the URL of the archive to download based on the validated version number.
*
* @return NewCommand
*/
private function initializeRemoteFileUrl()
{
$this->remoteFileUrl = 'http://symfony.com/download?v=Symfony_Standard_Vendors_'.$this->version;

return $this;
}
}