PHPackages                             nohnaimer/yii2-vault-project-configuration - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. nohnaimer/yii2-vault-project-configuration

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

nohnaimer/yii2-vault-project-configuration
==========================================

This extension helps you to easily store and retrieve settings for your project with Hashicorp Vault backend.

0.1.1(2y ago)025[1 issues](https://github.com/nohnaimer/yii2-vault-project-configuration/issues)BSD-3-ClausePHPPHP &gt;=7.1

Since Nov 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/nohnaimer/yii2-vault-project-configuration)[ Packagist](https://packagist.org/packages/nohnaimer/yii2-vault-project-configuration)[ Docs](https://github.com/nohnaimer/yii2-vault-project-configuration)[ RSS](/packages/nohnaimer-yii2-vault-project-configuration/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

yii2-vault-project-configuration
================================

[](#yii2-vault-project-configuration)

[![Latest Stable Version](https://camo.githubusercontent.com/70b8d2cecc22614760ccf61c63f7bed56759d0acc0be25684359a646ec0136fd/68747470733a2f2f706f7365722e707567782e6f72672f6e6f686e61696d65722f796969322d7661756c742d70726f6a6563742d636f6e66696775726174696f6e2f762f737461626c65)](https://packagist.org/packages/nohnaimer/yii2-vault-project-configuration)[![License](https://camo.githubusercontent.com/1d1b7791c43b208de6b1165a953f75a8ace675d16f1b97e022064309adef8ea2/68747470733a2f2f706f7365722e707567782e6f72672f6e6f686e61696d65722f796969322d7661756c742d70726f6a6563742d636f6e66696775726174696f6e2f6c6963656e7365)](https://packagist.org/packages/nohnaimer/yii2-vault-project-configuration)[![Total Downloads](https://camo.githubusercontent.com/bc1e01200ec693075b689ab12781fe1f222c64de2ddff2a37432bf4a5fb34825/68747470733a2f2f706f7365722e707567782e6f72672f6e6f686e61696d65722f796969322d7661756c742d70726f6a6563742d636f6e66696775726174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/nohnaimer/yii2-vault-project-configuration)

This extension helps you to easily store and retrieve settings for your project.

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

[](#installation)

The preferred way to install this extension through [composer](http://getcomposer.org/download/).

You can set the console

```
~$ composer require "nohnaimer/yii2-vault-project-configuration" --prefer-dist

```

or add

```
"require": {
    "nohnaimer/yii2-vault-project-configuration": "0.1.*"
}

```

in `require` section in `composer.json` file.

Configuration
-------------

[](#configuration)

For store php-fpm environment variables from system (macOS, Linux, Unix) need to uncomment clear\_env = no string in /etc/php/php-fpm.d/[www.conf](http://www.conf)

Need add environment variables:

```
VAULT_ADDR=https://vault.url/
VAULT_TOKEN=token
VAULT_KV_PATH=/kv
```

docker-compose example:

```
...
php:
  image: php:latest
  container_name: php
  restart: on-failure
  working_dir: /var/www
  environment:
    VAULT_ADDR: https://127:0:0:1:8200/
    VAULT_TOKEN: hvs.hrpvk3rEpD2HaHckeb976Ppw
  volumes:
    - .:/var/www:cached
  depends_on:
    - postgres
...
```

And need to init key value storage in Hashicorp Vault use api or web gui with VAULT\_KV\_PATH string.

Using
-----

[](#using)

bootstrap.php

```
...
const PROJECT_CONFIGURATION_USE_DEFAULT = YII_ENV_DEV;
...
```

```
$db_name = config('db.name', 'site-db-name');
$db_host = config('db.host', 'localhost');

return [
    'components' => [
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => "mysql:host={$db_host};dbname={$db_name}",
            'username' => config('db.username', 'root'),
            'password' => config('db.password', '****'),
            'enableSchemaCache' => true,
            'charset' => 'utf8',
        ],
    ],
];
```

Where is secret /kv/db and key name, host, username, password. Delimiter - .

Management
----------

[](#management)

Use yii2-setting classes to add or delete data from vault use yii2 migrations.

### Use yii2 migrations

[](#use-yii2-migrations)

```
return [
    'components' => [
        'vault' => [
            'class' => nohnaimer\config\storage\VaultStorage::class,
            'kv' => [
                'class' => nohnaimer\vault\services\KVv1::class,
                'path' => '/kv',
                'client' => [
                    'class' => nohnaimer\vault\Client::class,
                    'url' => 'url',
                    'token' => 'token',
                ],
            ],
        ],
    ],
];
```

You can use something like this:

```
class m221103_161325_vault_init extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $vault = Yii::$app->vault;
        //add
        $vault->setValue('/my/secret/key', 'value');

        //delete secret with all keys
        $vault->deleteValue('/my/secret/key');
    }
}
```

License
-------

[](#license)

**yii2-vault-project-configuration** it is available under a BSD 3-Clause License. Detailed information can be found in the `LICENSE.md`.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

918d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c0b6415ee49d051979bc8aa20ef52e654a9598b9091db92646dbc802a82700c?d=identicon)[nohnaimer](/maintainers/nohnaimer)

---

Top Contributors

[![nohnaimer](https://avatars.githubusercontent.com/u/8865830?v=4)](https://github.com/nohnaimer "nohnaimer (17 commits)")

---

Tags

Settingsconfigyii2extensionvaulthashicorp

### Embed Badge

![Health badge](/badges/nohnaimer-yii2-vault-project-configuration/health.svg)

```
[![Health](https://phpackages.com/badges/nohnaimer-yii2-vault-project-configuration/health.svg)](https://phpackages.com/packages/nohnaimer-yii2-vault-project-configuration)
```

###  Alternatives

[lav45/yii2-settings

This extension helps you to easily store and retrieve data for your application.

1615.0k2](/packages/lav45-yii2-settings)[abhi1693/yii2-config

Yii2 manage configuration from database

1311.0k1](/packages/abhi1693-yii2-config)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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