Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Newest symfony installer vs composer

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.

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?

like image 327
Fisher Avatar asked Jan 04 '15 13:01

Fisher


People also ask

What is composer in Symfony?

Composer is the package manager used by modern PHP applications. Use Composer to manage dependencies in your Symfony applications and to install Symfony Components in your PHP projects. Since this article was first published, Composer installation has improved a lot.

How do I update the composer to the latest version?

To update Composer itself to the latest version, run the self-update command. It will replace your composer.phar with the latest version. If Composer was not installed as a PHAR, this command is not available. (This is sometimes the case when Composer was installed by an operating system package manager.)

How do I know what version of Symfony I have?

If you have file system access to the project Look inside the file for a line like: const VERSION = '5.0. 4'; that's the Symfony version number.

Who created Symfony?

Fabien Potencier Being a developer by passion, he immediately started to build websites with Perl. But with the release of PHP 5, he decided to switch focus to PHP, and created the symfony framework project in 2004 to help his company leverage the power of PHP for its customers.


1 Answers

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.

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.

The main differences:

  • 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.

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

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.

like image 83
Wouter J Avatar answered Oct 13 '22 01:10

Wouter J