2017 © Pedro Peláez
 

library config

Synthesizes low-level configurations.

image

icanboogie/config

Synthesizes low-level configurations.

  • Thursday, May 25, 2017
  • by olvlvl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,896 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Config

Release Code Coverage Downloads, (*1)

An API to build low-level configuration., (*2)

This package is used by the framework ICanBoogie to configure its components., (*3)

Configurations are defined by a set of files called fragments. Builders use these fragments to build configurations. Configurations are managed by a [Config][] instance. Configurations can be cached, which cancels the cost of the builds., (*4)

Installation

composer require icanboogie/config

Configuration fragments

A configuration fragment is a PHP file returning a callable. Multiple fragments are used to build a configuration. They're usually located in "config" directories and are usually named after the config they are used to build., (*5)

Configuration provider

Configurations are read through a ConfigProvider., (*6)

The following example demonstrates how to get a configuration of class MyConfig:, (*7)

<?php

/* @var \ICanBoogie\ConfigProvider\BasicConfigProvider $config */

$my_config = $config->config_for_class(MyConfig::class);

A NoBuilderDefined exception is thrown if there is no builder defined for a configuration class., (*8)

Configuration builders

Builders are defined for each configuration., (*9)

<?php

use ICanBoogie\ConfigProvider\BasicConfigProvider;

/* @var string[] $paths */

$builders = [ MyConfig::class => MyBuilder::class ];
$config = new BasicConfigProvider($paths, builders);
$my_config = $config->config_for_class(MyConfig::class);

Caching configurations

Caching configurations removes the cost of building by reusing the result of a previous build. To enable caching, you just need to provide a cache implementing Storage., (*10)

<?php

namespace ICanBoogie;

use ICanBoogie\ConfigProvider\BasicConfigProvider;

$config = new BasicConfigProvider($paths, $builders, $cache);

Continuous Integration

The project is continuously tested by GitHub actions., (*11)

Tests Static Analysis Code Style, (*12)

Code of Conduct

This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you're expected to uphold this code., (*13)

Contributing

Please see CONTRIBUTING for details., (*14)

The Versions

25/05 2017

dev-master

9999999-dev https://icanboogie.org/

Synthesizes low-level configurations.

  Sources   Download

BSD-3-Clause

The Requires

 

config

25/05 2017

v1.2.0

1.2.0.0 https://icanboogie.org/

Synthesizes low-level configurations.

  Sources   Download

BSD-3-Clause

The Requires

 

config

26/12 2015

v1.1.0

1.1.0.0 http://icanboogie.org/

Synthesizes low-level configurations.

  Sources   Download

BSD-3-Clause

The Requires

 

config

28/01 2015

v1.0.1

1.0.1.0 http://icanboogie.org/

Synthesizes low-level configurations.

  Sources   Download

BSD-3-Clause

The Requires

 

config

20/01 2015

v1.0.0

1.0.0.0 http://icanboogie.org/

Synthesizes low-level configurations.

  Sources   Download

BSD-3-Clause

The Requires

 

config