dev-master
9999999-devA PHP implementation of Hiera
MIT
The Requires
config feature flags hiera hierarchical database
Wallogit.com
2017 © Pedro Peláez
A PHP implementation of Hiera
According to the Hiera website:, (*1)
Hiera is a key/value lookup tool for configuration data.
Hiera uses a configurable hierarchy to enable "Cascading Configuration"., (*2)
It's great for infrastructure configuration (which is why it's used in Puppet), but it also applies to multi-tenancy applications., (*3)
Hiera-PHP tries to be as much of a direct port as possible, maintaining support for original configuration files, and even internal classnames and interfaces., (*4)
hiera-php can be used both as a library, and as a console-tool, (*5)
use Hiera\Hiera;
use Hiera\Scope;
use Hiera\ConfigLoader\YamlConfigLoader;
$scope = new Scope();
$scope->setVariable('::environment', 'production');
$scope->setVariable('::clientcert', 'web01.dc1.example.webx');
$scope->setVariable('::country', 'nl');
$hiera = new Hiera();
$loader = new YamlConfigLoader();
$loader->load($hiera, $path_to_hiera_yaml_file);
$key = 'some_configuration_key';
$answer = $hiera->lookup($key, '#default#', $scope);
vendor/bin/hiera-php hiera:lookup some_configuration_key
hiera.yaml filesContributions are very welcome!, (*6)
MIT (see LICENSE.md), (*7)

Check out our other projects at linkorb.com/engineering., (*8)
Btw, we're hiring!, (*9)
A PHP implementation of Hiera
MIT
config feature flags hiera hierarchical database