Solved

Optimal Folder structure of a Zend Framework Project for future growth

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Maps API and PHP 25 49
website maintenance mode 1 25
MVC - procedural PHP 10 35
Ajax and PHP 9 29
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
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…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

808 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