PHPackages                             slabphp/configuration-manager - 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. slabphp/configuration-manager

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

slabphp/configuration-manager
=============================

SlabPHP Configuration Manager

v0.1.3(8y ago)0571Apache-2.0PHP

Since Feb 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/SlabPHP/configuration-manager)[ Packagist](https://packagist.org/packages/slabphp/configuration-manager)[ Docs](https://www.salernolabs.com/slab)[ RSS](/packages/slabphp-configuration-manager/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (5)Used By (1)

configuration-manager
=====================

[](#configuration-manager)

SlabPHP Configuration Manager Library. This is an extracted version of the configuration utility from the Slab framework. It is designed to work with "PHP Configuration files".

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

[](#installation)

Include this project with composer:

```
composer require slabphp/configuration-manager

```

Usage
-----

[](#usage)

Create and configure the manager.

```
$manager = new \Slab\Configuration\Manager($configuration);
$manager
    ->setFileDirectories(['/some/directory', '/some/other/directory'])
    ->loadConfiguration();

```

This will instantiate a configuration manager that will look for "php configuration" files in the following directories:

- /some/directory/default.php
- /some/directory/override.php
- /some/other/directory/default.php
- /some/other/directory/override.php

The values in each will override the previously read files. You can use the secondary files to use stages based on an environment variable or server name.

Assuming this is the contents of the "php configuration" file at /some/directory/default.php:

```
