zippovich2 / composer-installer
Allow add variables from .env* files to custom package url.
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: ^7.2.5
- composer-plugin-api: ^1.1 | ^2.0
- composer/composer: ^1.9 | ^2.0
- symfony/dotenv: ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpunit/phpunit: ^8.0 | ^9.0
README
Allow add variables in package urls using environment variables and .env
files.
Installation
$ composer require zippovich2/composer-installer
Usage
Most common usage is ACF Pro plugin for WordPress:
{ "repositories": [ { "type": "package", "package": { "name": "acf/acf-pro", "version": "5.8.7", "type": "wordpress-plugin", "dist": { "type": "zip", "url": "https://connect.advancedcustomfields.com/index.php?p=pro&a=download&k={%ACF_PRO_KEY%}&t=5.8.7" } } } ], "require": { "zippovich2/composer-installer": "^1.0" } }
And just add ACF_PRO_KEY
to any of .env
files (.env
, .env.local
, .env.%APP_ENV%
, .env.%APP_ENV%.local
)
or provide it as environment variable (note that .env
variables overwrite environment variables):
# .env.local
ACF_PRO_KEY=your key
Now you can install package:
$ composer require acf/acf-pro