Database centric Symfony2 configuration management bundle. Global and per-entity settings supported.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Controller
DependencyInjection
Entity
Exception
Form/Type
Manager
Resources
Serializer
Tests
Twig
.gitignore
.travis.yml
CHANGELOG.md
DmishhSettingsBundle.php
LICENSE
README.md
UPGRADE.md
composer.json
phpunit.xml.dist

README.md

SettingsBundle

Bundle for storing configuration with Symfony in database using Doctrine2 ORM.

Build Status SensioLabsInsight

Features

  • Easy-to-use (Twig extension, container service)
  • Settings scopes per user, global or all
  • Settings validation by using the Symfony Form Component
  • 2 serialization mechanisms: PHP serialize() and JSON (+ you can write your own)
  • Settings caching (PSR-6)
  • Fast and extensible

Quick usage examples

Symfony controller:

// Global settings
$this->get('settings_manager')->set('name', 'foo');
$this->get('settings_manager')->get('name'); // returns 'foo'

// User settings
$this->get('settings_manager')->get('name', $user); // returns global 'foo'
$this->get('settings_manager')->set('name', 'bar', $user);
$this->get('settings_manager')->get('name', $user); // returns 'bar'

Twig template:

{# Global setting #}
{{ get_setting('some_setting') }} {# => 'value' #}

{# User setting #}
{{ get_setting('some_user_setting', app.user) }} {# => 'value' #}

See the general usage documentation for more examples.

Documentation

Changelog, Roadmap and contribution

Please, do not hesitate to report bugs or send pull requests. It will help to motivate me to support library better than anything else :)

See CHANGELOG.md for all major changes.

Upgrade from 1.0.*

Make sure to read the UPGRADE.md to successfully migrate your application.

License

The MIT License. For the full text of license, please, see LICENSE