Download the PHP package pact-foundation/composer-downloads-plugin without Composer
On this page you can find all versions of the php package pact-foundation/composer-downloads-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pact-foundation/composer-downloads-plugin
More information about pact-foundation/composer-downloads-plugin
Files in pact-foundation/composer-downloads-plugin
Package composer-downloads-plugin
Short Description Composer plugin for downloading additional files within any composer package.
License MIT
Informations about the package composer-downloads-plugin
Composer Downloads Plugin

This plugin allows you to download extra files and extract them within your package.
This is an updated version of civicrm/composer-downloads-plugin. It adds support for more archive files and allow custom variables.
Example
Suppose your PHP package foo/bar relies on an external archive file (examplelib-1.1.0-windows-amd64.zip on Windows, or examplelib-1.1.0-linux-x86_64.tar.gz on Linux, or examplelib-1.1.0-darwin-x86_64.tar.gz on MacOS):
When a downstream user of foo/bar runs composer require foo/bar, it will download and extract the archive file to vendor/foo/bar/extern/examplelib.
Attribute:
-
url: The URL to the extra file. -
path: The releative path where content will be extracted. -
type: (Optional) Determines how the download is handled. If omit, the extension inurlwill be used to detect.- Archive types (The archive file
urlwill be downloaded and extracted topath):zip: . Support extension*.ziprar: Support extension*.rarxz: Support extension*.tar.xztar: Support extensions*.tar.gz,*.tar.bz2,*.tar,*.tgz
- File types (The file
urlwill be downloaded and placed atpath):filephar: The file will be mark as executable.gzip: The*.gzfile will be extracted to a file that will be placed atpath.
- Archive types (The archive file
-
ignore: (Optional) A list of a files that should be omited from the extracted folder.- This supports a subset of
.gitignorenotation. - Only useful with archive types.
- This supports a subset of
-
executable: (Optional) Indicate list of files should be mark as executable.- For archive types: the value should be a list of extracted files
- For file types: the value should be boolean (true/false)
-
version: (Optional) A version number for the downloaded artifact.- This has no functional impact on the lifecycle of the artifact.
- It can affect the console output.
- It can be used as a variable.
-
variables: (Optional) List of custom variables. hash: (Optional) Verify contents of the file downloaded fromurl. If hash values are not the same: file will be deleted & composer will throw exception.algo: Name of selected hashing algorithm (i.e. "md5", "sha256", "haval160,4", etc..). For a list of supported algorithms seehash_algos()value: Expected value of hash function
Variables
Supported Attribute
Only following attribute support variables:
urlpathignore
Default Variables
{$id}: The identifier of the download. (In the example, it would beexamplelib.){$version}: Just a text defined in theversionattribute, if not defined, the value will be empty string ("").
Custom Variables
- The format will be
"{$variable-name}": "EXPRESSION-SYNTAX-EVALUATED-TO-STRING" - More about the syntax at Expression Syntax.
- The syntax must be evaluated into a
string.
Methods
Custom variable support these methods:
rangestrtolowerphp_unamein_arraystr_containsstr_starts_withstr_ends_withmatchesmusl
Constants
Custom variable support these constants:
PHP_OSPHP_OS_FAMILYPHP_SHLIB_SUFFIXDIRECTORY_SEPARATOR
Default Attributes
You may set default attributes for all downloads. Place them under *, as in:
Document
See more at Doc
Contributing
Pull requests are welcome, please send pull requests.
If you found any bug, please report issues.
Authors
- Rob Bayliss - Composer Extra Files
- Tim Otten and contributors - Composer Download Plugin
- Tien Vo and contributors - this project
License
This package is available under the MIT license.
All versions of composer-downloads-plugin with dependencies
php Version ^8.1
leongrdic/smplang Version ^1.0.2
symfony/filesystem Version ^5.4 || ^6.4 || ^7.0 || ^8.0
symfony/finder Version ^5.4 || ^6.4 || ^7.0 || ^8.0