You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 14, 2019. It is now read-only.
feature #185 Improve the installation of -dev and -BETA versions (94noni, javiereguiluz)
This PR was merged into the 1.0-dev branch.
Discussion
----------
Improve the installation of -dev and -BETA versions
This finishes #159, which is related to #144 and #143.
The new behavior of the installer:
1) When installing a regular Symfony version, nothing changes from the previous installer.
2) When you install a `beta` version, you see a warning message:

3) When you try to install a `dev` version, you get a better error message and a link to the article that will solve your problem:

Commits
-------
6751701 Fixed again one test
3ea393a Fixed one test
f45a29a Fixed again the version parser regexp
165813c Added new tests for BETA and RC versions
9e41335 Updated the version parser regular expression
b26b217 Added support for RC versions and normalized version names
31765ca Made comparisons case insensitive because Composer doesn't differentiate 'BETA1' from 'beta1'
9b3cdc1 The trailing number is only available for BETA versions not for 'dev' versions
d03938f Fixed syntax issues
d67b4ad Improved the error message for "-dev" versions
4c26d2b Warn the user when downloading an unstable version
94a1f98 Simplified the new feature a bit
d58812a Installation dev/beta versions (143)
// 'latest' is a special version name that refers to the latest stable version
108
-
// available at the moment of installing Symfony
109
-
if ('latest' === $this->version) {
110
-
return$this;
111
-
}
112
-
113
108
// 'lts' is a special version name that refers to the current long term support version
114
-
if ('lts' === $this->version) {
109
+
if (in_array($this->version, array('latest', 'lts'))) {
115
110
return$this;
116
111
}
117
112
118
113
// validate semver syntax
119
-
if (!preg_match('/^2\.\d(?:\.\d{1,2})?$/', $this->version)) {
120
-
thrownew \RuntimeException('The Symfony version should be 2.N or 2.N.M, where N = 0..9 and M = 0..99');
114
+
if (!preg_match('/^2\.\d(?:\.\d{1,2})?(?:-(?:dev|BETA\d*|RC\d*))?$/i', $this->version)) {
115
+
thrownew \RuntimeException('The Symfony version must be 2.N or 2.N.M (where N and M are positive integers). The special "-dev", "-BETA" and "-RC" versions are also supported.');
121
116
}
122
117
123
118
if (preg_match('/^2\.\d$/', $this->version)) {
@@ -175,6 +170,25 @@ protected function checkSymfonyVersionIsInstallable()
175
170
));
176
171
}
177
172
173
+
// "-dev" versions are not supported because Symfony doesn't provide packages for them
174
+
if (preg_match('/^.*\-dev$/i', $this->version)) {
175
+
thrownew \RuntimeException(sprintf(
176
+
"The selected version (%s) cannot be installed because it hasn't\n".
177
+
"been published as a package yet. Read the following article for\n".
178
+
"an alternative installation method:\n\n".
179
+
"> How to Install or Upgrade to the Latest, Unreleased Symfony Version\n".
0 commit comments