2017 © Pedro Peláez
 

library config

ItalyStrap configuration class for easily config object

image

italystrap/config

ItalyStrap configuration class for easily config object

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ItalyStrap Config API

Build status Latest Stable Version Total Downloads Latest Unstable Version License PHP from Packagist, (*1)

ItalyStrap Config Module - a simple and useful configuration package the OOP way, (*2)

Table Of Contents

Installation

The best way to use this package is through Composer:, (*3)

composer require italystrap/config

Documentation

Deprecation

List of all deprecated method that will be removed in the next major release (v3.x):, (*4)

  • Config::push() => Config::set()
  • Config::add() => Config::set()
  • Config::remove() => Config::delete()
  • Config::all() => Config::toArray()
  • Config::toJson() => (string)\json_encode(new Config(), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
  • ConfigThemeMods::class => No replacement class is provided
  • ConfigThemeModTest::class => No replacement class is provided
  • Config_Factory::class => ConfigFactory::class
  • Config_Interface::class => ConfigInterface::class
  • Move \JsonSerializable at the ConfigInterface::class level
  • The second parameter of Config::__construct() is deprecated and will be removed in the next major release, the first parameter is now the default value used for the configuration, to add additional configuration you can use the Config::merge() method like in the example below:
$defaultData = [
    'key'   => 'value',
];

$additionalData = [
    'key'   => 'new value',
];

$config = (new Config($defaultData))->merge($additionalData);
  • The static method ConfigFactory::make() will be converted to a non-static, so you will need to instantiate the class to use it, like in the example below:
$config = new ConfigFactory();
$config->make($data);

Contributing

All feedback / bug reports / pull requests are welcome., (*5)

License

Copyright (c) 2019 Enea Overclokk, ItalyStrap, (*6)

This code is licensed under the MIT., (*7)

Credits

Ideas for the Config::class from: - Tonya Mork - Alain Schlesser, (*8)

For the Notation Array Search: - https://github.com/balambasik/input/blob/master/src/Input.php, (*9)

For the traverse method: - Nikita Popov, (*10)

For some ideas: - ChatGPT, (*11)

The Versions

06/05 2018

dev-master

9999999-dev

ItalyStrap configuration class for easily config object

  Sources   Download

GPL-2.0-or-later

06/05 2018

0.0.1-alpha

0.0.1.0-alpha

ItalyStrap configuration class for easily config object

  Sources   Download

GPL-2.0-or-later