Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Optimal Folder structure of a Zend Framework Project for future growth

Posted on 2009-05-07
4
Medium Priority
?
919 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 750 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

972 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