Solved

Optimal Folder structure of a Zend Framework Project for future growth

Posted on 2009-05-07
4
894 Views
Last Modified: 2013-12-12
Hi All,

I am building a software that is going to be used by many users.
Each user will have his/her own area to upload files.
Some clients may require a customized version of the software.
My code start with "My" prefix and follows Zend Framework's class conventions.
My and Zend Framework's code may need to be shared among the installations.
It'll run on a linux/unix server.

Could you give me some suggestions how to organize the folder structure to be easy for future updates.

Option #1
Public area
www/themes
www/modules/module1/image
www/modules/module1/css
www/modules/module1/js

Non-public area
app/application/controllers
app/modules
library/Zend
library/My

Option #2
www/themes
www/modules/module1/image
www/modules/module1/css
www/modules/module1/js

Non-public area
app/application/controllers
app/modules
/usr/local/myproduct/library/Zend
/usr/local/myproduct/library/1.0.0/My

Option #3 (best option ?)
www/themes
www/modules/module1/image
www/modules/module1/css
www/modules/module1/js

Non-public area
app/application/controllers
app/modules
/usr/local/myproduct/1.0.0/library/Zend
/usr/local/myproduct/1.0.0/library/My
/usr/local/myproduct/1.0.0-vip/library/My
/usr/local/myproduct/1.0.0-vip/library/Zend



0
Comment
Question by:svetoslavm
  • 2
4 Comments
 

Expert Comment

by:skeetio
ID: 24338378
Take a look at the folder structure that is created using the new Zend_Tool project generator (http://framework.zend.com/manual/en/zend.tool.project.html).  This is the defacto "conventional" project structure which will match up with with the defaults set within the framework as well as with most tutorials and documentation.
0
 

Author Comment

by:svetoslavm
ID: 24342028
Thanks for the reply.

What I am looking is how to organize the folder structure to be able to handle future growth and also updates in different modules.
Let's say my software will be used by thousands of users.

Thanks again.
0
 
LVL 49

Accepted Solution

by:
Roonaan earned 250 total points
ID: 24351319
Hi,

From Zend Framework it is as far as I understand it, custom to put the controllers inside the modules:

#public:
yourproject.www
yourproject.www/media/images
yourproject.www/media/js
yourproject.www/media/css
#non-public
yourproject.modules
yourproject.modules/module1/controllers/controller1
yourproject.modules/module1/views/controller1/scripts/index.phtml
yourproject.libraries (or yourproject.inc)
yourproject.libraries/MyProject/ProjectSpecific/Code
# shared
/some/shared/folder/ZF
/some/shared/folder/My

Then configure your loader to handle all class loads that start with Zend_ or My_ from the shared folder, and the custom project code (MyProject_Class) from yourproject.libraries/MyProjects/Class.php etc
0
 

Author Closing Comment

by:svetoslavm
ID: 31579183
Thanks.
That's a good idea to put shared code in a separate folder.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now