# IniFileConfig

Class for reading/writing ini config file

This preserves comments etc, unlike parse_ini_file and is based heavily on a solution provided at: stackoverflow.com/questions/9594238/good-php-classes-that-manipulate-ini-files

category | Tasks
package | phing.tasks.ext
author | Ken Guest kguest@php.net
license | LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
link | http://www.phing.info/

### Methods

## Get value of given key in specified section

    get(string $section, string $key) : void

### Arguments

#### $section

`string`

Section

#### $key

`string`

Key

## Read ini file

    read(string $file) : void

### Arguments

#### $file

`string`

filename

## Remove key/section from file.

    remove(string $section, string $key) : void

If key is not specified, then the entire section will be removed.

### Arguments

#### $section

`string`

Section to manipulate/remove

#### $key

`string`

Name of key to remove, might be null/empty

## Set key to value in specified section

    set(string $section, string $key, string $value) : void

### Arguments

#### $section

`string`

Section

#### $key

`string`

Key

#### $value

`string`

Value

## Write contents out to file

    write(string $file) : void

### Arguments

#### $file

`string`

filename

### Properties

## Lines of ini file

    lines : array

var |

### Type(s)

`array`