views:

23

answers:

1

Hi,

I'm using Zend_Application to bootstrap my app.

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap

{ public static $frontController = null; public static $registry = null;

protected function _initEnvironment()
{
    ini_set('display_errors', true);
    //date_default_timezone_set('Europe/London');
}

protected function _initRegistry()
{
    self::$registry = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS);
    Zend_Registry::setInstance(self::$registry);
}

protected function _initConfiguration()
{
    $config = new Zend_Config_Ini(
        BASE_PATH . '/data/server/settings.ini',
        APPLICATION_ENV
    );
    self::$registry->configuration = $config;
}
protected function _initLogging() {
     $config = self::$registry->configuration;
     $logger = new Zend_Log(new Zend_Log_Writer_Stream($config->logging->file)); 
     Zend_Registry::set('logger', $logger);
}
protected function _initFrontController()
{
    self::$frontController = Zend_Controller_Front::getInstance();
    self::$frontController->throwExceptions(true);
    self::$frontController->returnResponse(true);
    self::$frontController->setControllerDirectory(
        APPLICATION_PATH .'/controllers'
    );
    self::$frontController->setParam('registry', self::$registry);
    return self::$frontController;
}
protected function _initView()
{
    $config = self::$registry->configuration;
    $view = new Zend_View;
    $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
    Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
    Zend_Layout::startMvc(
         array(
            'layoutPath' => APPLICATION_PATH . "/layouts/scripts",
            'layout' => "layout"
        )
        );
  return $view;
}
protected function _initDatabase()
{
    $config = self::$registry->configuration;
    $params = array('host'  => $config->database->hostname,
            'username' => $config->database->username, 
            'password' => $config->database->password, 
            'dbname'    => $config->database->database);
            $db = Zend_Db::factory($config->database->type, $params); 
    Zend_Registry::set('db', $db);
}
protected function _initPlaceholders() {
    $view = $this->getResource('View');
    $view->doctype('XHTML1_STRICT');
    $view->headTitle('Greplin')
         ->setSeparator(' / ');
    $view->headLink()->prependStylesheet('/src/css/header.css');
    $view->headScript()->prependFile('/js/site.js');
    return $view;
}

}

When I run the app I get a blank page. Filenames / paths are intact.

If I add die() to the bottom of my layout.phtml, I get the page.

Something is resetting the headers and sending a blank page. My error reporting is on and I get unrelated errors.

What could this be?!

Thanks!

A: 

It sounds like an error in your code is causing requests to be forwarded to your error controller. Make sure the following is set for your environment in application.conf:

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

Also check ErrorController.php to make sure something outputs when there's an error.

Of course, you should always check your server logs as well.

Isaac