2017 © Pedro Peláez
 

library json-config

Read .json files as config.

image

try/json-config

Read .json files as config.

  • Monday, October 23, 2017
  • by troublete
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

json-config

Read .json files as config., (*1)

Build Status, (*2)

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), (*3)

Arguments
Argument Type Description
$path string Path to the .json file that should be read as a config.
Return

API description of the returned object., (*4)

Methods
Method Arguments Description
get($identifier, $seperator) $identifier (string)(required), $seperator (string)(default: .) Method to retrieve nested config entries more easily.
Properties
Property Type Description
$config \stdClass Property that contains the config as loaded by json_decode.

License

GPL-2.0 © Willi Eßer, (*5)

The Versions

23/10 2017

dev-master

9999999-dev

Read .json files as config.

  Sources   Download

GPL-2.0

The Requires

  • php >=7.0

 

by Willi Eßer

23/10 2017

1.0.0

1.0.0.0

Read .json files as config.

  Sources   Download

GPL-2.0

The Requires

  • php >=7.0

 

by Willi Eßer