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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vkr/settings-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

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 yesterday

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 52% 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

3364d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11371476?v=4)[Vladislav Kryshtanovskiy](/maintainers/wladislavk)[@wladislavk](https://github.com/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

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M379](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[dmishh/settings-bundle

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

114256.9k1](/packages/dmishh-settings-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[codefog/contao-haste

haste extension for Contao Open Source CMS

46676.5k164](/packages/codefog-contao-haste)

PHPackages © 2026

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