A Zend Framework application usually has the following basic structure. The application resides in a directory somewhere on the web server. The precise location depends on a number of factors. This directory will contain the following sub-directories:
- The public web directory: This is normally called htdocs on Apache, although it can have other names. This contains the files that should be accessible to the outside world; it will also contain any special system files that are used to control and modify requests, in particular the Apache .htaccess file.
- The application directory: By convention this is called application, although you could name it something else. It contains the implementation files.
- The library directory: This directory, which is usually named library, is optional, depending on the precise server set-up. It is intended to contain the Zend Framework files, plus any other libraries that the application uses. However, in an environment such as Zend Server, the Zend Framework is automatically installed and added to the include path, so the directory and its contents are not necessary.
The bootstrap mechanism works by using a set of key files located in these directories. (more…)