Download the PHP package c975l/config-bundle without Composer
On this page you can find all versions of the php package c975l/config-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download c975l/config-bundle
More information about c975l/config-bundle
Files in c975l/config-bundle
Package config-bundle
Short Description Symfony bundle providing the EasyAdmin dashboard and database-backed configuration at the root of the c975L ecosystem — the shared hub every satellite bundle plugs into for menus, exports/imports, alerts, and other cross-bundle dashboard contributions.
License MIT
Homepage https://github.com/975L/ConfigBundle
Informations about the package config-bundle
c975L ConfigBundle
A Symfony bundle that stores application configuration as key-value pairs in the database, with an EasyAdmin management interface, Twig/PHP accessors, and production deployment tooling.
Features
- Key-value config entries stored in the database (
site_configtable) - EasyAdmin CRUD interface to manage values
- SQL export button for production deployment
- Twig and PHP service to read values anywhere
- 1-hour cache with automatic invalidation on change
Installation
Run the database migration to create the site_config table:
Defining config entries for your bundle
Create a config/configs.json file in your bundle. Each entry will be inserted into the database on first load (duplicates are skipped):
Supported kind values: text, int, bool, date, json.
For json, value is the raw JSON-encoded string (e.g. "[\"ROLE_ADMIN\",\"ROLE_EDITOR\"]"); ConfigService::get() returns it already decoded into a PHP array ([] if empty/invalid).
Set sensitive: true for any entry that holds secrets (API keys, passwords, etc.).
group is optional and clusters entries in the EasyAdmin list (filter + default sort). It must be one of the fixed values in Config::GROUPS, each backed by a label.group_* translation key:
| Value | Meaning |
|---|---|
system |
Access control, maintenance mode |
general |
Site identity (name, logo, favicon, URL...) |
legal |
Terms of use, cookies, legal notice, DPO |
credits |
Hosted-by / made-by links and logos |
analytics |
Matomo and other tracking |
backup |
Database backup settings |
email |
Sender/recipient addresses |
form |
Contact form behavior (anti-spam delay, GDPR consent) |
security |
ReCaptcha and similar anti-abuse keys |
shop |
Currency, shipping, shop identity |
payment |
Payment provider keys (Stripe...) |
This list is closed on purpose so filtering stays useful; if none fits, leave group unset rather than inventing a new value (adding one requires extending Config::GROUPS and the matching translations in ConfigBundle itself).
Loading config entries into the database
Auto-discovers every vendor/c975l/*/config/configs.json file and loads them in one shot:
New entries (new slug) are inserted with their value from the JSON. For entries that already exist, only the metadata fixed by the bundle author — label, kind, group, description — is re-synced from the JSON on every run; value and sensitive carry production state and are never touched, so editing a configs.json file (e.g. moving a config to a new group, fixing a typo in a label) and re-running load-all is enough to propagate the change, without risking an admin-set value.
Encrypting sensitive values
Sensitive config values can be encrypted at rest (AES-256-CBC) using a C975L_VAULT_KEY defined in .env.local. Generate a key:
Add it to .env.local:
Then run the following command to encrypt any sensitive value still stored in plain text — it is idempotent and safe to run multiple times, skipping empty or already-encrypted values:
EasyAdmin interface
The bundle registers a management dashboard at /management. Navigate to Config to view entries and edit their value — label, slug, kind, group, and description are fixed by the bundle's configs.json and shown read-only; there is no manual creation or deletion, entries only come from configs.json.
JS assets loaded on the dashboard
The /management dashboard loads a dedicated AssetMapper entry, @c975l/ui-bundle/admin.js (not your site's main app entry), so that satellite bundles needing Stimulus controllers in the back-office (e.g. c975l/ui-bundle's block editor) don't drag your site's front-end stylesheet into EasyAdmin. See the UiBundle README for how to define this entry.
Deploying to production — Export SQL
On the config list page, click the Export SQL button. The browser downloads a site_config_YYYYMMDD_HHMMSS.sql file — nothing is written to disk or version control.
Import it on your production server:
Behavior per entry type:
is_sensitive |
SQL statement | Effect on production |
|---|---|---|
false |
INSERT … ON DUPLICATE KEY UPDATE |
Creates or updates label, value, kind, group, description |
true |
INSERT IGNORE INTO |
Creates if missing; preserves existing production value |
This means non-sensitive values (labels, descriptions, default content) are kept in sync, while live API keys and secrets already set on production are never overwritten.
Contributing menu items from other bundles
Satellite bundles add entries to the /management dashboard by implementing MenuProviderInterface — no manual service tagging needed, MenuProviderPass auto-detects any class implementing it.
Make sure your bundle's services.yaml includes the Management/ folder in its src/ resource so the class is registered.
Section merging: if several bundles declare the same getMenuSection() (identical label + translation_domain), their menus are merged under a single section header instead of being duplicated.
Alphabetical ordering: within a section, menu items are always sorted alphabetically by their translated label.
Links section: getLinks() exposes links to plain routes (e.g. a public page), each entry shaped like:
Links from every bundle are merged into a single "Links" section (opened in a new tab), sorted alphabetically.
Reading config values
In PHP
In Twig
License
MIT — see LICENSE.
All versions of config-bundle with dependencies
c975l/ui-bundle Version ^1
doctrine/orm Version ^3.6
easycorp/easyadmin-bundle Version ^5.1
sensiolabs/minify-bundle Version ^1.2
symfony/asset-mapper Version ^8.0
symfony/console Version ^8.0
symfony/filesystem Version ^8.0
symfony/finder Version ^8.0
symfony/form Version ^8.0
symfony/mailer Version ^8.0
symfony/messenger Version ^8.0
symfony/process Version ^8.0
symfony/security-bundle Version ^8.0
symfony/serializer Version ^8.0
symfony/ux-chartjs Version ^3.3
symfony/yaml Version ^8.0