PHPackages                             effectra/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. [Database &amp; ORM](/categories/database)
4. /
5. effectra/config

ActiveLibrary[Database &amp; ORM](/categories/database)

effectra/config
===============

The Effectra Config package.

v1.0.0(2y ago)1433MITPHP

Since Jun 19Pushed 2y agoCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (3)

Effectra\\Config
================

[](#effectraconfig)

The `Effectra\Config` library provides a set of classes and interfaces for managing and working with configuration settings in PHP applications.

Features
--------

[](#features)

- Configuration file handling: Read and manipulate configuration settings stored in files.
- Driver configuration: Define and manage driver-related settings such as host, port, username, and password.
- Cookie configuration: Create and manage HTTP cookies with various attributes.
- Editor configuration: Parse and retrieve settings from EditorConfig files.

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

[](#installation)

Install the library using [Composer](https://getcomposer.org/):

```
composer require effectra/config
```

Usage
-----

[](#usage)

1. Include the necessary classes or interfaces in your PHP files:

```
use Effectra\Config\ConfigFile;
use Effectra\Config\ConfigDriver;
use Effectra\Config\ConfigCookie;
use Effectra\Config\ConfigEditor;
```

2. Use the provided classes to handle configuration settings based on your application's requirements.

### Example 1: Reading and Manipulating Configuration Files

[](#example-1-reading-and-manipulating-configuration-files)

```
use Effectra\Config\ConfigFile;

// Create a ConfigFile instance with the path to your configuration file
$configFile = new ConfigFile('/path/to/config.ini');

// Read the configuration settings from the file
$config = $configFile->read();

// Access specific sections and settings
$databaseConfig = $configFile->getSection('database');
$host = $databaseConfig['host'];
$username = $databaseConfig['username'];

// Modify a setting and write the changes back to the file
$config['app']['debug'] = true;
$configFile->setFile('/path/to/config.ini')->write($config);
```

### Example 2: Creating and Managing ConfigDriver

[](#example-2-creating-and-managing-configdriver)

```
use Effectra\Config\ConfigDriver;

// Create a ConfigDriver instance with initial settings
$driver = new ConfigDriver('mysql', 'localhost', 3306, 'username', 'password');

// Get the current driver details
$driverName = $driver->getDriver();
$host = $driver->getHost();

// Update the driver settings
$driver = $driver->withHost('newhost')->withPort(8888);

// Get the updated driver details
$newHost = $driver->getHost();
$newPort = $driver->getPort();
```

### Example 3: Creating and Modifying ConfigCookie

[](#example-3-creating-and-modifying-configcookie)

```
use Effectra\Config\ConfigCookie;

// Create a ConfigCookie instance with initial attributes
$cookie = new ConfigCookie('session', 'abc123', 3600, '/', 'example.com', true, true);

// Get the cookie attributes
$name = $cookie->getName();
$secure = $cookie->getSecure();

// Create a new cookie instance with updated attributes
$newCookie = $cookie->withExpireOrOptions(7200)->withSecure(false);

// Get the updated cookie attributes
$newExpire = $newCookie->getExpireOrOptions();
$newSecure = $newCookie->getSecure();
```

### Example 4: Parsing EditorConfig File

[](#example-4-parsing-editorconfig-file)

```
use Effectra\Config\ConfigEditor;

// Create a ConfigEditor instance with the path to an EditorConfig file
$editorConfig = new ConfigEditor('/path/to/.editorconfig');

// Get the root value from the EditorConfig file
$root = $editorConfig->getRoot();

// Get the indent_size and end_of_line settings
$indentSize = $editorConfig->getIndentSize();
$endOfLine = $editorConfig->getEndOfLine();

// Check if a charset setting is defined
if ($editorConfig->hasSection('charset')) {
    $charsetSettings = $editorConfig->getSection('charset');
    // Process the charset settings
} else {
    // Handle the case when charset settings are not present
}
```

Feel free to adjust the examples according to your specific needs and use cases.

Contributing
------------

[](#contributing)

Contributions are welcome! Fork the repository, make your enhancements, and submit a pull request.

License
-------

[](#license)

This library is licensed under the [MIT License](LICENSE).

Credits
-------

[](#credits)

The `Effectra\Config` library is developed and maintained by \[Effectra\].

Feel free to update and customize the content based on your specific library details. Don't forget to replace `[link-to-documentation]` and `[Effectra]` with appropriate links and information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1064d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e6219ae87e98df8783b2f595b013035dd183c0712afd24045a8acf0a40c3bdf?d=identicon)[effectra](/maintainers/effectra)

---

Top Contributors

[![BMTmohammedtaha](https://avatars.githubusercontent.com/u/95439605?v=4)](https://github.com/BMTmohammedtaha "BMTmohammedtaha (11 commits)")

---

Tags

configconfig-serverconfigeditorconfiguration-filescookiesdatabasedbdriverphpphp8

### Embed Badge

![Health badge](/badges/effectra-config/health.svg)

```
[![Health](https://phpackages.com/badges/effectra-config/health.svg)](https://phpackages.com/packages/effectra-config)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
