Using PHP doctrine CLI easily in windows
in window开发者_如何学编程s, to use doctrine CLI from any directory i need to use something like
php D:\full\path\to\doctrine\bin\doctrine.php --variables here
is there anyway i can shorten this so that it becomes something like
php doctrine.php --variables here
or even
doctrine --variables here
Try doskey doctrine=php D:\full\path\to\doctrine\bin\doctrine.php $*
Then you should be able to do doctrine --variables here
If you don't want to type that out every session, you can export it to a file:
doskey /macros > macros.txt
And import it every session:
doskey /macrofile=macros.txt
And if that's still too much work, you can add them to the Autorun entry for the CLI:
reg add "hkcu\software\microsoft\command processor" /v Autorun /t reg_sz /d
"%systemroot%\system32\doskey.exe /macrofile=path\to\your\macros.txt"
Note that by doing this you are modifying your registry, so use caution.
精彩评论