Download the PHP package vivait/settings-bundle without Composer

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

Viva IT - Settings Bundle Build Status

The aim of this bundle is to allow you to retrieve and pass dynamic settings to services and other classes used in Symfony. These settings can be currently be stored in Doctrine, Redis, or Symfony's config itself. Single or multiple drivers can be specified for each setting and/or service, which will search each driver until a setting has been found.

A controller has been provided to easily allow your users to configure settings via a UI - although we recommend you customise this to match your own application.

Installation

Using composer

Enabling bundle

Add routing rules (optional)

Usage

Settings are accessed via drivers. The bundle comes with several drivers to get you started, but you must define them in your config.yml file:

The simplest way to retrieve a setting is to do it directly via the class. This will then check all of the drivers available until it can find the setting:

You can also check for settings via a driver collection. A driver collection is just a stack of drivers, and can be created via the class.

In the example above, the settings registry would try each driver referenced in the driver collection and stop when it found the appropriate setting.

You can also specify a default value for if a setting value isn't found in any driver:

Passing settings directly to services

Most likely, you're going to want to pass your settings directly to your services in your services config file. You can do this via expressions:

You can still specify the drivers in the expression:

Notice in the examples above how we've used a '.' to categorise a setting. The reason for this will become apparent when create our settings form, but groups are optional and can be nested.

Adding custom drivers

Adding custom drivers is easy, and is encouraged. For example, as part of our Auth Bundle, we allow per-user settings. This is provided via a custom driver.

All drivers must implement the interface. To register a driver add your driver to the service container:

Next, add the service id to your config.yml file as described above.

Using a form to change a setting

Create a form type, and inject the required driver.

In the form type, add the setting keys you wish to modify, as well as SettingsSubscriber and the KeyToArrayTransformer:

Handle your form as normal, but set the data using your driver of choice:

Testing Run

Unit Test are written with PHPSpec.


All versions of settings-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/yaml Version ~2.4
symfony/form Version ~2.4
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 vivait/settings-bundle contains the following files

Loading the files please wait ....