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

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

hsntngr/config-loader
=====================

Load configuration files with ease

v1.2(5y ago)011MITPHP

Since Jun 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/hsntngr/config-loader)[ Packagist](https://packagist.org/packages/hsntngr/config-loader)[ RSS](/packages/hsntngr-config-loader/feed)WikiDiscussions master Synced 2d ago

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

Load and Use Configuration Files With Ease
==========================================

[](#load-and-use-configuration-files-with-ease)

Basic Usage

database.php

```
return [
  'user' => 'hsntngr',
  'password' => 'secret'
  ...
];
```

```
echo config("database.user");
// hsntngr
```

**Insallation**

`composer require hsntngr/config-loader`

**Create a Config File**

yaml example

```
driver: mysql
host: 127.0.0.1
dbname: example
port: 3306
user:
  name: hsntngr
  password: secret
```

php example

```
return [
    "driver" => "mysql",
    "host" => "127.0.0.1",
    "dbname" => "example",
    "port" => "3306",
    "user" => [
        "name" => "example",
        "password" => "secret",
    ]
];
```

**Register Config Loader**

```
use Hsntngr\Config\Config;
use Hsntngr\Config\ArrayLoader;

$path = "/path/to/config/directory/";
$config = Config::create(new ArrayLoader($path));
// use YamlLoader for yaml files
$config->load();

// loading single file
$path = "/path/to/config.php";
$config->loadFromFile($path);
```

**Basic Usage**

get a config value with helper method

```
config('auth.session.provider');
// database
```

get a config value with Config class

```
$config = Config::getInstance();
$config->get('auth.session.provider');
```

store a config value at runtime

```
config("auth.api.token", "sample-token")

print_r(config("auth.api"))

// [
//  "driver"  => "driver",
//  "endpoint" => "v1/users",
//  "token" => "sample-token"
// ]
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

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 ~0 days

Total

3

Last Release

2153d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/489114a5dba3dcaebb2b5c7c146a484e519890d0421e5826b71319694e5348c2?d=identicon)[hsntngr](/maintainers/hsntngr)

### Embed Badge

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

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

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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