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

Commit

Permalink
Symfony install review
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Makdessi authored and Antoine Makdessi committed Jan 3, 2016
1 parent ee9a334 commit be1f985
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2015 Fabien Potencier
Copyright (c) 2014-2016 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ automatically select the most recent version available for the given branch:

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

# Windows
c:\> php symfony new my_project 2.3
c:\> php symfony new my_project 2.8
```

**4. Start a new project based on a specific Symfony version**
Expand All @@ -90,10 +90,22 @@ argument and the exact Symfony version as the second argument:

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

# Windows
c:\> php symfony new my_project 2.5.6
c:\> php symfony new my_project 2.8.1
```

**5. Start a new project based on the Symfony demo version (lts)**

Execute the `demo` command:

```bash
# Linux, Mac OS X
$ symfony demo

# Windows
c:\> php symfony demo
```

Updating the installer
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Installer/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
Create a project based on a <info>specific Symfony branch</info>:
<comment>%3\$s new blog 2.3</comment>
<comment>%3\$s new blog 2.8</comment> or <comment>%3\$s new blog 3.0</comment>
Create a project based on a <info>specific Symfony version</info>:
<comment>%3\$s new blog 2.5.6</comment>
<comment>%3\$s new blog 2.8.1</comment> or <comment>%3\$s new blog 3.0.1</comment>
Create a <info>demo application</info> to learn how a Symfony application works:
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Installer/DownloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ protected function generateRandomSecret()

/**
* Returns the executed command with all its arguments
* (e.g. "symfony new blog 2.3.6").
* (e.g. "symfony new blog 2.8.1").
*
* @return string
*/
Expand Down
22 changes: 6 additions & 16 deletions src/Symfony/Installer/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@ protected function execute(InputInterface $input, OutputInterface $output)

/**
* Checks whether the given Symfony version is installable by the installer.
* (see http://symfony.com/roadmap)
* Due to the changes introduced in the Icu/Intl components
* (see http://symfony.com/blog/new-in-symfony-2-6-farewell-to-icu-component)
* not all the previous Symfony versions are installable by the installer.
*
* The rules to decide if the version is installable are as follows:
*
* - 2.0, 2.1, 2.2 and 2.4 cannot be installed because they are unmaintained.
* - 2.0, 2.1, 2.2, 2.4, 2.5 and 2.6 cannot be installed because they are unmaintained.
* - 2.3 can be installed starting from version 2.3.21 (inclusive)
* - 2.5 can be installed starting from version 2.5.6 (inclusive)
* - 2.6, 2.7, 2.8 and 2.9 can be installed regardless the version.
* - 2.7 and 2.8 can be installed regardless the version.
* - 3.0 can be installed regardless the version.
*
* @return NewCommand
*
Expand Down Expand Up @@ -133,8 +134,8 @@ protected function checkSymfonyVersionIsInstallable()
}
}

// 2.0, 2.1, 2.2 and 2.4 cannot be installed because they are unmaintained
if (preg_match('/^2\.[0124]\.\d{1,2}$/', $this->version)) {
// 2.0, 2.1, 2.2, 2.4, 2.5 and 2.6 cannot be installed because they are unmaintained
if (preg_match('/^2\.[012456]\.\d{1,2}$/', $this->version)) {
throw new \RuntimeException(sprintf(
"The selected version (%s) cannot be installed because it belongs\n".
"to an unmaintained Symfony branch which is not compatible with this installer.\n".
Expand All @@ -155,17 +156,6 @@ protected function checkSymfonyVersionIsInstallable()
));
}

// 2.5 can be installed starting from version 2.5.6 (inclusive)
if (preg_match('/^2\.5\.\d{1,2}$/', $this->version) && version_compare($this->version, '2.5.6', '<')) {
throw new \RuntimeException(sprintf(
"The selected version (%s) cannot be installed because this installer\n".
"is compatible with Symfony 2.5 versions starting from 2.5.6.\n".
"To solve this issue install Symfony manually executing the following command:\n\n".
'composer create-project symfony/framework-standard-edition %s %s',
$this->version, $this->projectDir, $this->version
));
}

// "-dev" versions are not supported because Symfony doesn't provide packages for them
if (preg_match('/^.*\-dev$/i', $this->version)) {
throw new \RuntimeException(sprintf(
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Installer/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function configure()
$this
->setName('self-update')
->setAliases(array('selfupdate'))
->setDescription('Update the installer to the latest version.')
->setDescription('Update the Symfony Installer to the latest version.')
->setHelp('The <info>%command.name%</info> command updates the installer to the latest available version.')
;
}
Expand Down

0 comments on commit be1f985

Please sign in to comment.