PHPackages                             nimbly/caboodle - 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. nimbly/caboodle

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

nimbly/caboodle
===============

Configuration and settings manager with autoloading from disk or AWS Secrets Manager.

1.0(2y ago)16.7kMITPHPPHP ^8.0CI failing

Since Aug 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nimbly/Caboodle)[ Packagist](https://packagist.org/packages/nimbly/caboodle)[ RSS](/packages/nimbly-caboodle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (6)Versions (7)Used By (0)

Caboodle
========

[](#caboodle)

[![Latest Stable Version](https://camo.githubusercontent.com/ade04b9187941eadb1869b6fb3888652dc1a865f20fb4291265440af02c7c7c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696d626c792f6361626f6f646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nimbly/Caboodle)[![GitHub Workflow Status](https://camo.githubusercontent.com/e4fc34cbfda40ec3c3e56d99df39cb775b4dd4adac4a65dff2c097c1d29b4094/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e696d626c792f6361626f6f646c652f7068702e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/nimbly/Caboodle/actions/workflows/php.yml)[![Codecov branch](https://camo.githubusercontent.com/4d0fe50f5d80ed6d5de9ee7976ab33eea423b3715426b8904814072ed5140793/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6e696d626c792f6361626f6f646c652f6d61737465723f7374796c653d666c61742d737175617265)](https://app.codecov.io/github/nimbly/Caboodle)[![License](https://camo.githubusercontent.com/f3e0c376c250ec66d8e771e97f14f7bf289dde7bb9f457accc77cc69ce69f488/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e696d626c792f4361626f6f646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nimbly/Caboodle)

A simple PSR-11 compliant configuration manager with lazy loading from files, AWS Secrets Manager, or any other source.

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

[](#installation)

```
composer require nimbly/config
```

Usage
-----

[](#usage)

Instantiate the `Config` manager with an array of LoaderInterface instances. You may specify as many loaders as you"d like - or none at all.

```
$config = new Config([
	new FileLoader(__DIR__ . "/config")
]);
```

Get data from config.

```
$config->get("database.hostname");
```

### Loaders

[](#loaders)

Loaders are responisble for accepting a `key`, loading, and then passing the data back.

Two loaders are provided out of the box: `FileLoader` and `AwsLoader` but a `LoaderInterface` is provided for implementing any other loader.

#### FileLoader

[](#fileloader)

The `FileLoader` will attempt to load configuration data from the local filesystem.

Instantiate the `FileLoader` with a path to your configuration files.

```
new FileLoader("/path/to/config/files");
```

Configuration files should return an associative array of your configuration data.

```
