PHP code example of elixis-group / gcp-secret-manager-bundle

1. Go to this page and download the library: Download elixis-group/gcp-secret-manager-bundle 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/ */

    

elixis-group / gcp-secret-manager-bundle example snippets


#config/bundles.php

ElixisGroup\GcpSecretManagerBundle\GcpSecretManagerBundle::class => ['all' => true],


#Controller/AcmeController.php

use ElixisGroup\GcpSecretManagerBundle\Provider\GcpSecretManagerProvider;

class AcmeController extends AbstractController
{
    public function index(GcpSecretManagerProvider $secretProvider){
        $secretValue = $secretProvider->get('SECRET_NAME', SECRET_VERSION);
    }
}