Bootstrapping the Application: the Standard Front Controller Resource Plugin
Thursday, September 24, 2009

The Zend Framework uses the front controller pattern. This involves all requests being channeled via a single object. To make use of the front controller you need to create an instance of Zend_Controller_Front and run it. Zend_Application automates this process. (more…)

Posted by James at 8:35 pm   0 comments

Bootstrapping the Application: the Standard Database Resource Plugin
Wednesday, September 23, 2009

The configuration of the standard database resource plugin Zend_Application_Resource_Db can be done easily via the configuration file. The following code (with sensitive settings hidden) shows how to set up the database adapter: (more…)

Posted by James at 4:29 pm   1 comment

Bootstrapping the Application: Resource Plugin Overview
Monday, September 21, 2009

The bootstrapping process supported by Zend_Application is based on a system of resource plugins. Each of these plugins is responsible for initialising an aspect of the system. There are a number of standard plugins already implemented; it is also possible to create your own, either to support something new, or to override an existing plugin. There are examples of each of these in the sample application. (more…)

Posted by James at 5:26 pm   0 comments

Bootstrapping the Application: Configuration File Overview
Sunday, September 20, 2009

The configuration file can either be in INI file or XML format. Personally, I have always used INI files with the Zend Framework, so that is the format that will be used in the sample application. (more…)

Posted by James at 4:06 pm   0 comments

Bootstrapping the Application: the index.php File
Saturday, September 19, 2009

The index.php file can be divided into three sections:

  1. Defining the global constants
  2. Setting the include paths
  3. Creating and running the Zend_Application object

(more…)

Posted by James at 12:58 pm   0 comments

Bootstrapping the Application: the .htaccess File
Friday, September 18, 2009

The crucial first stage of the bootstrapping process involves directing all requests for web pages and web services to the index.php file. On Apache, this is done by using mod_rewrite. The module needs to be enabled on the application’s web server; it also needs to be permitted for the application’s public web directory (htdocs). (more…)

Posted by James at 5:48 pm   0 comments

Bootstrapping the Application: Overview
Thursday, September 17, 2009

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…)

Posted by James at 3:04 pm   0 comments
« Previous Page