PHPackages                             senhung/config-read-write - 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. senhung/config-read-write

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

senhung/config-read-write
=========================

A package for reading and writing config file

v2.0.0(7y ago)0382MITPHPPHP &gt;=7.1.0

Since Apr 25Pushed 7y agoCompare

[ Source](https://github.com/senhungwong/config-read-write)[ Packagist](https://packagist.org/packages/senhung/config-read-write)[ RSS](/packages/senhung-config-read-write/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (8)Used By (2)

Config Read Write
=================

[](#config-read-write)

Description
-----------

[](#description)

A PHP package for reading and setting configuration fast and easy.

Setup
-----

[](#setup)

1. Add Dependency

```
$ composer require senhung/config-read-write
```

2. Add a Configuration File

Create a file and input the configurations

For example:

```
# Some Comments
APP_NAME=config-read
VERSION=2.0.0

```

How To Use
----------

[](#how-to-use)

### Initialize

[](#initialize)

```
Configruation::initializeConfigs(
    [string $configFilePath [, bool $absolutePath [, string $separator]]]
): void
```

`$configFilePath`: the location your config file is placed (default: `'.env'`)

`$absolutePath`: the path defined is absolute path or relative path (default: `true`)

`$separator`: the separator between config keys and values (default: `'='`)

#### Config Entry

[](#config-entry)

Add the following code in your program's main entry if you want to specify a different config file name or separator other than the default ones

```
