/ini

Parse and dump INI files

Primary LanguagePHPMIT LicenseMIT

INI Component

The INI component loads and dumps INI configs.

The Library is PSR-1, PSR-4, PSR-12 compliant and a replacement for parse_ini_string() without limitations for nested properties.

Unit Tests have a Code Coverage of 100%!

Requirements

  • >= PHP 7.3

Dependencies

  • none

Install

composer require typomedia/ini

Usage

Parser

use Typomedia\Ini\Parser;

$ini = file_get_contents('tests/Fixtures/Array.ini'); 
$parser = new Parser();
$array = $parser->parse($ini);

Dumper

use Typomedia\Ini\Dumper;

$array = ['Section' => ['Property' => 'Value']]; 
$dumper = new Dumper();
$ini = $dumper->dump($array);