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

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

ironedge/config
===============

A simple object with useful methods to easily access your configuration values.

0107PHP

Since Jan 31Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Config
======

[](#config)

[![Build Status](https://camo.githubusercontent.com/1ca656c37ec5e31d3bbac6ee03b5a159f0141f9e6fa5d4acdb28f4bfb5742be3/68747470733a2f2f7472617669732d63692e6f72672f69726f6e65646765736f6674776172652f636f6e6669672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ironedgesoftware/config)

This component provides a simple API to handle configuration parameters. It can handle different **readers** and **writers** to read from and write to any storage.

Currently supported readers and writers:

- **files**: Using component [**ironedge/file-utils**](https://github.com/ironedgesoftware/file-utils).
- **array**: Useful for testing purposes.

Usage
-----

[](#usage)

To start using the configuration object, you only need to instantiate it. Default reader is **file**, which means it loads the configuration from a file by default. The default **writer** is also **file**, which means it will save the data to a file. You can, of course, set the reader and writer you want, as you'll see later.

### Basic Usage

[](#basic-usage)

In the following example, we set an array as the initial data of the config object, and start accessing its data through the API provided by our **IronEdge\\Component\\Config\\Config** class. We use the **DataTrait** provided by our component [**ironedge/common-utils**](https://github.com/ironedgesoftware/common-utils) to expose some of the following methods:

```
