PHP code example of dvsa / laminas-config-cloud-parameters

1. Go to this page and download the library: Download dvsa/laminas-config-cloud-parameters 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/ */

    

dvsa / laminas-config-cloud-parameters example snippets


    

    use Dvsa\LaminasConfigCloudParameters\Provider\SecretsManager;
    use Dvsa\LaminasConfigCloudParameters\Cast\Boolean;
    use Dvsa\LaminasConfigCloudParameters\Cast\Integer;

    return [
        'config' => [
            'providers' => [
                SecretsManager::class => [
                    'example-secret',
                    // ...
                ],
                
                // ...
            ],

            'casts' => [
                // Uses `symfony/property-access` to access the property. See https://symfony.com/doc/current/components/property_access.html#reading-from-arrays.
                '[foo]' => Boolean::class,
                '[bar][nested]' => Integer::class,

                // ...
            ],
        ],
        // ...
    ];
    

    
    // module.config.php
    
    return [
        'Dvsa\LaminasConfigCloudParameters',
        // ...
    ];
    

    return [
        'foo' => '%bar%',
        'bar' => [
            'nested' => '%baz%',
        ],
    ];
    
 


return [
    'config' => [
        'providers' => [
            SecretsManager::class => [
                'global-secrets',
                sprintf('environment-%s-secrets', $environment),
            ],
            
            // ...
        ],
    ],
];
 


use Dvsa\LaminasConfigCloudParameters\Provider\ParameterStore;

return [
    'config' => [
        'providers' => [
            ParameterStore::class => [
                '/global',
                sprintf('/env-%s', $environment),
            ],
            
            // ...
        ],
    ],
];