Home  >  Article  >  Backend Development  >  windows下安装Composer的两种命令方式有何不同?

windows下安装Composer的两种命令方式有何不同?

WBOY
WBOYOriginal
2016-06-06 20:37:59983browse

看到网上的安装命令有以下两种:

<code>C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
</code>
<code>C:\bin>php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
</code>

具体差别是什么,有没有官方推荐的方式?

回复内容:

看到网上的安装命令有以下两种:

<code>C:\bin>php -r "readfile('https://getcomposer.org/installer');" | php
</code>
<code>C:\bin>php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
</code>

具体差别是什么,有没有官方推荐的方式?

这两个应该是完全等效的,前一个是 PHP 执行 readfile 输出的文件,后一个是 PHP 执行 file_get_contents 输出的字符串而已。不过要说到 Windows 下官方推荐做法的话不应该是下载 安装程序 安装的么?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn