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

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

phpfit/config
=============

Collect and provide configs from local files or config providers

1.1.0(8mo ago)07MITPHP

Since Aug 15Pushed 8mo agoCompare

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

READMEChangelogDependencies (2)Versions (3)Used By (0)

phpfit/config
=============

[](#phpfitconfig)

Collect and provide configs from local files or config providers

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

[](#installation)

```
composer require phpfit/config
```

Usage
-----

[](#usage)

```
use PhpFit\Config\Config;

$config = new Config($options);
$host = $config->host;

// To use it globally with static ::get
Config::$config = $config;
$host = Config::get('host');
```

Options
-------

[](#options)

### ?string $directory

[](#string-directory)

Directory to get all local php config file. Base name of the file will be used as config key, while the content on the file as value.

File `local.php` is a special file that will be used as replacer for all other predefined configs.

### ?array/ConfigProviderInterface $providers

[](#arrayconfigproviderinterface-providers)

List of config provider to call on getting the configs

### ?CacheInterface $cache

[](#cacheinterface-cache)

The cache driver to use to cache the config.

### ?string $cache\_name = 'phpfit-config'

[](#string-cache_name--phpfit-config)

Default cache name to use to store the final configs.

Interfaces
----------

[](#interfaces)

### PhpFit\\Config\\Interfaces\\ConfigProviderInterface

[](#phpfitconfiginterfacesconfigproviderinterface)

An interface to use for custom config provider.

#### public static function inject(array $configs, mixed $options): array

[](#public-static-function-injectarray-configs-mixed-options-array)

This method get called for every time the config generated. The method should return new configs to use.

Providers
---------

[](#providers)

### PhpFit\\Config\\Provider\\LocalProvider

[](#phpfitconfigproviderlocalprovider)

The config provider for local file.

License
-------

[](#license)

The phpfit/config library is licensed under the MIT license. See [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance59

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

Every ~12 days

Total

2

Last Release

264d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5726035?v=4)[Iqbal Fauzi](/maintainers/iqbalfn)[@iqbalfn](https://github.com/iqbalfn)

---

Top Contributors

[![iqbalfn](https://avatars.githubusercontent.com/u/5726035?v=4)](https://github.com/iqbalfn "iqbalfn (3 commits)")

### Embed Badge

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

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

###  Alternatives

[mobiledetect/mobiledetectlib

Mobile\_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

10.7k159.4M431](/packages/mobiledetect-mobiledetectlib)[illuminate/contracts

The Illuminate Contracts package.

705122.9M10.1k](/packages/illuminate-contracts)[phiki/phiki

Syntax highlighting using TextMate grammars in PHP.

3573.0M23](/packages/phiki-phiki)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[flow-php/etl

PHP ETL - Extract Transform Load - Abstraction

374468.4k51](/packages/flow-php-etl)[gehrisandro/tailwind-merge-php

TailwindMerge for PHP merges multiple Tailwind CSS classes by automatically resolving conflicts between them

1391.5M9](/packages/gehrisandro-tailwind-merge-php)

PHPackages © 2026

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