By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,966 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,966 IT Pros & Developers. It's quick & easy.

project directory tree/structure your favorite?

P: n/a
I have been working on a rather large project. And I have been
thinking about the structure of how I organize my project apps and
libraries. It's intended as a framework type system where you can
place in parts and configure as needed, there are shared libraries for
authentication, and common code for validation and data management.

Presently the directory tree is like this:

Menu.php
-app 1 dir (maillist.php, mailedit.php, mailreport.php etc.)
-app 2 dir (libraryedit.php, library reports.php, etc.)
-app 3 dir
-config dir
-shared libraries dir (datetimelib, dblib, etc.)
-system apps dir (admin tools: useredit.php, groupedit.php, etc.)

It works OK, but I go horizontally to include a library:
require_once "../libraries/somelib.php";

Having used Dokuwiki I've been pondering its always up structure,
where you have a shell doument at the root level of your project and
everything are in subfolders and you include included as needed into
the main (shell) app..

appshell.php (everything happens here)
- libraries
- config
- modules (apps)
- - admin module
- - module 1 (includes for app 1)
- - module 2
- - module 3

Have you tried this sort of structure?
What do you guys use/prefer?
Any tips that makes management easier?

Thanks
Dec 10 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
la***@portcommodore.com wrote:
...snipped...

Have you tried this sort of structure?
What do you guys use/prefer?
Any tips that makes management easier?
Well the structure depends on the project requirements. On my own
framework i use following structure:

/etc - misc files (readable)
/img - images (readable)
/lib - libaries (readable)
/sys - php files, classes and config files
/tpl/designname - template files of a design
/var - files created by the system/application
index.php - main file (readable)

(readable) mean that the web user can access these diretories/files.

The system and every application has their own folder in every of these
directories.

That way the system files and files of every application have their own
storage and are completly separated.

Joe
Dec 11 '07 #2

P: n/a
On Dec 10, 11:50 pm, Joe Scylla <joe.scy...@gmail.comwrote:
[snip]
>
The system and every application has their own folder in every of these
directories.

That way the system files and files of every application have their own
storage and are completly separated.

Joe
So, do the programss all run through index.php, or are they called
directly
Dec 11 '07 #3

P: n/a
la***@portcommodore.com wrote:
On Dec 10, 11:50 pm, Joe Scylla <joe.scy...@gmail.comwrote:
[snip]
>The system and every application has their own folder in every of these
directories.

That way the system files and files of every application have their own
storage and are completly separated.

Joe

So, do the programss all run through index.php, or are they called
directly
Every request goes through the index.php. The index.php calls a router
object that acts like the Zend_Controller_Router_Rewrite extraction the
information of the request and calling the requested application classes
and scripts.

So the scope of the script is always on the same level as the index.php.
A include statement for a libary will be the same for every application.

Joe
Dec 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.