PHPackages                             vakata/config - 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. vakata/config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vakata/config
=============

A PHP config class (parses .env files)

2.2.1(1y ago)25.9k↓50%MITPHPPHP &gt;=8.0

Since Jul 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vakata/config)[ Packagist](https://packagist.org/packages/vakata/config)[ Docs](https://github.com/vakata/config)[ RSS](/packages/vakata-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (15)Used By (0)

config
======

[](#config)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aa2b5b191ad985f95c60e6b32b5318083f41274e713c0c7d10e9ee26c31ac6b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616b6174612f636f6e6669672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vakata/config)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A PHP config class, which supports parsing .env files.

Install
-------

[](#install)

Via Composer

```
$ composer require vakata/config
```

Usage
-----

[](#usage)

```
$config = new \vakata\config\Config([ 'key' => 'value' ]);
$config->fromFile(__DIR__ . '/config.env');
$config->get('key'); // "value"
$config->set('key', 2); // 2
$config->get('key'); // 2
$config->del('key'); // true
$config->get('key'); // null
$config->get('key', 'default'); // "default"
$config->export(); // export all stored values to enviroment and $_SERVER
$config->export(true); // same as above but overwrite existing values
```

Testing
-------

[](#testing)

```
$ phpunit --bootstrap ./vendor/autoload.php ./tests/
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [vakata](https://github.com/vakata)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance45

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity76

Established project with proven stability

 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

Every ~243 days

Recently: every ~190 days

Total

14

Last Release

427d ago

Major Versions

1.1.5 → 2.0.02017-12-18

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

2.0.0PHP &gt;=7.0

2.0.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/d28c78c63326e84720007ecc58d0eb8c8d0d4fa4b887f95fb3a583423ca09e18?d=identicon)[vakata](/maintainers/vakata)

---

Top Contributors

[![vakata](https://avatars.githubusercontent.com/u/146052?v=4)](https://github.com/vakata "vakata (22 commits)")

---

Tags

configvakata

### Embed Badge

![Health badge](/badges/vakata-config/health.svg)

```
[![Health](https://phpackages.com/badges/vakata-config/health.svg)](https://phpackages.com/packages/vakata-config)
```

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)[dflydev/dot-access-configuration

Given a deep data structure representing a configuration, access configuration by dot notation.

13414.5M4](/packages/dflydev-dot-access-configuration)[akaunting/laravel-setting

Persistent settings package for Laravel

495805.1k7](/packages/akaunting-laravel-setting)[m1/env

Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.

6412.0M21](/packages/m1-env)[jbzoo/data

An extended version of the ArrayObject object for working with system settings or just for working with data arrays

891.6M23](/packages/jbzoo-data)

PHPackages © 2026

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