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

Commit 581df76

Browse files
committed
minor #66 always show an error message with PHP < 5.4 (xabbuh)
This PR was merged into the 1.0-dev branch. Discussion ---------- always show an error message with PHP < 5.4 Commits ------- 279cf17 always show an error message with PHP < 5.4
2 parents 23fecee + 279cf17 commit 581df76

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

src/Symfony/Installer/NewCommand.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
5757
$this->output = $output;
5858

5959
$this
60-
->checkInstalledPhpVersion()
6160
->checkProjectName()
6261
->checkSymfonyVersionIsInstallable()
6362
->download()
@@ -68,29 +67,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
6867
;
6968
}
7069

71-
/**
72-
* Checks if the system has PHP 5.4 or higher installed, which is a requirement
73-
* to execute the installer.
74-
* @return $this
75-
*/
76-
private function checkInstalledPhpVersion()
77-
{
78-
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
79-
throw new \RuntimeException(sprintf(
80-
"Symfony Installer requires PHP 5.4 version or higher and your system has\n".
81-
"PHP %s version installed.\n\n".
82-
"To solve this issue, upgrade your PHP installation or install Symfony manually\n".
83-
"executing the following command:\n\n".
84-
"composer create-project symfony/framework-standard-edition %s %s",
85-
PHP_VERSION,
86-
$this->projectName,
87-
'latest' !== $this->version ? $this->version : ''
88-
));
89-
}
90-
91-
return $this;
92-
}
93-
9470
/**
9571
* Checks whether it's safe to create a new project for the given name in the
9672
* given directory.

symfony

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
#!/usr/bin/env php
22
<?php
33

4+
if (PHP_VERSION_ID < 50400) {
5+
file_put_contents('php://stderr', sprintf(
6+
"Symfony Installer requires PHP 5.4 version or higher and your system has\n".
7+
"PHP %s version installed.\n\n".
8+
"To solve this issue, upgrade your PHP installation or install Symfony manually\n".
9+
"executing the following command:\n\n".
10+
"composer create-project symfony/framework-standard-edition <project-name> <symfony-version>\n\n",
11+
PHP_VERSION
12+
));
13+
14+
exit(1);
15+
}
16+
417
require file_exists(__DIR__.'/vendor/autoload.php')
518
? __DIR__.'/vendor/autoload.php'
619
: __DIR__.'/../../autoload.php';

0 commit comments

Comments
 (0)