Problem with ZFTool: module (ZFTool) cannot be initialized

ZFTool is a maintenance tool for Zend Framework applications. There are several ways to install it. I am using it from a PHAR file.

$ mkdir -p /usr/lib/ZendFramework/zftool
$ cd /usr/lib/ZendFramework/zftool
$ wget http://packages.zendframework.com/zftool.phar
$ ln -s  /usr/lib/ZendFramework/zftool/zftool.phar /usr/bin/zf
$ chmod 755 /usr/bin/zf

It works when I run the tool outside of the ZF application. But now I tried this in the application and got this error:

root@devvm:/usr/lib/ZendFramework/test# cd /path/to/application/ root@devvm:/path/to/application# zf PHP Fatal error:  Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (ZFTool) could not be initialized.' in /path/to/application/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php:175 Stack trace:
#0 /path/to/application/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php(149): Zend\ModuleManager\ModuleManager->loadModuleByName(Object(Zend\ModuleManager\ModuleEvent))
#1 /path/to/application/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php(90): Zend\ModuleManager\ModuleManager->loadModule('ZFTool')
#2 [internal function]: Zend\ModuleManager\ModuleManager->onLoadModules(Object(Zend\ModuleManager\ModuleEvent))
#3 /path/to/application/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
#4 /path/to/application/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php( in /path/to/application/vendor/zendframework/zendframework/library/Zend/ModuleManager/ModuleManager.php on line 175

Why is this happening? How to avoid this behavior?

+3
source share
3 answers

It seems you need to install zftool in your project. user2900416 is a hint of this, but I think it’s more correct to install zftool using composer for each project:

composer.phar require zendframework/zftool:dev-master

. : https://github.com/zendframework/ZFTool/issues/51

+3

module.php:

, ** M ** odule.php M, . , , - !

0

. , , : (1) ZFTool zipball, , http://framework.zend.com/manual/2.1/en/modules/zendtool.introduction.html. (2) zipball / ZFTool/.

(ZFTool) "zftool.phar ModuleName" "zf.php ModuleName", zf.php zipball.

It seems stupid to copy the ZFTool module inside each application, but I spent a few days trying to find the best without any luck. Hope someone can suggest it.

0
source

All Articles