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

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

WBOY
Release: 2016-06-06 20:37:59
Original
1046 people have browsed it

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

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

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

回复内容:

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

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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template