My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Lagged_Application  
An example bootstrap class for a Zend Framework application.
Phase-Implementation
Updated Feb 4, 2010 by klimp...@gmail.com

Introduction

This is not pretty, also not meant to be really used. It's more or less a glorified example bootstrap class. Please read and use if you find it useful. The reason I'm using a class is that my test's setUp() become easier.

Example code

examples/bootstrap.php

Documenation

In order to use this, please create an index.php router with the following:

<?php
include '/path/to/bootstrap.php';
$app = new Lagged_Application('production');
$app->start();
Zend_Controller_Front::getInstance()->dispatch();

Lagged_Application also expects a config.ini in app/etc/ with settings for DB, cookies, email, etc. and the various sections -- e.g. production, staging and testing -- see below.

app/etc/config.ini:

[production]
db.params.username = root
db.params.password =
db.params.host     = localhost
db.params.port     = 3306
db.params.dbname   = mysql

cookie.name   = lagged
cookie.path   = /
cookie.domain = .localhost

; the naming could be improved, I'm almost sure
; Zend_Mail would accept a Zend_Config instance then.
email.auth = 1
email.user = user@example.org
email.pass = user
email.host = smtp.example.org

[staging : production]
email.auth = 0

[testing : production]

Last but not least, you will also need to take care of autoload, at the minimum:

<?php
require_once 'Zend/Loader.php';
function __autoload($className) {
    // this is slow ;-)
    Zend_Loader::loadClass($className);
}

PHP-wise -- a standard PHP 5.2.x install with the APC extension.

Credits


Sign in to add a comment
Powered by Google Project Hosting