shopware-blog / shopware-environment-variables
a small shopware plugin to use env variables
Installs: 5 372
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 6
Forks: 2
Open Issues: 8
Type:shopware-plugin
Requires (Dev)
- phpunit/phpunit: ^7.0
README
Use Environment Variables to override Plugin Configurations
In multi stage environments it is usual to have different basic and plugin configurations for dev, stage and live systems.
This plugin can override basic and plugin configurations with environment variables or constants.
Integration
We use ShopwarePaypal as an example plugin. Below you can see an example config.php which overrides some plugin settings and basic configuration.
<?php return [ 'db' => [...], 'custom' => [ 'plugins' => [ 1 => [ 'SwagPaymentPaypal' => [ 'paypalUsername' => '1' . getenv('paypalUsername'), 'paypalPassword' => '1' . getenv('paypalPassword'), ], ], 2 => [ 'SwagPaymentPaypal' => [ 'paypalUsername' => '2' . getenv('paypalUsername'), 'paypalPassword' => '2' . getenv('paypalPassword'), ], ], ], 'config' => [ 1 => [ 'mailer_mailer' => 'test123', ], 2 => [ 'mailer_mailer' => '321test', ], ], ], ];