PHPackages                             mcustiel/php-simple-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. [Caching](/categories/caching)
4. /
5. mcustiel/php-simple-config

AbandonedArchivedLibrary[Caching](/categories/caching)

mcustiel/php-simple-config
==========================

A simple library to manage configuration files in different formats and cache them.

v2.0.0(10y ago)44.1k41GPL-3.0+PHPPHP &gt;=5.5

Since Oct 21Pushed 3y ago4 watchersCompare

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

READMEChangelog (8)Dependencies (10)Versions (10)Used By (1)

php-simple-config
=================

[](#php-simple-config)

What is it?
-----------

[](#what-is-it)

php-simple-config is a simple and extensible component that allows the developer to abstract the application configuration management.

php-simple-config uses a minimalistic approach and supports different types of configuration files, the currently supported types are:

- PHP files (containing a config array).
- INI files
- JSON files
- YAML files

The component can read and write these configuration formats.

Also, it allows the developer to cache the configurations to increase the performance when accessing to it, this is made through [mcustiel/php-simple-cache](https://github.com/mcustiel/php-simple-cache) library.

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

[](#installation)

### Composer:

[](#composer)

Just add the packagist dependecy:

```
    "require": {
	// ...
        "mcustiel/php-simple-config": ">=1.2.0"
    }
```

Or, if you want to get it directly from github, adding this to your composer.json should be enough:

```
{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/mcustiel/php-simple-config"
        }
    ],
    "require": {
    	// ...
        "mcustiel/php-simple-config": "dev-master"
    }
}
```

Or just download the code. :D

How to use it?
--------------

[](#how-to-use-it)

### Reading configuration

[](#reading-configuration)

First you have to create a configuration file, in this example it is a PHP file. If the format is PHP you must define a variable containing an array with the configuration and return it, for JSON or INI you don't need any special convention:

```
