Creating a project structure

The following is the folder structure of our app:

  • blog/: App root created earlier
  • bin/: Specific command line tools of our blog app
  • config/: Configuration files of our app
  • data/: The SQLite database will be stored here
  • src/: All PHP classes we write will be here
  • vendor/: This is where Composer (see the following section) stores all downloaded dependencies including the source code of Doctrine
  • bin/: This is a command-line tool provided by dependencies installed with Composer
  • web/: This is the public directory that contains PHP pages and assets such as images, CSS, and JavaScript files

We must create all these directories except the vendor/ one that will be automatically generated later.

Get Persistence in PHP with Doctrine ORM now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.