Skip to content

icosillion/secret-keeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Secret Keeper

PHP Library for reading Docker Secrets

Installation

composer require icosillion/secret-keeper

Examples

Load Single Secret

<?php

use Icosillion\SecretKeeper\SecretKeeper;

$secretKeeper = new SecretKeeper();
echo $secretKeeper->load('testsecret');

Load All Secrets

<?php

use Icosillion\SecretKeeper\SecretKeeper;

$secretKeeper = new SecretKeeper();
$secrets = $secretKeeper->loadAll();

foreach ($secrets as $key => $value) {
    echo "$key => $value\n";
}

Load All Secrets into Environment

<?php

use Icosillion\SecretKeeper\SecretKeeper;

$secretKeeper = new SecretKeeper();
$secretKeeper->populateEnvironment();

echo "testsecret (superglobal): {$_ENV['testsecret']}\n";
echo 'testsecret (getenv): ' . getenv('testsecret') . "\n";

About

PHP Library for reading Docker Secrets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages