https://github.com/galileo/galileosettingbundle
With this repository we will try to fill the gap of simple configuration and settings functionality handled by external storage mechanism.
https://github.com/galileo/galileosettingbundle
behat configuration-management phpspec settings-storage symfony-bundle
Last synced: 2 months ago
JSON representation
With this repository we will try to fill the gap of simple configuration and settings functionality handled by external storage mechanism.
- Host: GitHub
- URL: https://github.com/galileo/galileosettingbundle
- Owner: galileo
- License: mit
- Created: 2017-02-11T16:35:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T09:05:12.000Z (over 8 years ago)
- Last Synced: 2025-02-18T03:45:37.991Z (over 1 year ago)
- Topics: behat, configuration-management, phpspec, settings-storage, symfony-bundle
- Language: PHP
- Size: 44.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://insight.sensiolabs.com/projects/b0f4ac5f-a7fa-443d-a9d5-4361e395c3aa)
[](https://scrutinizer-ci.com/g/galileo/GalileoSettingBundle/?branch=master)
[](https://scrutinizer-ci.com/g/galileo/GalileoSettingBundle/build-status/master)
[](https://scrutinizer-ci.com/g/galileo/GalileoSettingBundle/?branch=master)
[](https://packagist.org/packages/galileo/galileo-setting-bundle)
[](https://packagist.org/packages/galileo/galileo-setting-bundle)
[](https://packagist.org/packages/galileo/galileo-setting-bundle)
# GalileoSettingBundle
With this repository we will try to fill the gap of simple configuration and settings functionality handled by external storage mechanism.
## Comparision to CraueConfigBundle
This bundle will add you some additional possibilities to handle your settings, and also is esier to use without exception handling in our application.
| FUnctionality | GalileoSettingBundle | CraueSettingBundle |
| --- | --- | --- |
| Get values without exception | :white_check_mark: | :x: |
| Settings unique for all sections | :x: | :white_check_mark: |
| Settings unique within section | :white_check_mark: | :x: |
| GUI panel to manage settings | :x: | :white_check_mark: |
| Set settings default values | :white_check_mark: | :x: |
| Events exposed for customize actions | :white_check_mark: | :x: |
| Change setting value | :white_check_mark: | :white_check_mark: |
| Established create function | :white_check_mark: | :x: |
Craue documentation:
https://github.com/craue/CraueConfigBundle
## Basic usage:
Simple get:
~~~
$service('galileo.setting.setting')->get('our_settinng');
~~~
Get with default value:
~~~
$service('galileo.setting.setting')->get('email_address', 'hello@galileoprime.com');
~~~
Get users within sections, you can use them for example for user specific settings:
~~~
$service('galileo.setting.setting')->section('userId:{userId}')->get('email_address', 'hello@galileoprime.com');
~~~
## Dispatched events
### Events you can listen to
| Event name | Event class | Implemented |
| --- | --- | --- |
| `galileo.setting.not_existing_setting_queried` | NotExistingSettingQueriedEvent | :x: |
| `galileo.setting.setting_queried` | SettingQueriedEvent | :x: |
| `galileo.setting.setting_created` | SettingCreatedEvent | :x: |
| `galileo.setting.setting_changed` | SettingChangedEvent | :x: |
| `galileo.setting.setting_deleted` | SettingDeletedEvent | :x: |
### Getter events
There are two different events that are called after you try to get some setting value.
The first one will be dispatched after you ask for setting that is not registered in any storage system.
You can listen for it with kernel.listener with event value `galileo.setting.not_existing_setting_queried`
~~~
class GalileoSettingNoteExistingSettingQueried
~~~
And the second one will be dispatched after you ask for setting that already exist in our storage system
The name you can listen to is `galileo.setting.setting_queried`
### Setter events