2017 © Pedro Peláez
 

library preconfig

This is a port of Namshi/reconfig from JS to PHP

image

namshi/preconfig

This is a port of Namshi/reconfig from JS to PHP

  • Tuesday, September 2, 2014
  • by geshan
  • Repository
  • 17 Watchers
  • 2 Stars
  • 125 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

NAMSHI | PreConfig

Build Status, (*1)

In PHP handling configs even as array is not easy, when you need to reference related configs or replace strings in configs it is not straightforward. This library will help you define configurations in clean, decoupled and smart way resulting in easy retrieval of configuration values. How? read on., (*2)

This library is a PHP port of Namshi/Reconfig javascript library., (*3)

Prerequisites

This library needs PHP 5.4+., (*4)

It has been tested using PHP5.4 to PHP5.6 and HHVM., (*5)

Installation

You can install the library directly with composer:, (*6)

"namshi/preconfig": "0.1.0"

Usage

A simple example is given below:, (*7)

Access a multi-dimensional array

namespace Your\Namespace

use Namshi\PreConfig\PreConfig;

public function foo()
{
    $argument = [
                'key1' => [
                    'key2' => '{{ key1.key3 }}',
                    'key3' => [
                        'key4' => 'value4',
                        'key5' => 'value5'
                    ]
                ]
            ];

    $preConfig = new PreConfig($argument);

    $key3 = $preConfig->get('key1.key3');
}

You can see more examples in the example file., (*8)

Tests

We used phpspec to write tests. They are more like specs than just tests. You will need composer to get the dependencies, to run tests locally, execute the following commands:, (*9)


ᐅ composer install --dev --prefer-source ᐅ php vendor/bin/phpspec run

Feedback

Add an issue, open a PR, drop us an email! We would love to hear from you!, (*10)

The Versions

02/09 2014

dev-master

9999999-dev

This is a port of Namshi/reconfig from JS to PHP

  Sources   Download

MIT

The Development Requires

by Geshan Manandhar
by Ayham Alzoubi

02/09 2014

0.1.0

0.1.0.0

This is a port of Namshi/reconfig from JS to PHP

  Sources   Download

MIT

The Development Requires

by Geshan Manandhar
by Ayham Alzoubi