最新的 symfony 安装程序与作曲家 [英] Newest symfony installer vs composer

查看:20
本文介绍了最新的 symfony 安装程序与作曲家的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道使用上次出现的新 symfony 安装程序和老式作曲家创建新的 symfony 项目时有什么区别.

I'd like to know whats the difference when creating new symfony project with new symfony installer that has appeared last time and old-way composer.

我已经安装了最新版本的 symfony (2.6.1),结果不同,例如当我用 composer 安装 symfony 时,我得到了 .gitignore 文件.当我使用新的 symfony 安装程序脚本安装时,缺少 gitignore.

I've installed latest version of symfony (2.6.1) with both, and result was different, for example when I install symfony with composer, i get .gitignore file. When I install with new symfony installer script, gitignore is missing.

这是新项目中的目录和文件数量:

Here is amount of catalogs and files in fresh project:

symfony installer:                      1498 directories, 7136 files
symfony installer + composer update:    1571 directories, 7749 files
composer create-project:                1615 directories, 7905 files

我想我会坚持旧的方式 - 作曲家,因为新的安装程序似乎有问题或者至少还没有完成,但是我想了解更多关于这个主题的信息,有什么区别,使用安全吗新安装程序等?

I suppose I'll stick to old way - composer, since new installer seems to be bugged or at least not complete yet, however I'd like to understand more on this topic, whats the difference, is it safe to use new installer etc?

推荐答案

正如 Leggendario 已经解释的那样,安装程序从网站下载 dist 文件(.tar.gz.zip 文件).这大大加快了安装过程.

As Leggendario already explained, the installer downloads the dist files from the website (a .tar.gz or .zip file). This speeds up the installation process quite a bit.

然而,在构建 dist 文件时,symfony.com 使用自定义构建脚本删除一些文件并更改一些内容.另一方面,composer 只是为您下载存储库.

However, when building the dist files, symfony.com uses a custom build script which removes some files and changes some things. On the other hand, composer simply downloads the repository for you.

主要区别:

  • Composer 下载最新的依赖项(正如 Leggendario 指出的那样),而构建脚本包含构建时的最新文件.
  • Composer 使用开发版本,因此使用 git clone 下载包.构建脚本仅使用稳定包,这将使 Composer 使用 dist 版本.一些包会从它们的 dist 文件中删除测试和文档文件.
  • Composer 包含所有项目相关信息,例如 .gitignore.构建脚本之前假定安装它的人没有 git,因此删除了此文件和其他与 git 相关的文件,例如 app/cache 中的 .gitkeep 文件>应用程序/日志.
  • Composer downloads the latest dependencies (as Leggendario pointed out), while the build script contains the latest files at the moment of building.
  • Composer uses the dev versions and thus uses git clone to download the packages. The build script uses only stable packages, which will make Composer use the dist version. Some packages remove test and doc files from their dist files.
  • Composer contains all project related information, like a .gitignore. The build script previously assumed the person installing it didn't have git, so removed this file and other git related files like the .gitkeep files in app/cache and app/logs.

无论如何,安装程序和作曲家总是为您提供 Symfony 标准版的工作版本.

I any case, both the installer and composer always give you a working version of the Symfony Standard Edition.

最后,构建脚本更改现在安装程序成为官方安装方式.它现在将包含 git 相关文件.另一方面,它不包含 LICENSE 文件、UPGRADE-*.md 文件和 README.md 文件.所以最后,我们可以说安装程序安装的那个更有用,因为它删除了无用的文件.

At last, the build script was changed now the installer became the official way of installing. It'll now contain the git related files. On the other hand, it'll not contain the LICENSE file, UPGRADE-*.md files and README.md file. So in the end, we can say that the one installed by the installer is more usable, as it removes useless files.

这篇关于最新的 symfony 安装程序与作曲家的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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