ytake/hh-config-aggregator

Aggregate and merge configuration

0.10.0 2020-06-26 06:10 UTC

This package is auto-updated.

Last update: 2021-03-26 07:43:22 UTC


README

Build Status

Aggregates and merges configuration, Supports caching for fast bootstrap in production environments.

zendframework/zend-config-aggregator converted for hack

Installation

$ composer require ytake/hh-config-aggregator

Usage

use type Ytake\HHConfigAggreagator\ArrayProvider;
use type Ytake\HHConfigAggreagator\ConfigAggreagator;
use type Ytake\HHConfigAggreagator\PhpFileProvider;

$aggregator = new ConfigAggreagator(
  vec[
    new PhpFileProvider(
      __DIR__.'/resources/config/{{,*.}global,{,*.}local}.{hack,hackpartial}',
    ),
    new ArrayProvider(['config_cache_enabled' => true])
  ],
  __DIR__.'/resources/cached.config.cache.hackpartial'
);
$aggregator->getMergedConfig();