Skip to main content

Module fetch

Module fetch 

Source
Expand description

Dist downloads, interoperable with Composer’s cache: same layout (<cache>/files/<vendor>/<pkg>/<sha1-of-url>.zip), both read AND fed, so a cache warmed by one serves the other. Minimal v1 auth: github-oauth, http-basic, bearer (project auth.json, COMPOSER_AUTH, then the COMPOSER_HOME auth.json). The lock’s shasum, when present, is checked on download AND when reading back from the cache (meta-analysis F7: a shared cache is read back with suspicion).

Structs§

Auth
Fetcher

Enums§

MetadataResponse
Response of a conditional metadata GET.
Provenance

Functions§

composer_cache_dir
Factory::getCacheDir: COMPOSER_CACHE_DIR; else $COMPOSER_HOME/cache if COMPOSER_HOME is set; Darwin -> ~/Library/Caches/composer; ~/.composer/cache if it exists; XDG -> $XDG_CACHE_HOME/composer; else <home>/cache.
composer_home
Factory::getHomeDir (docs/reference/Factory.php): COMPOSER_HOME, else the first existing directory among $XDG_CONFIG_HOME/composer (if XDG is in use) and ~/.composer, else the first candidate.
dist_cache_path
Cache path of a dist, identical to Composer’s: sha1 of the FULL URL (deliberate in Composer: prevents cross-repository poisoning), key sanitised to [a-z0-9._/-].