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

Commit 1cc8114

Browse files
committed
feature #105 Allow last LTS version to be installed. (94noni)
This PR was squashed before being merged into the 1.0-dev branch (closes #105). Discussion ---------- Allow last LTS version to be installed. Hi, I just wanted to add the possibility to install the latest Symfony LTS version directly via the installer (new command). Docs PR symfony/symfony-docs#5032 Feedbacks welcome :) Commits ------- 6c08849 Allow last LTS version to be installed.
2 parents 73db701 + 6c08849 commit 1cc8114

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,21 @@ $ symfony new my_project
4545
$ php symfony.phar new my_project
4646
```
4747

48-
**2. Start a new project based on a specific Symfony branch**
48+
**2. Start a new project with the latest Symfony LTS version**
49+
50+
Execute the `new` command and provide the name of your project as the first
51+
argument and `lts` as the second argument. The installer will automatically
52+
select the most recent LTS version available:
53+
54+
```bash
55+
# Linux, Mac OS X
56+
$ symfony new my_project lts
57+
58+
# Windows
59+
$ php symfony.phar new my_project lts
60+
```
61+
62+
**3. Start a new project based on a specific Symfony branch**
4963

5064
Execute the `new` command and provide the name of your project as the first
5165
argument and the branch number as the second argument. The installer will
@@ -59,7 +73,7 @@ $ symfony new my_project 2.3
5973
$ php symfony.phar new my_project 2.3
6074
```
6175

62-
**3. Start a new project based on a specific Symfony version**
76+
**4. Start a new project based on a specific Symfony version**
6377

6478
Execute the `new` command and provide the name of your project as the first
6579
argument and the exact Symfony version as the second argument:

src/Symfony/Installer/AboutCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
5454
5555
<comment>%s new blog</comment>
5656
57+
To create a new project called <info>blog</info> in the current directory using
58+
the <info>long term support version</info> of Symfony, execute the following command:
59+
60+
<comment>%s new blog lts</comment>
61+
5762
To base your project on a <info>specific Symfony branch</info>, append the branch
5863
number at the end of the command:
5964

src/Symfony/Installer/NewCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ private function checkSymfonyVersionIsInstallable()
137137
return $this;
138138
}
139139

140+
// 'lts' is a special version name that refers to the current long term support version
141+
if ('lts' === $this->version) {
142+
return $this;
143+
}
144+
140145
// validate semver syntax
141146
if (!preg_match('/^2\.\d(?:\.\d{1,2})?$/', $this->version)) {
142147
throw new \RuntimeException('The Symfony version should be 2.N or 2.N.M, where N = 0..9 and M = 0..99');

0 commit comments

Comments
 (0)