PHPackages                             vkr/settings-bundle - 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. vkr/settings-bundle

ActiveSymfony-bundle

vkr/settings-bundle
===================

A bundle for Symfony2/3 that simplifies retrieving settings from config files and Doctrine entities

1.1.2(9y ago)01965MITPHPPHP &gt;=5.6

Since Jul 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/wladislavk/SettingsBundle)[ Packagist](https://packagist.org/packages/vkr/settings-bundle)[ Docs](https://github.com/wladislavk/SettingsBundle)[ RSS](/packages/vkr-settings-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (5)Used By (5)

About
=====

[](#about)

This is a simple bundle that aims to simplify the process of getting Symfony project settings from different places. Currently it supports two sources of settings: a config file or an entity under control of Doctrine. Note that this bundle requires Doctrine to work.

Installation
============

[](#installation)

The only thing you need to do prior to using this bundle is to define the entity. If you will always be using parameter-based settings, you can skip this completely.

To create an entity supported by this bundle, you need to create a Doctrine entity class that would implement VKR\\SettingsBundle\\Interfaces\\SettingsEntityInterface and define two of its methods, *getName()* and *getValue()*, both of those must return strings.

Then, you need to create a parameter called *settings\_entity* in your config file, it must contain the fully qualified name of your entity, e.g.

`settings_entity: 'AppBundle\Entity\Settings'`

Please note that the following entry will NOT work:

`settings_entity: 'AppBundle:Settings'`

That's it.

Usage
=====

[](#usage)

First, create a *SettingsRetriever* service object. Then, use its *get()* method with your setting name as an argument. The script will first try to get a parameter with that key from your config file. If there is none, it will try to find a DB record with name parameter equal to *get()* method's argument and then use *getValue()* on it. Otherwise, it will through a *VKR\\SettingsBundle\\Exception\\SettingNotFoundException*.

Example (should be run from a controller):

```
$settingsRetriever = $this->get('vkr_settings.settings_retriever');
try {
    $mySetting = $settingsRetriever->get('my_setting');
} catch (VKR\SettingsBundle\Exception\SettingNotFoundException $e) {
    // do something
}

```

API
===

[](#api)

*void SettingsRetriever::\_\_construct(Container $container, EntityManager $em)*

Container and entity manager should be injected if initialized manually

*string SettingsRetriever::get(string $settingName, bool $suppressErrors=false)*

If the second argument is set to true, the method will return false if the setting is not found instead of throwing an exception.

*string\[\] SettingsRetriever::getAllFromDB()*

Will try to retrieve all objects from the settings entity as a key-value array. If the entity is not set, will return empty array. This method will ignore all parameters-based settings.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~90 days

Total

4

Last Release

3317d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79f5fa971e7fda7a6180c1bdfca4f819a43b7681ec4e04c66b184a082fb5a20f?d=identicon)[wladislavk](/maintainers/wladislavk)

---

Top Contributors

[![wladislavk](https://avatars.githubusercontent.com/u/11371476?v=4)](https://github.com/wladislavk "wladislavk (5 commits)")

---

Tags

configurationSettingsSymfony2symfony3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vkr-settings-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/vkr-settings-bundle/health.svg)](https://phpackages.com/packages/vkr-settings-bundle)
```

###  Alternatives

[dmishh/settings-bundle

Database centric Symfony configuration management. Global and per-user settings supported.

115254.9k1](/packages/dmishh-settings-bundle)[fsi/admin-bundle

FSi Admin Bundle. Admin generator for Symfony.

5849.2k7](/packages/fsi-admin-bundle)[damianociarla/dynamic-discriminator-map-bundle

DCSDynamicDiscriminatorMapBundle simplifies the use of Doctrine Single Table Inheritance mapping strategy in Symfony2.

1237.7k](/packages/damianociarla-dynamic-discriminator-map-bundle)[symfonyid/admin-bundle

Provide Admin Generator with KISS Principle

141.6k](/packages/symfonyid-admin-bundle)

PHPackages © 2026

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