Frage bzgl. ZendFramework 1.8 - Zend_Application und registerPlugin

Samuel

Erfahrenes Mitglied
Guten Tag liebe Community,
ich habe folgende index.php
PHP:
<?php

define('BASE_PATH', realpath(dirname(__FILE__) . '/../'));
define('APPLICATION_PATH', BASE_PATH . '../application');


set_include_path('.'
    . PATH_SEPARATOR . '../library'
    . PATH_SEPARATOR . '../library/Plugin'
    . PATH_SEPARATOR . get_include_path()
);

if(!defined('APPLICATION_ENVIRONMENT')) {
    define('APPLICATION_ENVIRONMENT', 'development');
}

require_once 'Zend/Application.php';

$application = new Zend_Application(APPLICATION_ENVIRONMENT,
    array(
        'bootstrap' => array('path' => APPLICATION_PATH . '/bootstrap.php')
    ));
$application->bootstrap();

try {
    $application->run();
} catch(Exception $e) {
    if(APPLICATION_ENVIRONMENT == 'development')
    {
        echo '<strong>' . $e->getMessage() . '</strong>';
        echo '<pre>' . $e->getTraceAsString() . '</pre>';
    }
    exit(1);
}
und folgende bootstrap.php
PHP:
<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected $_config;

    protected function _initConfig()
    {
        // config
        $this->_config = new Zend_Config_Ini(APPLICATION_PATH
            . '/config/cosierCustomer.ini', APPLICATION_ENVIRONMENT);
        Zend_Registry::set('config', $this->_config);
        Zend_Registry::set('env', APPLICATION_ENVIRONMENT);

        // debugging
        if($this->_config->debug) {
            error_reporting(E_ALL | E_STRICT);
            ini_set('display_errors', 'on');
              
        }
    }

    protected function _initDB()
    {
        // Database
        if($this->_config->db) {
            $dbAdapter = Zend_Db::factory($this->_config->db);
            Zend_Db_Table::setDefaultAdapter($dbAdapter);
            Zend_Registry::set('dbAdapter', $dbAdapter);
        }
    }

    protected function _initView()
    {
        // view and layout setup
        Zend_Layout::startMvc(array(
            'layoutPath' => APPLICATION_PATH . '/layouts',
            'layout' => 'main'
        ));
        $view = Zend_Layout::getMvcInstance()->getView();
        $view->doctype('XHTML1_STRICT');
        $view->headTitle()->setSeparator(' - ');
        
        
    }

    protected function _initFrontController()
    {
        $frontController = Zend_Controller_Front::getInstance();
        $frontController->setControllerDirectory(APPLICATION_PATH .'/controllers');
        $frontController->setParam('env', APPLICATION_ENVIRONMENT);
        $frontController->registerPlugin(new navigation());
        // action helpers
        Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH .'/controllers/helpers');
    }

    public function run()
    {
        $frontController = Zend_Controller_Front::getInstance();
        $frontController->dispatch();
    }
}
Dann hab ich noch eine Datei mit dem namen navigation.php in /library/Plugin abgelegt.
PHP:
<?php

class navigation extends Zend_Controller_Plugin_Abstract
{
    
}
Es passiert leider nicht nichts *) sondern ich bekomm folgende Meldung:
Fatal error: Class 'navigation' not found in path\index.php on line 28

In der index.php wurde doch der Pluginpfad angegeben. Hoffe Ihr könnt mir da weiterhelfen.

Eine Frage hätt ich dann aber noch bzgl. Zend_Application:

Übernimmt Zend_Application das registerAutoloader?

Vielen Dank für eure Hilfe im Voraus.

lg Samuel
 

Neue Beiträge

Zurück