Select Page

Structuring a Project

Download the Symfony Standard Edition and unzip to a folder. Run bin/vendors to download and install all vendor libraries.

Git Repo

Create a git repo in the root of this folder and add a “.gitignore” file. Files to be excluded using the .gitignore should involve:

  • “.gitignore” itself
  • “.DS_Store” files from OSX Finder
  • common IDE project folders such as “.buildpath”, “.project” and “.settings”
  • files created by editors such as “*.swp” and “.bak”

The Symfony-specific files to ignore are:

  • “web/” – where the front-end controllers and “.htaccess” files are held. This would also hold any files uploaded to the server, so will be different from test to production.
  • “vendor/” – the “deps” and “deps.lock” files will be under version control, so there is no need for these files to be there. The “bin/vendors” script can install all the vendors in any environment.
  • “app/cache” and “app/logs” – these can left out as they are different between different environments. Do not exclude the whole of the “app/” directory as this also includes configuration files, which should be versioned.

A sample “.gitignore” file: