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:
actions– the source codes of the actions that our photo gallery will be able to perform.
doctrine– the information about the database for Doctrine.
libs– the library sources.
models– the models generated by Doctrine.
photos– the directory for storing the uploaded images.
templates– the source templates.
templates_c– the precompiled templates.
tools– additional tools (command-line interface for Doctrine).
The libraries can be downloaded from the following locations:
- http://www.doctrine-project.org/download - version 1.1
- http://www.invenzzia.org/en/download – version 2.0
From the Doctrine archive, we take the
lib directory and put it in our
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.