2017 © Pedro Peláez
 

library advini

Advanced INI reader

image

nimayneb/advini

Advanced INI reader

  • Monday, September 4, 2017
  • by nimayneb
  • Repository
  • 1 Watchers
  • 1 Stars
  • 235 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 25 Versions
  • 1 % Grown

The README.md

PHP Advini

Advanced INI file reader for PHP., (*1)

Problem:, (*2)

You cannot define and read deeper array structures with internal "parse_ini_file" implementation:, (*3)

[group1]
property1 = value1
property2 = value2
property3 = value3

[group2]
property1 = value1
property2 = value2
property3 = value3

"Advini" extends the internal "parse_ini_file" with several ingredients., (*4)

It supports:, (*5)

  • defining complex keys and sections, (*6)

    category/property = value
    
  • importing any INI file, (*7)

    property = @import[ default.ini ]
    
  • including constants (from INI file), (*8)

    property = << key >> 
    
  • calling methods before setting, (*9)

    property:sha1 = geheim1234 
    

Defining complex keys and sections

Usage:, (*10)

[{key1}/{key2}(...)]
key3/key4(...) = value

PHP:, (*11)

use JBR\Advini\Advini;

$ini = new Advini();

$configuration = $ini->getFromFile("local.ini");
var_dump($configuration);

INI:, (*12)

[category/subcategory]
key = value

Resulted output:, (*13)

array(
    "category" => array(
        "subcategory" => array(
            "key" => "value"
        )
    )
)

Importing any INI file

Usage:, (*14)

{key} = @import[ [file] ]

PHP:, (*15)

use JBR\Advini\Advini;

$ini = new Advini();
$configuration = $ini->getFromFile("local.ini");
var_dump($configuration);

INI "local.ini":, (*16)

category = @import[ import.ini ]

INI "import.ini":, (*17)

[subcategory]
key = value

Resulted output:, (*18)

array(
    "category" => array(
        "subcategory" => array(
            "key" => "value"
        )
    )
)

Including constants

Usage:, (*19)

{key} = << [constant] >>

PHP:, (*20)

use JBR\Advini\Advini;
use JBR\Advini\Instructor\ConstantInstructor;

$ini = new Advini();
$const = $ini->getInstructor(ConstantInstructor::class);
$const->setConstantsFromFile("constants.ini");
$configuration = $ini->getFromFile("local.ini");
var_dump($configuration);

INI "constants.ini":, (*21)

[category/subcategory]
key = value

INI "local.ini":, (*22)

[category/subcategory]
key = << key >>

Resulted output:, (*23)

array(
    "category" => array(
        "subcategory" => array(
            "key" => "value"
        )
    )
)

Calling methods before setting

Usage:, (*24)

{key}:{method}(...) = {value}

PHP:, (*25)

use JBR\Advini\Advini;
use JBR\Advini\Methods\Base;

$ini = new Advini(new Base());

try {
    $configuration = $ini->getFromFile("local.ini");
    var_dump($configuration);
} catch (AdviniException $e) {
    echo $e->getMessage();
}

INI "local.ini":, (*26)

[category/subcategory]
key1:integer = "foobar"
key2:string = 123
key3:md5 = "secret"

Resulted output:, (*27)

array(
    "category" => array(
        "subcategory" => array(
            "key1" => 0,
            "key2" => "123",
            "key3" => "5ebe2294ecd0e0f08eab7690d2a6ee69"
        )
    )
)

Or calling by sections:, (*28)

Usage:, (*29)

[{section}:{method}]
{key} = {value}

INI "local.ini":, (*30)

[category/subcategory:serialize]
key1:integer = "foobar"
key2:string = 123
key3:md5 = "secret"

Resulted output:, (*31)

array(
    "category" => array(
        "subcategory" => "a:3:{s:4:"key1";i:0;s:4:"key2";s:3:"123";s:4:"key3";s:32:"5ebe2294ecd0e0f08eab7690d2a6ee69";}"
    )
)

The Versions

04/09 2017

dev-master

9999999-dev https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • ext-mbstring *
  • php ~7.1.0

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

04/09 2017

2.0.1

2.0.1.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php ~7.1.0
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

31/08 2017

2.0.0

2.0.0.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php ~7.1.0
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

07/07 2017

1.6.0

1.6.0.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

20/04 2017

1.5.10

1.5.10.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

14/02 2017

1.5.9

1.5.9.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

14/02 2017

1.5.8

1.5.8.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

12/01 2017

1.5.7

1.5.7.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

26/10 2016

1.5.6

1.5.6.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

19/09 2016

1.5.5

1.5.5.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

19/09 2016

1.5.4

1.5.4.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

29/08 2016

1.5.3

1.5.3.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

29/08 2016

1.5.2

1.5.2.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

12/08 2016

1.5.1

1.5.1.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

29/01 2016

1.5.0

1.5.0.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

26/01 2016

dev-ADVINI_1-3

dev-ADVINI_1-3 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

26/01 2016

1.3.0

1.3.0.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Requires

  • php >5.4.10
  • ext-mbstring *

 

The Development Requires

settings configuration array advanced extract reader multi initialize expand

21/01 2016

dev-ADVINI_1-2

dev-ADVINI_1-2 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced extract reader multi initialize expand

21/01 2016

1.2.0

1.2.0.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced extract reader multi initialize expand

18/01 2016

dev-ADVINI_1-1

dev-ADVINI_1-1 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced extract reader multi initialize expand

18/01 2016

1.1.3

1.1.3.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced extract reader multi initialize expand

18/01 2016

1.1.2

1.1.2.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced extract reader multi initialize expand

17/01 2016

1.1.1

1.1.1.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced extract reader multi initialize expand

17/01 2016

dev-ADVINI_1-0

dev-ADVINI_1-0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced value reader multi initialize expand

17/01 2016

1.0.0

1.0.0.0 https://github.com/nimayneb/advini

Advanced INI reader

  Sources   Download

BSD-3-Clause

The Development Requires

settings configuration array advanced value reader multi initialize expand