2.5. Changing directory structure

2.5. Changing directory structure

Changing the directory structure is as simple as a config value. Paths are relative to the "home" config key which is "../" by default to refer to the project home from the index.php.

Example 2.12. Renaming directories

  • usr/ - Application directory (app/)

  • etc/ - Config directory (config/)

  • var/ - Data directory (data/)

  • /tmp/ - Temp directory (temp/)

<path>
    <app>usr</app>
    <config>etc</config>
    <data>var</data>
    <temp>/tmp</temp>
</path>

Example 2.13. Self-contained in document root directory structure

Moving from an external directory structure into one that is self-contained within the document root takes a little more work. We must change the paths in our include path to reflect the new paths and any paths in the bootstrap. Below is the changes required in the bootstrap config.

  • styles/ - Styles (web/styles)

  • scripts/ - Scripts (web/scripts)

  • images/ - Images (web/images)

  • myapp/ - Project Home (../)

  • index.php

<home>myapp</home>
<path>
    <web>../</web>
</path>