Solved

Optimal Folder structure of a Zend Framework Project for future growth

Posted on 2009-05-07
4
901 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

735 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