2017 © Pedro Peláez
 

library write-ini-file

Write-ini-file php library for create, remove, erase, add, and update ini file

image

magicalex/write-ini-file

Write-ini-file php library for create, remove, erase, add, and update ini file

  • Tuesday, March 21, 2017
  • by magicalex
  • Repository
  • 2 Watchers
  • 9 Stars
  • 57,742 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 7 Versions
  • 17 % Grown

The README.md

WriteiniFile

Write-ini-file php library for create, remove, erase, add, and update ini file., (*1)

Build Status Coverage Status StyleCI Latest Stable Version Total Downloads License, (*2)

Installation

Use composer for install magicalex/write-ini-file., (*3)

composer require magicalex/write-ini-file

Usage

<?php

require_once 'vendor/autoload.php';

use \WriteiniFile\WriteiniFile;
use \WriteiniFile\ReadiniFile;

$data = [
    'fruit' => ['orange' => '100g', 'fraise' => '10g'],
    'legume' => ['haricot' => '20g', 'oignon' => '100g'],
    'jus' => ['orange' => '1L', 'pomme' => '1,5L', 'pamplemousse' => '0,5L'],
];

// demo create ini file
$file = new WriteiniFile('file.ini');
$file
    ->create($data)
    ->add(['music' => ['rap' => true, 'rock' => false]])
    ->rm(['jus' => ['pomme' => '1,5L']])
    ->update(['fruit' => ['orange' => '200g']])
    ->write();

echo '

'.file_get_contents('file.ini').'
'; /* output file.ini [fruit] orange=200g fraise=10g [legume] haricot=20g oignon=100g [jus] orange=1L pamplemousse=0,5L [music] rap=true rock=false */ // Just read a file ini var_dump(ReadiniFile::get('file.ini')); /* output array(4) { 'fruit' => array(2) { 'orange' => string(4) "200g" 'fraise' => string(3) "10g" } 'legume' => array(2) { 'haricot' => string(3) "20g" 'oignon' => string(4) "100g" } 'jus' => array(2) { 'orange' => string(2) "1L" 'pamplemousse' => string(4) "0,5L" } 'music' => array(2) { 'rap' => string(4) "true" 'rock' => string(5) "false" } } */ $erase = (new WriteiniFile('file.ini'))->erase()->write(); // file.ini -> empty

Contributing

To run the unit tests:, (*4)

composer install
php vendor/bin/phpunit # or use: composer run-script test

License

WriteiniFile is released under the GNU General Public License v3.0, (*5)

The Versions

21/03 2017

dev-master

9999999-dev https://github.com/Magicalex/WriteIniFile

Write-ini-file php library for create, remove, erase, add, and update ini file

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6.0

 

The Development Requires

by Avatar magicalex

write file ini write_ini_file

21/03 2017

v1.2.3

1.2.3.0 https://github.com/Magicalex/WriteIniFile

Write-ini-file php library for create, remove, erase, add, and update ini file

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6.0

 

The Development Requires

by Avatar magicalex

write file ini write_ini_file

14/03 2017

v1.2.2

1.2.2.0 https://github.com/Magicalex/WriteIniFile

Write-ini-file php library for create, remove, erase, add, and update ini file

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6.0

 

The Development Requires

by Avatar magicalex

write file ini write_ini_file

14/03 2017

v1.2.1

1.2.1.0 https://github.com/Magicalex/WriteIniFile

Write-ini-file php library for create, remove, erase, add, and update ini file

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6.0

 

The Development Requires

by Avatar magicalex

write file ini write_ini_file

17/05 2016

v1.2.0

1.2.0.0 https://github.com/Magicalex/WriteIniFile

Write-ini-file php library for create, remove, erase, add, and update ini file

  Sources   Download

GPL-3.0

The Requires

  • php >=5.6.0

 

The Development Requires

by Avatar magicalex

write file ini write_ini_file

08/06 2015

v1.1.0

1.1.0.0 https://github.com/Magicalex/WriteIniFile

WriteIniFile php library for create, erase and update file ini

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0

 

The Development Requires

by Avatar magicalex

write file ini write_ini_file

07/06 2015

v1.0.0

1.0.0.0 https://github.com/Magicalex/WriteIniFile

WriteIniFile php library for create, erase and update file ini

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0

 

by Avatar magicalex

write file ini write_ini_file