Download the PHP package modera/config-bundle without Composer

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

ModeraConfigBundle

Bundles provides tools that allow to you to dynamically store and fetch your configuration properties in a flexible way. You can store any type of configuration property - your configuration property can store both simple values (like string, integers, arrays) or complex ones - like objects or references to entities, this is achieved by using so called "Handlers" (implementations of \Modera\ConfigBundle\Config\HandlerInterface).

Installation

Step 1: Download the Bundle

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

This bundle should be automatically enabled by Flex. In case you don't use Flex, you'll need to manually enable the bundle by adding the following line in the config/bundles.php file of your project:

Publishing configuration properties

Before you can use your configuration properties you need to publish them. Publishing process consists of several steps:

  1. Create a provider class.
  2. Register your provides class in service container with "modera_config.config_entries_provider" tag.
  3. Use modera:config:install-config-entries command to publish exposed configuration entries.

This is how a simple provider class could look like:

Once you have a class you need to register it in a service container:

Now we can use modera:config:install-config-entries to publish our configuration property.

Fetching configuration properties

In order to fetch a configuration property in your application code you need to use modera_config.configuration_entries_manager service.

Twig integration

The bundle also provides integration with Twig that allow you to fetch configuration properties' values from your template. For this you will want to use modera_config_value function:

This will print value for "my_property_name" configuration property. By default if no given configuration property is found then exception is thrown but you can change this behaviour by passing FALSE as second argument to the function and in this case NULL be returned instead of throwing an exception.

As you will read later in this document the bundle also has support for associating configuration entries with users. To fetch a user specific configuration property from a template use modera_config_owner_value, for example:

Handlers

By default the bundle is capable of storing these types of values:

If you need to store some more complex values then you need to implement \Modera\ConfigBundle\Config\HandlerInterface interface. Please see already shipped implementations (\Modera\ConfigBundle\Config\EntityRepositoryHandler, for example) to see how you can create your own handlers.

Creating user related configuration entries

Sometimes you may want to store configuration entries which are not related to the system as a whole but instead to one single user, for example - user's preferred admin panel language. To achieve this you need to use modera_config/owner_entity semantic configuration key to specify a fully qualified name of user entity. For example:

Once owner_entity is configured don't forget to update your database schema by running doctrine:schema:update --force.

Now that we have proper configuration in place and database schema has been updated when creating new configuration entries you can specify "owner", for example:

Hints

In your application code when working with components from ModeraConfigBundle you should rely on interfaces instead of implementations, that is, when you use modera_config.configuration_entries_manager rely on \Modera\ConfigBundle\Manager\ConfigurationEntriesManagerInterface and when working with configuration entries rely on \Modera\ConfigBundle\Manager\ConfigurationEntryInterface this way you will make your code portable. By default the bundle uses Doctrine ORM to store values for configuration entries but later some more storage mechanism may be added and if you rely on interfaces then you won't need to update your code to leverage new possible storage engines.

Licensing

This bundle is under the MIT license. See the complete license in the bundle: Resources/meta/LICENSE


All versions of config-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
twig/twig Version ~1.34|~2.4
doctrine/orm Version ^2.5
doctrine/doctrine-bundle Version ^1.6|^2.0
symfony/framework-bundle Version ^3.4|^4.0
modera/foundation-bundle Version ~3.1|~4.0
sergeil/expander-bundle Version ^1.0
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 modera/config-bundle contains the following files

Loading the files please wait ....