Project Directory Structures - Please pick holes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
eazyGen
Forum Commoner
Posts: 46
Joined: Mon Aug 29, 2011 4:32 am
Location: Central London

Project Directory Structures - Please pick holes

Post by eazyGen »

Hi guys.

I am new to PHP, but experienced in other languages. My thoughts today centre on project directory structures. Here is what I have for my current (testing and learning) project. I would be grateful for any constructive criticism.

I have a local container directory called "Development", which I periodically upload to the server. This can be thought of as root. Plus within that, I have a single PHP file (index.php) and I will, in time, move my .haccess file there, plus I have the following directory structure:

Root
==>Controller
==>Data
==>Images
====>Decoration
====>Logos
======>Favicon
==>Includes
==>Javascript
==>UI
====>CSS
==>Work

As you can see I am trying out an MVC type approach to my test project. The directory purposes are:

Controller - Controller scripts
Data - Object Classes that wrap the database tables - I don't call this "Model" as I equate a model with a model and not a db table.
Images - Container for all images
Decoration - Non essential decorative images (these could easily just be placed in the "Images" folder)
Logos - Logos of varying size, branding etc (As above, could just be in "Images")
Favicon - My Favicon (again could just be in "Images")
Includes - Self explanatory I feel
Javascript - Javascripts (I have not progressed much with JS so this is a place holder and subject to change as I learn)
UI - This is usually called "View" from what I can see, but I don't like "View" in this context because I relate "View" to SQL. Plus, this really does contain UI files.
CSS - CSS
Work - This is just a dump of tests, mics files and anything else. It does not form part of the app.

So, apart from the fact that I should be calling MVC (Model, View, Controller) DUC (Data, UI, Controller - and some people will no doubt dislike this immensely) and I could combine the image folders - where would you say the weaknesses are with this approach?

The only other thing I guess would be to rename "Development" to the name of the project.

Many thanks for any response.

S
Post Reply