This is unmaintained, I haven't used it in quite a while and don't have the time to update and test it properly.
A interface for retrieving values from Hashicorp Vault in a PHP Project.
Use Composer to install the package:
Add the following to your composer.json
and run composer update
.
"require": {
"koshatul/vault": "~1.0"
}
You can use this package to get configuration from a global or specific configuration store.
use Koshatul\Vault\Vault;
use Koshatul\Vault\VaultURI;
use Koshatul\Vault\VaultAuthToken;
$vaultURI = new VaultURI("https://127.0.0.1:8200/v1/");
$vaultAuthToken = new VaultAuthToken("tttttttt-wwww-xxxx-yyyy-zzzzzzzzzzzz");
$vault = new Vault($vaultURI, $vaultAuthToken);
$vault->write('secret/foo' ['pear' => 'table']);
$testValue = $vault->read('secret/foo');
echo "Pear: ".$testValue->get('pear');