All pastes #404118 Raw Edit

Ralph

public php v1 · immutable
·published 2007-03-20 20:36 UTC
rendered paste body
<?php// SET ERROR REPORTING LEVEL (ALWAYS STIVE FOR THIS LEVEL)error_reporting(E_ALL | E_STRICT);// SET THE LIBRARY PATHdefine('LIBRARY_PATH', '../application/library/');ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . LIBRARY_PATH);// ZEND FRAMEWORKrequire_once 'Zend/Loader.php';// BOOTSTRAP - SETUP & CONFIGUREtry {    // AUTOLOADER    function __autoload($class) {        Zend_Loader::loadClass($class);    }    // CONFIG    $config = new Zend_Config(new Zend_Config_Ini('../application/config/config.ini', 'development'));        // REGISTRY    $registry = new Zend_Registry();        // DATABASE    $database_connection = Zend_Db::factory($config->database->adapter, $config->database->options->asArray());    $registry->database_connection = $database_connection;        // SESSION    Zend_Session::setOptions($config->session->asArray());    Zend_Session::start();        // AUTH    $auth = Zend_Auth::getInstance();    $registry->auth = $auth;    // MODEL (Table Gateway)    ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../application/user/models/');    Zend_Db_Table::setDefaultAdapter($database_connection);        // VIEW    $view = new Zend_View();    $view->setScriptPath('../application/user/views/');    $registry->view = $view;        // CONTROLLER    $controller = Zend_Controller_Front::getInstance();    $controller->setControllerDirectory('../application/user/controllers')               ->setParam('registry', $registry);    } catch (Exception $e) {    die( 'Setup Exception: ' . $e->getMessage() );}$controller->returnResponse(true);$response = $controller->dispatch();if ($response->isException()) {    $exceptions = $response->getException();    echo 'Exception Found: <br>';    print_r($exceptions);} else {    $response->sendHeaders();    $response->outputBody();}