PHP code example of necromant2005 / tt-vault

1. Go to this page and download the library: Download necromant2005/tt-vault 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/ */

    

necromant2005 / tt-vault example snippets


$vault = new Vault\File('path/to/vault.php');
$vault->get('my-token'); // ['abc' => 123]
$vault->get('non-exist'); // throw InvalidArgumentException

$vault = new Vault\Aws([
    'credentials' => [
        'key'    => '...',
        'secret' => '...',
    ],
    'region'  => 'us-east-1',
    'version' => 'latest',
]);
$vault->get('my-token'); // ['abc' => 123]
$vault->get('non-exist'); // throw InvalidArgumentException
bash
$ php composer.phar update


return [
    'vault' => [
        'my-token' => [
            'abc' => 123,
        ],
    ],
];