PHPackages                             detailnet/dfw-varcrypt-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. detailnet/dfw-varcrypt-module

AbandonedArchivedLibrary[Security](/categories/security)

detailnet/dfw-varcrypt-module
=============================

Zend Framework 2 Module for dfw-varcrypt

0.1.2(10y ago)02211MITPHPPHP &gt;=5.4.0

Since Mar 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/detailnet/dfw-varcrypt-module)[ Packagist](https://packagist.org/packages/detailnet/dfw-varcrypt-module)[ Docs](https://github.com/detailnet/dfw-varcrypt-module/)[ RSS](/packages/detailnet-dfw-varcrypt-module/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (15)Versions (4)Used By (0)

Zend Framework 2 Module for dfw-varcrypt
========================================

[](#zend-framework-2-module-for-dfw-varcrypt)

[![Build Status](https://camo.githubusercontent.com/790712d1e7f8e6b94f5408523a911cc51a2c8a9dc88e3ea1043dbb2a18f8c1d8/68747470733a2f2f7472617669732d63692e6f72672f64657461696c6e65742f6466772d76617263727970742d6d6f64756c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/detailnet/dfw-varcrypt-module)[![Coverage Status](https://camo.githubusercontent.com/b4a6ca3ff7a82142c964fbb902061240398e483a70252992e9b65b2ac19cf53c/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f64657461696c6e65742f6466772d76617263727970742d6d6f64756c652e737667)](https://coveralls.io/r/detailnet/dfw-varcrypt-module)[![Latest Stable Version](https://camo.githubusercontent.com/564e99c427cdf76f1483f08ea71045a6de289b0ad1233be33c25d03fe14f79b7/68747470733a2f2f706f7365722e707567782e6f72672f64657461696c6e65742f6466772d76617263727970742d6d6f64756c652f762f737461626c652e737667)](https://packagist.org/packages/detailnet/dfw-varcrypt-module)[![Latest Unstable Version](https://camo.githubusercontent.com/c920f0961b4bbed171387168bab313eea073841ca46b8dea93864708aac52ea5/68747470733a2f2f706f7365722e707567782e6f72672f64657461696c6e65742f6466772d76617263727970742d6d6f64756c652f762f756e737461626c652e737667)](https://packagist.org/packages/detailnet/dfw-varcrypt-module)

Introduction
------------

[](#introduction)

This module integrates the [DETAIL Framework library for for working with encrypted environment variables](https://github.com/detailnet/dfw-varcrypt) with [Zend Framework 2](https://github.com/zendframework/zf2).

Requirements
------------

[](#requirements)

[Zend Framework 2 Skeleton Application](http://www.github.com/zendframework/ZendSkeletonApplication) (or compatible architecture)

Installation
------------

[](#installation)

Install the module through [Composer](http://getcomposer.org/) using the following steps:

1. `cd my/project/directory`
2. Create a `composer.json` file with following contents (or update your existing file accordingly):

    ```
    {
        "require": {
            "detailnet/dfw-varcrypt-module": "1.x-dev"
        }
    }
    ```
3. Install Composer via `curl -s http://getcomposer.org/installer | php` (on Windows, download the [installer](http://getcomposer.org/installer) and execute it with PHP)
4. Run `php composer.phar self-update`
5. Run `php composer.phar install`
6. Open `configs/application.config.php` and add following key to your `modules`:

    ```
    'service_manager' => array(
        'delegators' => array(
            'ModuleManager' => array(
                // By attaching this delegator the module Detail\VarCrypt is loaded before
                // all other modules so that the encrypted environment variables can be
                // applied before the configs of the other modules are merged/applied.
                'Detail\VarCrypt\Factory\ModuleManager\ModuleManagerDelegatorFactory',
            ),
        ),
    ),
    ```
7. Copy `vendor/detailnet/dfw-varcrypt-module/config/detail_varcrypt.local.php.dist` into your application's `config/autoload` directory, rename it to `detail_varcrypt.local.php` and make the appropriate changes.

Usage
-----

[](#usage)

### Save/encode config

[](#saveencode-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:

1. Define credentials as JSON:

    ```
    {
      "server": "localhost",
      "user": "root",
      "password": "root",
      "port": 27017,
      "dbname": null,
      "options": []
    }
    ```
2. Make sure an encryption key is set in `detail_varcrypt.local.php`.
3. Encode JSON: `php public/index.php varcrypt encode-value {"server": ...}`
4. Save the output as environment variable (e.g. `MONGO`).
5. Test that the environment variable can be accessed (at least from the CLI): `php public/index.php varcrypt decode-variable MONGO`

### Apply/decode config

[](#applydecode-config)

The following steps are necessary, to use an encrypted/encoded environment variable in a ZF2 app.

1. Add the environment variable to the module's config (in `detail_varcrypt.local.php`):

    ```
    'detail_varcrypt' => array(
        'listeners' => array(
            'Detail\VarCrypt\Listener\MultiEncryptorListener' => array(
                'apply_variables' => array(
                    'mongo',
                ),
            ),
        ),
    ),
    ```
2. Access environment variables as you normally would:

    ```
    array(
        'doctrine' => array(
            'connection' => array(
                'odm_default' => array(
                    'server' => getenv('MONGO_SERVER') ?: 'localhost',
                    ...
                ),
            ),
        ),
    )
    ```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Total

3

Last Release

3980d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca881f1116d03f5f9469b1700f60b0547140369403147a9105b562cc7e5f1311?d=identicon)[curzio-della-santa](/maintainers/curzio-della-santa)

---

Tags

encryptionenvironmentmodulezf2variablesdfwdetailnet

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/detailnet-dfw-varcrypt-module/health.svg)

```
[![Health](https://phpackages.com/badges/detailnet-dfw-varcrypt-module/health.svg)](https://phpackages.com/packages/detailnet-dfw-varcrypt-module)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
