无法在PHPStorm 10.0.1中为工匠制作命令行工具 [英] Cannot make command line tool for artisan in PHPStorm 10.0.1

查看:180
本文介绍了无法在PHPStorm 10.0.1中为工匠制作命令行工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试为工匠制作别名时,我收到此错误消息: [设置|工具|命令行工具支持]->添加->基于Symfony控制台的工具

I got this error message when I tried to make an alias for artisan: [Settings | Tools | Command Line Tool Support ] -> add -> tool based on Symfony Console

问题

Failed to parse output as xml: Error on line 4: Content is not allowed in prolog..

命令

C:\xampp\php\php.exe C:\xampp\htdocs\laratest\artisan list --xml

输出

[Symfony\Component\Console\Exception\RuntimeException]
The "--xml" option does not exist.

好的,我知道这是什么问题,但是我没有找到任何解决方案. 感谢您的小费!

Ok, I know, what's the problem but I don't find any solution for this. Thank you for the tips!

推荐答案

对Laravel文件夹下的"artisan"文件进行临时修改即可解决问题. (正在使用PhpStorm 10.0.3)

A temporal modification of the "artisan" file under the Laravel folder will do the trick. (Working on PhpStorm 10.0.3)

if( isset($argv[1]) && $argv[1] == 'list' && 
    isset($argv[2]) && $argv[2] == '--xml' ) {
    $argv[2] = '--format=xml';
    $_SERVER['argv'] = $argv;
}
require __DIR__.'/bootstrap/autoload.php';

现在,您可以添加基于Symfony的"artisan"命令行工具支持,并根据需要删除这些行.

Now you can add the "artisan" command line tool support based on Symfony and remove the lines if you wish to.

这篇关于无法在PHPStorm 10.0.1中为工匠制作命令行工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆