From a0903f52e553a11bbf2c4ee393ec26c607f56a1f Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Wed, 15 Apr 2015 00:29:53 +0200 Subject: [PATCH] Detect dev/beta versions and provide appropriate instruction --- src/Symfony/Installer/NewCommand.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Symfony/Installer/NewCommand.php b/src/Symfony/Installer/NewCommand.php index 39e7101..6f33f6d 100644 --- a/src/Symfony/Installer/NewCommand.php +++ b/src/Symfony/Installer/NewCommand.php @@ -182,6 +182,15 @@ protected function checkSymfonyVersionIsInstallable() )); } + if (preg_match('/^(\d\.\d)(\.\d{1,2})?-(dev|beta)\d*$/i', $this->version, $matches)) { + throw new \RuntimeException(sprintf( + "You are trying to install an unstable version (%s).\n". + "Please use composer to install such versions:\n\n". + 'composer create-project symfony/framework-standard-edition %s "%s.*" --stability=%s', + $this->version, $this->projectDir, $matches[1], strtolower($matches[3]) + )); + } + return $this; }