try/json-config

Read .json files as config.

1.0.0 2017-10-23 11:46 UTC

This package is not auto-updated.

Last update: 2025-01-05 06:23:40 UTC


README

Read .json files as config.

Build Status

Install

$ composer require try/json-config

Usage

<?php
require_once '/path/to/autoload.php';

use function TryPhp\jsonConfig;

$config = jsonConfig(__DIR__ . '/some.json');
$somethingNested = $config->get('first_lvl.second_lvl.value');

API

Functions

jsonConfig($path)

Function to load an return a .json file as accessable config. (Will return a class@anonymous object)

Arguments
Return

API description of the returned object.

Methods
Properties

License

GPL-2.0 © Willi Eßer