Design directory file name of module

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
coolesting
Forum Newbie
Posts: 13
Joined: Thu Sep 02, 2010 12:36 am

Design directory file name of module

Post by coolesting »

Hi, everyone.
Recently, i design a lightweight framework that involves the directory structure of module,
i have two schemes, i don't know which is the best, anybody could give me some advise,
thanks guys.

First approach , as the following ,

acl
++module.install
++module.view
++module.admin
user
++module.install
++module.view
....
post
++module.install
++module.view
....


and second approach,
acl
++acl.install
++acl.view
++acl.admin
user
++user.install
++user.view
....
post
++post.install
....

Personally, i think the first one has advantage when including file , like this
"include_once 'module_name/module.view'; ", it is not necessary to consider more situation,
such as we don't worry about the path in file included when changing the module name.
but the second approach maybe has more readable to the developer.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Design directory file name of module

Post by Christopher »

Neither in my opinion. I would prefer just "include_once 'module_name/view'; " where the class inside the file uses PEAR naming conventions.
(#10850)
Post Reply