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 #257 Check that the system has the PHP version required by Symfony (javiereguiluz)
This PR was squashed before being merged into the 1.0-dev branch (closes#257).
Discussion
----------
Check that the system has the PHP version required by Symfony
This fixes #239.
Commits
-------
e7b3fc3 Check that the system has the PHP version required by Symfony
// 'latest' is a special version name that refers to the latest stable version
114
-
// 'lts' is a special version name that refers to the current long term support version
115
-
if (in_array($this->version, array('latest', 'lts'))) {
116
-
return$this;
113
+
// validate the given version syntax
114
+
if (!preg_match('/^latest|lts|[2-9]\.\d(?:\.\d{1,2})?(?:-(?:dev|BETA\d*|RC\d*))?$/i', $this->version)) {
115
+
thrownew \RuntimeException(sprintf(
116
+
"The Symfony version can be a branch number (e.g. 2.8), a full version\n".
117
+
"number (e.g. 3.1.4), a special word ('latest' or 'lts') and a unstable\n".
118
+
"version number (e.g. 3.2.0-rc1) but '%s' was given.", $this->version
119
+
));
117
120
}
118
121
119
-
// validate semver syntax
120
-
if (!preg_match('/^[23]\.\d(?:\.\d{1,2})?(?:-(?:dev|BETA\d*|RC\d*))?$/i', $this->version)) {
121
-
thrownew \RuntimeException('The Symfony version must be 2.N, 2.N.M, 3.N or 3.N.M (where N and M are positive integers). The special "-dev", "-BETA" and "-RC" versions are also supported.');
122
+
// Get the full list of Symfony versions to check if it's installable
@@ -92,6 +96,19 @@ public function testSymfonyInstallation($versionToInstall, $messageRegexp, $vers
92
96
);
93
97
}
94
98
99
+
/**
100
+
* @expectedException \RuntimeException
101
+
* @expectedExceptionMessageRegExp /.+The selected version \(3.0.0\) cannot be installed because it requires.+PHP 5.5.9 or higher and your system has PHP 5.4.* installed.+/s
0 commit comments