Since Corrade re-reads the configuration file Corrade.ini
every time it is changed, we can write a script that will allow us to dynamically add and remove groups to the configuration file. It can be part of a larger system where you can open Corrade instances dynamically and allow them to be configured from a web-page.
The project does not need any special Corrade settings - this is due to the fact that the script manipulates the Corrade.ini
configuration file directly. On the other hand, the config.php
script defines a path to the Corrade.ini
that the script will act upon.
Perhaps the most important thing to understand is that the Corrade configuration file is a standardised XML file that can be read conveniently from PHP, converted into an object, and then groups can be added and removed by using object accessors very elegantly without actually having to manually read-in the XML and edit it.
Furthermore, by doing it this way, you make sure that your script will be compatible with any futher changes to Corrade's configuration file Corrade.ini
.