PHP code example of nimayneb / advini

1. Go to this page and download the library: Download nimayneb/advini library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nimayneb / advini example snippets


use JBR\Advini\Advini;

$ini = new Advini();

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

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

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);

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
	property:sha1 = geheim1234 
	
text
array(
    "category" => array(
        "subcategory" => array(
            "key" => "value"
        )
    )
)
text
array(
    "category" => array(
        "subcategory" => array(
            "key" => "value"
        )
    )
)
text
array(
    "category" => array(
        "subcategory" => array(
            "key" => "value"
        )
    )
)
text
array(
    "category" => array(
        "subcategory" => array(
            "key1" => 0,
            "key2" => "123",
            "key3" => "5ebe2294ecd0e0f08eab7690d2a6ee69"
        )
    )
)