Download the PHP package gupalo/config-bundle without Composer

On this page you can find all versions of the php package gupalo/config-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package config-bundle

Config Bundle

A two-column config table (name unique, value text) wired to an EasyAdmin CRUD. Drop the bundle in, register MenuItem::linkTo(ConfigCrudController::class, 'Config', …), and your IMAGE_* / FEATURE_* flags become admin-editable without a redeploy.

Requirements

Install

Composer

composer req gupalo/config-bundle

The bundle is auto-registered; no bundles.php edit needed.

Create the config table:

php bin/console make:migration
php bin/console doctrine:migrations:migrate -n

Declare possible values and their defaults in config/services.yaml. The type of each default decides how ConfigRepository::getValue() decodes the stored string — a fresh row is seeded with the default on first read, so a brand-new deploy that visits the CRUD sees the same numbers the env vars would have produced.

parameters:
    ...
    config.defaults:
        SOME_INT: 0
        SOME_BOOL: true
        SOME_DATETIME: '-2 days'

Wire the menu entry in your EasyAdminMenu::configureMenuItems():

use Gupalo\ConfigBundle\Controller\ConfigCrudController;

yield MenuItem::linkTo(ConfigCrudController::class, 'Config', 'fas fa-gears');

EasyAdmin picks up the controller automatically — no routing file to add.

Reading values from your services

ConfigRepository is autowired and public. Use the typed accessors (the type comes from the default you declared above, so an int default gives you getIntValue(), a bool default gives you getBoolValue(), etc.):

public function __construct(
    private readonly ConfigRepository $configRepository,
    #[Autowire('%env(int:IMAGE_REFILL_PER_HOUR)%')]
    private readonly int $perHourFallback = 20,
) {}

public function perHour(): int
{
    // Config-bundle row wins; env var is the fallback for the row-not-present case.
    return max(1, $this->configRepository->getIntValue('IMAGE_REFILL_PER_HOUR', $this->perHourFallback));
}

getStringValueCached() is the cached variant (60s TTL via FilesystemAdapter) — use it from the daemon's tick loop; the un-cached accessors hit the DB on every call.

Upgrading from 1.x

1.x shipped a custom form-based UI at /config. 2.0 removes it — the only UI is the EasyAdmin CRUD.


All versions of config-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
doctrine/doctrine-bundle Version ^3.0
doctrine/orm Version ^3.0
easycorp/easyadmin-bundle Version ^5.0
gupalo/dateutils Version ^1.20
symfony/cache Version ^7.4|^8.0
symfony/framework-bundle Version ^7.4|^8.0
symfony/yaml Version ^7.4|^8.0
twig/twig Version ^3.22
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gupalo/config-bundle contains the following files

Loading the files please wait ...