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

Commit b26b217

Browse files
committed
Added support for RC versions and normalized version names
1 parent 31765ca commit b26b217

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Symfony/Installer/NewCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ protected function checkSymfonyVersionIsInstallable()
111111
}
112112

113113
// validate semver syntax
114-
if (!preg_match('/^2\.\d(?:\.\d{1,2})?(-(dev|BETA\d*))?$/i', $this->version)) {
115-
throw new \RuntimeException('The Symfony version should be 2.N or 2.N.M, where N = 0..9 and M = 0..99. The special "-dev" or "-BETA" suffixes are also supported.');
114+
if (!preg_match('/^2\.\d(?:\.\d{1,2})?(?:-(?:dev|BETA\d*|RC\d*))?$/i', $this->version)) {
115+
throw new \RuntimeException('The Symfony version should be 2.N or 2.N.M, where N = 0..9 and M = 0..99. The special "-dev" "-BETA" and "-RC" suffixes are also supported.');
116116
}
117117

118118
if (preg_match('/^2\.\d$/', $this->version)) {
@@ -183,8 +183,10 @@ protected function checkSymfonyVersionIsInstallable()
183183
}
184184

185185
// warn the user when downloading an unstable version
186-
if (preg_match('/^.*\-BETA\d*$/i', $this->version)) {
186+
if (preg_match('/^.*\-(BETA|RC)\d*$/i', $this->version)) {
187187
$this->output->writeln("\n <bg=red> WARNING </> You are downloading an unstable Symfony version.");
188+
// versions provided by the download server are case sensitive
189+
$this->version = strtoupper($this->version);
188190
}
189191

190192
return $this;

0 commit comments

Comments
 (0)