ZFTool:Class' Zend \ Log \ ProcessorPluginManager'找不到错误

时间:2015-02-10 18:52:02

标签: php zend-framework zftool2

安装ZFTool之后我试图测试它是否有效,但我总是收到以下错误:

fernando@pudim:~/tmp$ php zf.php version

PHP Fatal error:  Class 'Zend\Log\ProcessorPluginManager' not found in /home/fernando/tmp/vendor/zendframework/zend-mvc/Zend/Mvc/Service/AbstractPluginManagerFactory.php on line 32
PHP Stack trace:
PHP   1. {main}() /home/fernando/tmp/zf.php:0
PHP   2. Zend\Mvc\Application::init() /home/fernando/tmp/zf.php:50
PHP   3. Zend\ModuleManager\ModuleManager->loadModules() /home/fernando/tmp/vendor/zendframework/zend-mvc/Zend/Mvc/Application.php:252
PHP   4. Zend\EventManager\EventManager->trigger() /home/fernando/tmp/vendor/zendframework/zend-modulemanager/Zend/ModuleManager/ModuleManager.php:123
PHP   5. Zend\EventManager\EventManager->triggerListeners() /home/fernando/tmp/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php:207
PHP   6. call_user_func() /home/fernando/tmp/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php:468
PHP   7. Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost() /home/fernando/tmp/vendor/zendframework/zend-eventmanager/Zend/EventManager/EventManager.php:468
PHP   8. Zend\ServiceManager\ServiceManager->get() /home/fernando/tmp/vendor/zendframework/zend-modulemanager/Zend/ModuleManager/Listener/ServiceListener.php:212
PHP   9. Zend\ServiceManager\ServiceManager->create() /home/fernando/tmp/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:525
PHP  10. Zend\ServiceManager\ServiceManager->doCreate() /home/fernando/tmp/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:593
PHP  11. Zend\ServiceManager\ServiceManager->createFromFactory() /home/fernando/tmp/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:633
PHP  12. Zend\ServiceManager\ServiceManager->createServiceViaCallback() /home/fernando/tmp/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:1055
PHP  13. call_user_func() /home/fernando/tmp/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:923
PHP  14. Zend\Mvc\Service\AbstractPluginManagerFactory->createService() /home/fernando/tmp/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:923

注意:我已将ZFTool安装到/home/fernando/tmp/文件夹中。

我该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:1)

关注this Github issue后,我找到了答案。

只需将以下内容添加到composer.json文件中:

"zendframework/zend-log": ">=2.3.0"

之后,您的composer.json文件可能会显示如下:

{
    "require": {
        "zendframework/zftool": "dev-master",
        "zendframework/zend-log": ">=2.3.0"
    }
}

现在您只需要更新/安装新软件包。在终端中运行以下命令:composer updatephp composer.phar update

<强>测试

fernando@pudim:~/tmp$ php zf.php version
ZFTool - Zend Framework 2 command line Tool
The application in this folder is using Zend Framework 2.3.4

希望它有所帮助,伙计们!