WritableConfiguration Interface Reference
Detailed Description
Implementations of WritableConfiguration allow to change the whole or parts of the configuration and persist the changes.
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()
isEditable | ( | $section | ) |
Check if a section is editable.
- Parameters
-
$section The name of the section.
- Returns
- Boolean
Implemented in InifileConfiguration.
◆ isModified()
isModified | ( | ) |
◆ createSection()
createSection | ( | $section | ) |
Create a section.
- Parameters
-
$section The name of the section (will be trimmed).
- Exceptions
-
IllegalArgumentException if section exists or the name is empty
Implemented in InifileConfiguration.
◆ removeSection()
removeSection | ( | $section | ) |
Remove a section.
- Parameters
-
$section The name of the section.
- Exceptions
-
IllegalArgumentException if section is not editable
Implemented in InifileConfiguration.
◆ renameSection()
renameSection | ( | $oldname, | |
$newname | |||
) |
Rename a section.
- Parameters
-
$oldname The name of the section. $newname The new name of the section (will be trimmed).
- Exceptions
-
IllegalArgumentException if old section does not exist or is not editable, if new section already exists or name is empty
Implemented in InifileConfiguration.
◆ setValue()
setValue | ( | $key, | |
$value, | |||
$section, | |||
$createSection = true |
|||
) |
Create a key/value pair in a section.
- Parameters
-
$key The name of the key (will be trimmed). $value The value of the key. $section The name of the section. $createSection The name of the section.
- Exceptions
-
IllegalArgumentException if section does not exist and should not be created or is not editable or key is empty
Implemented in InifileConfiguration.
◆ removeKey()
removeKey | ( | $key, | |
$section | |||
) |
Remove a key from a section.
- Parameters
-
$key The name of the key. $section The name of the section.
- Exceptions
-
IllegalArgumentException if section is not editable
Implemented in InifileConfiguration.
◆ renameKey()
renameKey | ( | $oldname, | |
$newname, | |||
$section | |||
) |
Rename a key in a section.
- Parameters
-
$oldname The name of the section. $newname The new name of the section (will be trimmed). $section The name of the section.
- Exceptions
-
IllegalArgumentException if 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()
writeConfiguration | ( | $name | ) |
Persist the configuration changes.
- Parameters
-
$name The name of the configuration to write.
- Exceptions
-
IOException
Implemented in InifileConfiguration.