I would like to know what each one does and/or if there is a difference between
both.
These options refer to how Composer will download and manage dependencies within your vendor directory.
--prefer-dist
will give preference to the distribution package of that dependency if available. This is the default option if you are referencing a stable version of that package in your Composer.json.
For example, when creating a tag and a release within a Github repository, this tag will have a zip corresponding to and from that version zip Composer will install its dependency. This option is the fastest to install.
--prefer-source
will give preference to downloading the repository of the source code itself, making a git clone
from that repository. This option is interesting if you are working with a package under development and want to update the content with vendor later. It ends up being slower because in addition to the application code, the project’s repository is also downloaded.
Further information can be found at Composer documentationen.
Before you ask me if I Googled: My goal is to have the content in Portuguese.
– Wallace Maxters