2013-12-09 72 views
0

我需要幫助建立Zend框架2.我收到此錯誤:Zend框架2錯誤ListenerOptions沒有找到

Fatal error: Class 'Zend\Module\Listener\ListenerOptions' not found in index.php

爲什麼找不到類?

這是我的index.php:

<?php 
chdir(dirname(__DIR__)); 
require_once './vendor/ZendFramework/library' . '/Zend/Loader/AutoloaderFactory.php'; 
Zend\Loader\AutoloaderFactory::factory(); 

$appConfig = include './config/application.config.php'; 

$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']); 
$defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions); 
$defaultListeners->getConfigListener()->addConfigGlobPath("config/autoload/{,*.}{global,local}.config.php"); 


$moduleManager = new Zend\Module\Manager($appConfig['modules']); 
$moduleManager->events()->attachAggregate($defaultListeners); 
$moduleManager->loadModules(); 

// Create application, bootstrap, and run 
$bootstrap = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig()); 
$application = new Zend\Mvc\Application; 
$bootstrap->bootstrap($application); 
$application->run()->send(); 
?> 

回答

1

Zend\Module\Listener\ListenerOptions目前正在Zend\ModuleManager\Listener\ListenerOptions檢查這個類和其他相關的命名空間Zend\Module\Listener