Zend Framework 2错误未找到ListenerOptions

时间:2013-12-09 15:00:42

标签: php zend-framework zend-framework2

我需要帮助设置Zend Framework 2.我收到此错误:

  

致命错误:在index.php中找不到类'Zend \ Module \ Listener \ ListenerOptions'

为什么找不到课程?

这是我的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 个答案:

答案 0 :(得分:1)

Zend\Module\Listener\ListenerOptions现在位于Zend\ModuleManager\Listener\ListenerOptions下,请检查此类以及与命名空间相关的其他内容Zend\Module\Listener