Expand description
Composer\Downloader\PathDownloader (docs/reference/PathDownloader.php)
for Linux and macOS: a path package is laid out as a symbolic link to
its source — relative through findShortestPath(..., preferRelative)
when transport-options.relative (the default), absolute otherwise — or
as a mirror (symlink: false, or COMPOSER_MIRROR_PATH_REPOS) copied
through the ArchivableFilesFinder rules (docs/reference/
ArchivableFilesFinder.php, GitExcludeFilter.php, BaseExcludeFilter.php,
symfony-finder-Glob.php) and Symfony’s Filesystem::mirror/copy
(docs/reference/symfony-Filesystem.php):
- VCS directories (
.git,.svn,.hg, …) are skipped at any depth — directories only, a.gitfile is copied; - the root
.gitattributeslines<pattern> export-ignore/-export-ignore(exactly two fields) exclude/re-include, the pattern throughGlob::toRegex, matched at any depth unless it starts with/; - a symbolic link is recreated with its raw target when it points to a file or an empty directory inside the source; a link to a non-empty directory, a dangling link or a link leaving the source is dropped;
- empty directories are kept; a copied file gets
0666 & ~umaskplus the source’s executable bits and the source’s mtime.
Windows (junctions) is out of scope: scope routes such locks to the
Composer fallback there.
Enums§
Functions§
- check_
not_ inside_ source download: the refusal to install a package inside its own source.- glob_
to_ regex - Symfony
Finder\Glob::toRegex($glob)with the defaults (strictLeadingDot,strictWildcardSlash, delimiter#). - install
installafter the CLI printed the operation line: the existing path is removed, then the link is created or the source mirrored. Nothing happens when the path already resolves to the source.- install_
appendix getInstallOperationAppendix: what follows the operation line —: Source already presentwhen the install path already resolves to the source, else the strategy and the dist url as written.- is_
own_ source PathDownloader::remove: true when the install path is the source (, source is still present in <path>): nothing is removed then.- remove_
path Filesystem::removeDirectoryon a package path: a symbolic link is unlinked (never followed), a directory removed, a missing path ignored.- strategy
computeAllowedStrategies:COMPOSER_MIRROR_PATH_REPOS(PHP truthiness: anything but empty and0) thentransport-options.symlink.