How can I create a new Symfony project with the new directory structure?
symfony
Solution
It is still possible to trigger the question, and convert a project to the new directory structure. (but only if you are creating a new project, i.e. running `composer create-project`)
To do so, you need to set the `SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE` environment variable to `true`. This can be done by prepending `SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE=true` to the Composer command.
So in order to create a new project, run the following command in your terminal:
SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE=true composer create-project symfony/framework-standard-edition path/ "2.5.*"
and Composer will ask you if you want the new directory structure.
Update
As noted by barius in the comments, this feature has been removed from the Symfony Standard Edition per version 2.7.5. If you really want to use the Symfony 3 structure, you can get it by installing Symfony in 2 steps:
- Create a new Symfony project with a version constraint so you get the 2.6 version, which still asks you whether you want to use the new directory structure.
- Then change the version constraint for the `symfony/symfony` package so you'll still get the latest version.
So, execute the following commands from the command line:
SENSIOLABS_ENABLE_NEW_DIRECTORY_STRUCTURE=true composer create-project symfony/framework-standard-edition project-directory/ "2.6.*"
cd project-directory
composer require symfony/symfony ^2.7
Note: I don't actually recommend this, as this is not the official recommended way to create a new Symfony project. So unless you really know what you're doing, just use the Symfony Installer to create new projects.
Problem
Until some days ago, it was possible to create a new Symfony project with the new (Symfony 3) directory structure. When running `composer create-project symfony/framework-standard-edition path/ "2.5.*"`, Composer would ask the following question: Would you like to use Symfony 3 directory structure? [y/N] The new structure offered some improvements, such as `console` being moved from the `app` directory to the `bin` directory, and `phpunit.xml.dist` being moved from the `app` directory to the root directory. The cache and logs directories were moved to a new `var` directory. Take a look at this answer (written by me) for a full list of changes. However, a fresh install of the standard distribution no longer offers this option. It seems like the question has been removed on July 16th, because the new directory structure created too much confusion, especially for new users. See this issue on GitHub as well. Is it still possible to create a project using the new directory structure?