在 Windows 中,要从任何目录使用 doctrine CLI,我需要使用类似的东西
php D:\full\path\to\doctrine\bin\doctrine.php --variables here
无论如何我可以缩短它,使其变成类似的东西
php doctrine.php --variables here
甚至
doctrine --variables here
最佳答案
试试 doskey doctrine=php D:\full\path\to\doctrine\bin\doctrine.php $*
那么你应该可以doctrine --variables here
如果您不想在每个 session 中都输入该内容,您可以将其导出到一个文件中:
doskey /macros > macros.txt
并在每个 session 中导入它:
doskey /macrofile=macros.txt
如果这仍然是太多工作,您可以将它们添加到 CLI 的自动运行条目中:
reg add "hkcu\software\microsoft\command processor"/v Autorun/t reg_sz/d
“%systemroot%\system32\doskey.exe/macrofile=path\to\your\macros.txt”
请注意,这样做是在修改您的注册表,因此请谨慎使用。
关于php - 在 Windows 中轻松使用 PHP doctrine CLI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3270075/