2017 © Pedro Peláez
 

library config

Config environment to xervice components

image

xervice/config

Config environment to xervice components

  • Tuesday, July 24, 2018
  • by mibexx
  • Repository
  • 1 Watchers
  • 0 Stars
  • 865 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 1118 % Grown

The README.md

Scrutinizer Code Quality Code Coverage Build Status, (*1)

Config loader for Xervice services., (*2)

Installation

composer require xervice/config

Configuration

  1. Add a config directory to your root path
  2. In there you have different config files parsed in this order:
    • config_default.php
    • config_.php
    • config__.php
    • config_local.php
    • (additional config files defined in previous config file)

APPLICATION_ENV is a environment variable. The default value is "production". APPLICATION_SCOPE is a environment variable. The default value is "main"., (*3)

To add additional config files you can add them to your config_default:, (*4)

$config[\Xervice\Config\XerviceConfig::ADDITIONAL_CONFIG_FILES] = [
    __DIR__ . '/addition_config.php'
];

If you want to change the config-directory, you can set the environment variable CONFIG_PATH. If no CONFIG_PATH is defined, it will look under the environment variable /config. If no APPLICATION_PATH is defined, it will look in the current workdir., (*5)

Usage

$configProvider = new XerviceConfig(new XerviceConfigFactory());
$config = $configProvider->getConfig();

$value = $config->get('CONFIG_KEY');

$valueWithDefault = $config->get('CONFIG_KEY', 'defaultvalue');


// Or with the static method way
$configProvider = XerviceConfig::getInstance();
$config = $configProvider->getConfig();

...

// Or direct static access
XerviceConfig::set('key', 'value');
XerviceConfig::get('key'); // value

The Versions

24/07 2018

dev-master

9999999-dev

Config environment to xervice components

  Sources   Download

MIT

The Development Requires

by Mike Bertram

24/07 2018

2.1.0

2.1.0.0

Config environment to xervice components

  Sources   Download

MIT

The Development Requires

by Mike Bertram

13/07 2018

2.0.0

2.0.0.0

Config environment to xervice components

  Sources   Download

MIT

The Development Requires

by Mike Bertram

09/07 2018

1.0.1

1.0.1.0

Config environment to xervice components

  Sources   Download

MIT

The Development Requires

by Mike Bertram

05/07 2018

1.0.0

1.0.0.0

Config environment to xervice components

  Sources   Download

MIT

The Development Requires

by Mike Bertram