diff --git a/src/Symfony/Installer/NewCommand.php b/src/Symfony/Installer/NewCommand.php index ece1518..6435064 100755 --- a/src/Symfony/Installer/NewCommand.php +++ b/src/Symfony/Installer/NewCommand.php @@ -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; @@ -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) @@ -62,6 +62,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this ->checkProjectName() ->checkSymfonyVersionIsInstallable() + ->initializeRemoteFileUrl() ->download() ->extract() ->cleanUp() @@ -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; + } }