Where do you place all your files for Zend Framework?
I completed the quickstart tutorial, but I feel really unclear on a few things. I started the guide initially expecting everything to be on my remote server, but it actually seems to be a guide for a local setup. I have everything on my server, and I have the hosts file on my local computer routing to the server, for ex. this is the entry in my hosts file server-ip quickstart.local
.
1) Currently, I have everything beneath public_html
. Where should I put all the开发者_高级运维 Zend files (bin, demos, incubator, etc..)? www/public_html/[zend-files]
,www/public_html/quickstart/
2) Where do I put the quickstart (project) folder? Am I supposed to create an index.php that routes to the public folder in the project folder? At the moment, it is at public_html/quickstart/
.
I feel silly and embarrassed for asking, because I feel like this is something really obvious.
Actually, you'll need only the Zend folder, which is the library itself.
On the public_html
you need to put only the files located in the public
folder of your project.
Folders like application
and library
should stay out of public_html.
For example
/home/my_project/public_html
(public folder from zend)
/home/my_project/private
(the other files, like application and library)
Instead of put the Zend library inside your project library
folder, you can put it on the php include_path
.
The second option, maybe the best, is to configure your virtual hosts and set the public
folder (application public folder) as the root folder for your domain quickstart-local
So, you will end up with /home/my_project/public
as your root folder and /home/my_project/application
as your private folder.
You'll need to setup your index.php
and application.ini
with the appropriated paths.
As soon as you work with more than one framework version at a time, using symlinks becomes a good option. It is also much better for development than using the include path because you automatically have code assist for ZF code. We organize our projects as follows:
/application
/httpdocs
/library
/Project
/Zend (->symlink to the Zend folder of the needed version)
/ZendX (->dito)
/tests
And now, if you're about to say that 'symlinks' don't work on Windows, don't say it. It's utter rubish. It works perfectly well.
精彩评论