Download the PHP package vkr/settings-bundle without Composer

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

About

This is a simple bundle that aims to simplify the process of getting Symfony project settings from different places. Currently it supports two sources of settings: a config file or an entity under control of Doctrine. Note that this bundle requires Doctrine to work.

Installation

The only thing you need to do prior to using this bundle is to define the entity. If you will always be using parameter-based settings, you can skip this completely.

To create an entity supported by this bundle, you need to create a Doctrine entity class that would implement VKR\SettingsBundle\Interfaces\SettingsEntityInterface and define two of its methods, getName() and getValue(), both of those must return strings.

Then, you need to create a parameter called settings_entity in your config file, it must contain the fully qualified name of your entity, e.g.

Please note that the following entry will NOT work:

That's it.

Usage

First, create a SettingsRetriever service object. Then, use its get() method with your setting name as an argument. The script will first try to get a parameter with that key from your config file. If there is none, it will try to find a DB record with name parameter equal to get() method's argument and then use getValue() on it. Otherwise, it will through a VKR\SettingsBundle\Exception\SettingNotFoundException.

Example (should be run from a controller):

API

void SettingsRetriever::__construct(Container $container, EntityManager $em)

Container and entity manager should be injected if initialized manually

string SettingsRetriever::get(string $settingName, bool $suppressErrors=false)

If the second argument is set to true, the method will return false if the setting is not found instead of throwing an exception.

string[] SettingsRetriever::getAllFromDB()

Will try to retrieve all objects from the settings entity as a key-value array. If the entity is not set, will return empty array. This method will ignore all parameters-based settings.


All versions of settings-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
symfony/symfony Version ~2.8|~3.0
doctrine/orm Version >=2.2.3
doctrine/doctrine-bundle Version ~1.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 vkr/settings-bundle contains the following files

Loading the files please wait ...