Using zftool in a more efficient manner

2019-09-17 09:35发布

I'm new to Zend and noticed there's something called ZFtool. So I installed it via this tutorial: http://framework.zend.com/manual/2.1/en/modules/zendtool.introduction.html. With some hassle and editting I finally got it to work in my htdocs folder of xampp.

Whenever I now run php vendor/zendframework/zftool/zf.php create project testproject it actually creates a project in my htdocs called testproject. But whenever I now want to add a module I'd have to do php vendor/zendframework/zftool/zf.php create module some_module c:/xampp/htdocs/testproject.

Now; I've got the feeling that this can(or atleast SHOULD) be more efficient than how I'm going at it now. Is there a way I can make the zf.php file universally reachable or anything to make the command line a little easier?

1条回答
再贱就再见
2楼-- · 2019-09-17 10:03

Download zftool.phar from : https://packages.zendframework.com/zftool.phar

Place it on:

C:\bin\zftool.phar

Create zftool.bat on:

C:\bin\zftool.bat

zftool.bat

@ECHO OFF
php "%~dp0zftool.phar" %*

Add this path to your Environment Variable:

enter image description here

Now you are able to use zftool from anywhere in your command prompt like this:

enter image description here

查看更多
登录 后发表回答