WritableConfiguration Interface Reference

Detailed Description

Implementations of WritableConfiguration allow to change the whole or parts of the configuration and persist the changes.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 19 of file WritableConfiguration.php.

+ Inheritance diagram for WritableConfiguration:

Public Member Functions

 isEditable ($section)
 
 isModified ()
 
 createSection ($section)
 
 removeSection ($section)
 
 renameSection ($oldname, $newname)
 
 setValue ($key, $value, $section, $createSection=true)
 
 removeKey ($key, $section)
 
 renameKey ($oldname, $newname, $section)
 
 writeConfiguration ($name)
 

Member Function Documentation

isEditable (   $section)

Check if a section is editable.

Parameters
$sectionThe name of the section.
Returns
Boolean

Implemented in InifileConfiguration.

isModified ( )

Check if the configuration is modified.

Returns
Boolean

Implemented in InifileConfiguration.

createSection (   $section)

Create a section.

Parameters
$sectionThe name of the section (will be trimmed).
Exceptions
IllegalArgumentExceptionif section exists or the name is empty

Implemented in InifileConfiguration.

removeSection (   $section)

Remove a section.

Parameters
$sectionThe name of the section.
Exceptions
IllegalArgumentExceptionif section is not editable

Implemented in InifileConfiguration.

renameSection (   $oldname,
  $newname 
)

Rename a section.

Parameters
$oldnameThe name of the section.
$newnameThe new name of the section (will be trimmed).
Exceptions
IllegalArgumentExceptionif old section does not exist or is not editable, if new section already exists or name is empty

Implemented in InifileConfiguration.

setValue (   $key,
  $value,
  $section,
  $createSection = true 
)

Create a key/value pair in a section.

Parameters
$keyThe name of the key (will be trimmed).
$valueThe value of the key.
$sectionThe name of the section.
$createSectionThe name of the section.
Exceptions
IllegalArgumentExceptionif section does not exist and should not be created or is not editable or key is empty

Implemented in InifileConfiguration.

removeKey (   $key,
  $section 
)

Remove a key from a section.

Parameters
$keyThe name of the key.
$sectionThe name of the section.
Exceptions
IllegalArgumentExceptionif section is not editable

Implemented in InifileConfiguration.

renameKey (   $oldname,
  $newname,
  $section 
)

Rename a key in a section.

Parameters
$oldnameThe name of the section.
$newnameThe new name of the section (will be trimmed).
$sectionThe name of the section.
Exceptions
IllegalArgumentExceptionif section is not editable or does not exist or the old key does not exist or the new key already exists or is empty

Implemented in InifileConfiguration.

writeConfiguration (   $name)

Persist the configuration changes.

Parameters
$nameThe name of the configuration to write.
Exceptions
IOException

Implemented in InifileConfiguration.