Download the PHP package detailnet/dfw-varcrypt-module without Composer
On this page you can find all versions of the php package detailnet/dfw-varcrypt-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download detailnet/dfw-varcrypt-module
More information about detailnet/dfw-varcrypt-module
Files in detailnet/dfw-varcrypt-module
Package dfw-varcrypt-module
Short Description Zend Framework 2 Module for dfw-varcrypt
License MIT
Homepage https://github.com/detailnet/dfw-varcrypt-module/
Informations about the package dfw-varcrypt-module
Zend Framework 2 Module for dfw-varcrypt
Introduction
This module integrates the DETAIL Framework library for for working with encrypted environment variables with Zend Framework 2.
Requirements
Zend Framework 2 Skeleton Application (or compatible architecture)
Installation
Install the module through Composer using the following steps:
-
cd my/project/directory -
Create a
composer.jsonfile with following contents (or update your existing file accordingly): -
Install Composer via
curl -s http://getcomposer.org/installer | php(on Windows, download the installer and execute it with PHP) -
Run
php composer.phar self-update -
Run
php composer.phar install -
Open
configs/application.config.phpand add following key to yourmodules: - Copy
vendor/detailnet/dfw-varcrypt-module/config/detail_varcrypt.local.php.distinto your application'sconfig/autoloaddirectory, rename it todetail_varcrypt.local.phpand make the appropriate changes.
Usage
Save/encode config
Before the module can be used, a config (simple string or JSON encoded string) needs to be encoded and provided as environment variable.
Here's an example for providing MongoDB credentials as a single environment variable:
-
Define credentials as JSON:
- Make sure an encryption key is set in
detail_varcrypt.local.php. - Encode JSON:
php public/index.php varcrypt encode-value {"server": ...} - Save the output as environment variable (e.g.
MONGO). - Test that the environment variable can be accessed (at least from the CLI):
php public/index.php varcrypt decode-variable MONGO
Apply/decode config
The following steps are necessary, to use an encrypted/encoded environment variable in a ZF2 app.
-
Add the environment variable to the module's config (in
detail_varcrypt.local.php): - Access environment variables as you normally would:
All versions of dfw-varcrypt-module with dependencies
psr/log Version ~1.0
keboola/php-encryption Version ~0.2.1
zendframework/zend-config Version 2.*
zendframework/zend-console Version 2.*
zendframework/zend-loader Version 2.*
zendframework/zend-modulemanager Version 2.*
zendframework/zend-mvc Version 2.*
zendframework/zend-servicemanager Version 2.*
zendframework/zend-view Version 2.*
detailnet/dfw-core Version ~0.2
detailnet/dfw-varcrypt Version ~0.1.1