1. Go to this page and download the library: Download nohnaimer/yii2-vault-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nohnaimer / yii2-vault-client example snippets
class m221103_161325_vault_init extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$client = new Client([
'url' => 'url',
'token' => 'token',
]);
$kv = new KVv1([
'path' => '/kv',
'client' => $client,
]);
//add
$kv->post('/my/secret', ['key' => 'value']);
//delete
$kv->delete('/my/secret/key');
}
}