setono / variable-resolver
Replace variables in strings with real values
dev-master / 1.0.x-dev
2020-05-25 12:06 UTC
Requires
- php: >=7.4
- symfony/process: ^3.4 || ^4.4 || ^5.0
- thecodingmachine/safe: ^1.1
Requires (Dev)
- ergebnis/composer-normalize: ^2.5.1
- korbeil/phpstan-generic-rules: ^0.2.4
- phpstan/extension-installer: ^1.0.4
- phpstan/phpstan: ^0.12.23
- phpstan/phpstan-strict-rules: ^0.12.2
- phpunit/phpunit: ^8.5.4
- sylius-labs/coding-standard: ^3.1.3
- thecodingmachine/phpstan-safe-rule: ^1.0
This package is auto-updated.
Last update: 2024-12-15 05:08:45 UTC
README
This is a library that replaces variables like %PHP%
or %APP_ENV%
with their real values. This is typically used
for deployment purposes.
Installation
$ composer require setono/variable-resolver
Basic usage
use Setono\VariableResolver\VariableResolver; use Setono\VariableResolver\Parser\PercentageWrappingParser; use Setono\VariableResolver\Variable\Value\PhpBinValue; $str = '%PHP% bin/console run:command'; $variableResolver = new VariableResolver(new PercentageWrappingParser()); $variableResolver->addValue('PHP', new PhpBinValue()); echo $variableResolver->resolve($str); // output: /usr/bin/php bin/console run:command