https://github.com/samrap/gestalt
Gestalt is a simple, elegant PHP package for managing your framework's configuration values.
https://github.com/samrap/gestalt
config config-management php
Last synced: 3 months ago
JSON representation
Gestalt is a simple, elegant PHP package for managing your framework's configuration values.
- Host: GitHub
- URL: https://github.com/samrap/gestalt
- Owner: samrap
- License: mit
- Created: 2016-09-03T07:01:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-20T23:51:31.000Z (almost 9 years ago)
- Last Synced: 2025-06-03T05:25:37.151Z (4 months ago)
- Topics: config, config-management, php
- Language: PHP
- Size: 56.6 KB
- Stars: 16
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Gestalt
[](https://styleci.io/repos/67276253)
[](https://travis-ci.org/samrap/gestalt)
[](https://packagist.org/packages/samrap/gestalt)
[](https://packagist.org/packages/samrap/gestalt)
[](https://packagist.org/packages/samrap/gestalt)> **ge·stalt (n):** _Something that is made of many parts and yet is somehow more than or different from the combination of its parts; broadly : the general quality or character of something._
Gestalt is a simple and elegant PHP package for managing your framework's configuration values. It is lightweight, flexible, framework agnostic, and has no dependencies other than PHP itself.
### Features
- **Lightweight:** Gestalt is built to be lightweight. No dependencies, no bloat, just an object-oriented wrapper around your framework's configuration.
- **Powerful:** Who said lightweight means powerless? Gestalt has a small footprint but packs a mean punch. Just take a look at its [Custom Loaders](https://github.com/samrap/gestalt-docs/blob/master/loaders.md) and [Observers](https://github.com/samrap/gestalt-docs/blob/master/observers.md) and you'll see for yourself.
- **Flexible:** Developers like to do things _our_ way. Gestalt gives you the flexibility to integrate seamlessly with your application.
- **Expressive syntax**: With its clean, collection-like syntax, code artisans will feel right at home. Messy developers will like it too!### Examples
The following are just a few of the features Gestalt has to offer. [Visit the docs](https://github.com/samrap/gestalt-docs) for more on installation, usage, and features.
**Basic Usage** ([Learn More](https://github.com/samrap/gestalt-docs/blob/master/introduction.md))
```php
$config = new Configuration([
'app' => [
'debug' => true,
'version' => '1.0',
],
]);// Get values using dot notation or ArrayAccess.
$config->get('app.debug');
$config['app'];// Add values using dot notation or ArrayAccess.
$config->add('app.locale', 'en');
$config['mail'] = ['driver' => 'MailMonkey'];
```**Custom Loading** ([Learn More](https://github.com/samrap/gestalt-docs/blob/master/loaders.md))
```php
$config = Configuration::load(new JsonFileLoader);$config->get('app.debug');
```**Observers** ([Learn More](https://github.com/samrap/gestalt-docs/blob/master/observers.md))
```php
$config = new Configuration($values);$config->attach(new StatefulObserver);
// Notifies the StatefulObserver that the
// Configuration has been updated.
$config->set('app.debug', false);
```Interested? [Check out the docs](https://github.com/samrap/gestalt-docs) to see all of the features in action!