Parse and dump INI files

1.1.0 2022-11-02 18:46 UTC

This package is auto-updated.

Last update: 2024-03-30 00:19:22 UTC


README

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