dmishh / settings-bundle
Database centric Symfony configuration management. Global and per-user settings supported.
Installs: 237 291
Dependents: 1
Suggesters: 0
Security: 0
Stars: 113
Watchers: 11
Forks: 61
Open Issues: 29
Type:symfony-bundle
Requires
- php: ^7.2|^8.0
- doctrine/orm: ^2.6.3|^2.7
- psr/cache: ^1.0
- symfony/form: ^3.4 || ^4.3 || ^5.0
- symfony/framework-bundle: ^3.4 || ^4.3 || ^5.0
Requires (Dev)
- doctrine/doctrine-bundle: ^1.12 || ^2.0
- matthiasnoback/symfony-dependency-injection-test: ^4.1
- mockery/mockery: ^1.3
- nyholm/symfony-bundle-test: ^1.6
- phpunit/phpunit: ^8.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- symfony/security-core: ^4.4 || ^5.0
- symfony/translation: ^4.4 || ^5.0
- twig/twig: ^2.0 || ^3.0
Suggests
- cache/adapter-bundle: This bundle will help you to add your PSR-6 cache implementations as Symfony services
This package is auto-updated.
Last update: 2024-12-07 20:06:17 UTC
README
Bundle for storing configuration with Symfony in database using Doctrine ORM.
👀 This bundle was previously known as dmissh/settings-bundle
, and the Packagist installation instruction will stay as is.
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 $settingsManager->set('name', 'foo'); $settingsManager->get('name'); // returns 'foo' // User settings $settingsManager->get('name', $user); // returns global 'foo' $settingsManager->set('name', 'bar', $user); $settingsManager->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