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

Allow last LTS version to be installed. #105

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@ $ symfony new my_project
$ php symfony.phar new my_project
```

**2. Start a new project based on a specific Symfony branch**
**2. Start a new project with the latest Symfony LTS version**

Execute the `new` command and provide the name of your project as the first
argument and `lts` as the second argument. The installer will automatically
select the most recent LTS version available:

```bash
# Linux, Mac OS X
$ symfony new my_project lts

# Windows
$ php symfony.phar new my_project lts
```

**3. Start a new project based on a specific Symfony branch**

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

**3. Start a new project based on a specific Symfony version**
**4. Start a new project based on a specific Symfony version**

Execute the `new` command and provide the name of your project as the first
argument and the exact Symfony version as the second argument:
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Installer/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ protected function execute(InputInterface $input, OutputInterface $output)

<comment>%s new blog</comment>

To create a new project called <info>blog</info> in the current directory using
the <info>long term support version</info> of Symfony, execute the following command:

<comment>%s new blog lts</comment>

To base your project on a <info>specific Symfony branch</info>, append the branch
number at the end of the command:

Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Installer/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ private function checkSymfonyVersionIsInstallable()
return $this;
}

// 'lts' is a special version name that refers to the current long term support version
if ('lts' === $this->version) {
return $this;
}

// validate server syntax
if (!preg_match('/^2\.\d(?:\.\d{1,2})?$/', $this->version)) {
throw new \RuntimeException('The Symfony version should be 2.N or 2.N.M, where N = 0..9 and M = 0..99');
Expand Down