Using zftool in a more efficient manner

2019-09-17 10:10发布

问题:

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:

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:

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