【发布时间】:2015-10-21 16:22:28
【问题描述】:
我在 Windows 10 上使用 PHPStorm,为 php.exe 使用 WAMP 服务器,并且我已经使用 ComposerSetup.exe 为 Windows 安装了作曲家。我正在尝试为 Phpstorm 中的作曲家添加命令行工具支持,但它失败并出现此错误。
问题 无法将输出解析为 XML:第 2 行错误:prolog 中不允许内容。 命令 php.exe C:\ProgramData\ComposerSetup\bin\composer 列表 --xml 输出
dir=$(d=$(dirname "$0"); cd "$d" && pwd)
# see if we are running in cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin.
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m $dir);
fi
fi
dir=$(echo $dir | sed 's/ /\ /g')
php "${dir}/composer.phar" $*
【问题讨论】:
标签: php composer-php phpstorm