Download the PHP package ojezu/dynamic-parameter-bundle without Composer

On this page you can find all versions of the php package ojezu/dynamic-parameter-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 dynamic-parameter-bundle

OJezu/DynamicParameterBundle

This bundle enables having multiple configurations (installations) in one Symfony application. It does so, by supplying two independent features:

Combination of this features enable implementing multi-tenant applications, configured to use different resources separated at infrastructure level for each tenant. The resources can be database connection, filesystem adapters, etc. Moreover, configuration storage can be off-loaded to a database server, JSON file, zookeeper instance, with a custom or build-in parameter provider service, which will load appropriate configuration based on installation selected in application kernel.

Requirements

This bundle requires Symfony 3.4, as it depends on advanced environment variable processing.

Usage

Note: Processors from this bundle do not read actual environment variables.

Multi-installation

Provide kernel with information about installation (see configuration below), and then in your configuration you can use that information as parameters.

Usage is similar to plain environment variables, but gives more control, as it's developer who decides what and from where will find its way into Installation object. Installation parameters can be set based on request headers, php-cli arguments and any other data source, as implemented in application using this bundle (see configuration below).

All Installation class instance public properties can be accessed, and Installation class can be extended, with properties you need.

Advanced parameter provider

After configuring advanced parameter provider (see below), you are able to map parameters to abstract configuration paths used to obtain parameter values from any source, as long as there is a provider for that source. Providers are very simple services, that just have to implement ParameterProviderInterface. JSON local and remote file provider is already provided by this bundle, more powerful than Symfony built-in "json:" env variable processor.

This configuration will find database.host value in JSON config file, and provide it to DBAL configuration.

Using them together

While both features offer more than what's built in Symfony 3.4, using them together allows for easy management of multiple configurations supported by same Symfony application.

Configuration

Multi-installation

In order to be able to use multi-installation support:

  1. Enable it in configuration:

  2. Change your AppKernel to extend \OJezu\DynamicParameterBundle\Kernel\Kernel

  3. Make sure that in all places where kernel is created in your application, it is provided with Installation instance. Kernel is usually created by web/*.php or public/*.php files, but remember to modify your bin/console too.

    Complete examples can be found in doc/examples directory of this repository.

  4. In bin/console be sure to also swap Application with one provided by this bundle, if you want to specify installation via CLI option - otherwise parsing of argv may introduce problems.

Complete examples can be found in doc/examples directory

Advanced parameter provider

You must provide mapping for supported parameters. It is required due to limitations in %env(processor:variable)% Symfony DI Container configuration syntax, and to allow paths that can be easily adapted to any configuration provider.

Those parameters can later be used in all places in your application configuration, no matter support from configured bundle:

Using other parameters

In paths all previously loaded parameters can be used, including ojezu_installation parameters.

Parameter providers

Built-in parameter providers

LocalJsonFileParameterProvider

Opens and parses json file from local disk.

RemoteJsonFileParameterProvider

Downloads json file with GuzzleHttp client and optionally caches it in a PSR-16 Simple Cache compatible cache.

Custom parameter providers

You can use any service implementing OJezu\DynamicParameterBundle\Service\ParameterProviderInterface interface.

Keep in mind that your provider is a service - it can have its arguments injected, it can be tagged etc. As long as there is no cycle it will work like any other service (no use trying to inject ojezu_params there!)

Defaults?

Yes.

No config mode

In some instances there is no configuration to be loaded - e.g. when warming cache. For those instances there is "no config mode", in which provider won't be used, and all variables will be resolved to null, unless given explicit value for use in those scenarios. Defaults won't be used.

Enable it by using load_configuration option in processor section:

Extending this bundle in your application

Points for expansion are

If you need more options from Installation, extend that class with additional public properties or methods, and use your extended class in place of the base Installation.

New providers can be written by extending OJezu\DynamicParameterBundle\Service\ParameterProviderInterface and configured as described in Configuration part of this ReadMe

Testing

would be nice.

License

MIT


All versions of dynamic-parameter-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/dependency-injection Version ^3.4
symfony/config Version ^3.4
symfony/http-kernel Version ^3.4
symfony/expression-language Version ^3.3
psr/simple-cache Version ^1.0
guzzlehttp/guzzle Version ^6.3
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 ojezu/dynamic-parameter-bundle contains the following files

Loading the files please wait ....