Invenzzia » Resources / Articles / A photo gallery tutorial / Preparations

2. Preparations

Let's begin with setting up the project directory structure. We will not use any external framework in order not to overload the article with more and more things. Instead, we will build a small set of the most basic functions that provide the minimum necessary for us to survive. The directory structure looks like this:

/
/actions
/doctrine
/doctrine/fixtures
/doctrine/migrations
/doctrine/schema
/doctrine/sql
/libs
/libs/Doctrine
/libs/Opl
/libs/Opt
/models
/photos
/photos/thumb
/templates
/templates_c
/tools

And here is the description:

  1. actions – the source codes of the actions that our photo gallery will be able to perform.
  2. doctrine – the information about the database for Doctrine.
  3. libs – the library sources.
  4. models – the models generated by Doctrine.
  5. photos – the directory for storing the uploaded images.
  6. templates – the source templates.
  7. templates_c – the precompiled templates.
  8. tools – additional tools (command-line interface for Doctrine).

The libraries can be downloaded from the following locations:

From the Doctrine archive, we take the lib directory and put it in our /libs. Doctrine.php must be located under /libs/Doctrine.php file. Then we take also the lib directory from the OPT archive and copy its contents to /libs. Finally, we should get something like this:

/libs/Doctrine/
/libs/Doctrine.php
/libs/Opl/
/libs/Opl/Base.php etc.
/libs/Opt/
/libs/Opt/Class.php etc.