Feature Wiki

Information about planned and released features

Tabs

Modern Configuration File Format

1 Requirements

Ilias currently uses configuration files in INI-Format, which offers sections and variables. Nothing more. They are placed inside the webroot and protected by a php-code-snippet <?php die(); ?>.
 
More flexible approaches allow nested sectionsarrays. The list of possible formats is long:
- yaml
- json
- xml
- php
- ...
 
Switching to a more flexible format with nesting would allow much better structure in configuration options.
 
I suggest yaml/json/xml for everything that is supposed to be changed by ILIAS. My favorite is YAML, because it is very clean and free of clutter.
 
Use-Cases:
1. One major use case is customizations which are often configured (and thus limited) by ini-settings. As a workaround we already used to nest a json-string into the ini-file - but that is not really intuitive and needs two levels of interpretation in ILIAS.
 
2. Another use case would be better abstraction of ILIAS initialization with Service Factories and/or a Dependency-Injection-Container: A Service-Factory could then just expect to receive its own configuration-array with arbitrary complex sub-structure.
 
--
 
Optional

  • Move configuration files outside of directories generally accessible via web (e.g. /ilias.ini.php --> /config/ilias.yaml)
  • have new custom config-files (global- and client-level), e.g.:
    • ilias-custom.yaml (for manual editing)
    • ilias-setup.yaml (generated by setup) - overwrites custom-settings
    • clients/xxx/client-custom.yaml (for manual editing) - overwrites global-settings
    • clients/xxx/client-setup.yaml (generated by setup) - overwrites custom-settings
Note: Zend Framework offers a library to merge nested arrays, which is very nice for such hierarchies of configuration files.

YAML Example

--- !clarkevans.com/^invoice
invoice: 34843
date : 2001-01-23
bill-to: &id001
given : Chris
family : Dumars
address:
lines: |
458 Walkman Dr.
Suite #292
city : Royal Oak
state : MI
postal : 48046
ship-to: *id001
product:
- sku : BL394D
quantity : 4
description : Basketball
price : 450.00
- sku : BL4438H
quantity : 1
description : Super Hoop
price : 2392.00
tax : 251.42
total: 4443.52

JSON Example

{
"invoice": 34843,
"date": "2001-01-23T00:00:00.000Z",
"bill-to": {
"given": "Chris",
"family": "Dumars",
"address": {
"lines": "458 Walkman Dr.\nSuite #292\n",
"city": "Royal Oak",
"state": "MI",
"postal": 48046
}
},
"ship-to": {
"given": "Chris",
"family": "Dumars",
"address": {
"lines": "458 Walkman Dr.\nSuite #292\n",
"city": "Royal Oak",
"state": "MI",
"postal": 48046
}
},
"product": [
{
"sku": "BL394D",
"quantity": 4,
"description": "Basketball",
"price": 450
},
{
"sku": "BL4438H",
"quantity": 1,
"description": "Super Hoop",
"price": 2392
}
],
"tax": 251.42,
"total": 4443.52
}

XML Example

<?xml version="1.0" encoding="UTF-8" ?>
<root>
<invoice>34843</invoice>
<date>2001-01-23</date>
<bill-to>
<given>Chris</given>
<family>Dumars</family>
<address>
<lines>458 Walkman Dr.
Suite #292
</lines>
<city>Royal Oak</city>
<state>MI</state>
<postal>48046</postal>
</address>
</bill-to>
<ship-to>
<given>Chris</given>
<family>Dumars</family>
<address>
<lines>458 Walkman Dr.
Suite #292
</lines>
<city>Royal Oak</city>
<state>MI</state>
<postal>48046</postal>
</address>
</ship-to>
<product>
<sku>BL394D</sku>
<quantity>4</quantity>
<description>Basketball</description>
<price>450</price>
</product>
<product>
<sku>BL4438H</sku>
<quantity>1</quantity>
<description>Super Hoop</description>
<price>2392</price>
</product>
<tax>251.42</tax>
<total>4443.52</total>
</root>

PHP Example

<?php
$config = {
"product": [
{
"sku": "BL394D",
"price": 450.0,
"description": "Basketball",
"quantity": 4
},
{
"sku": "BL4438H",
"price": 2392.0,
"description": "Super Hoop",
"quantity": 1
}
],
"ship-to": {
"given": "Chris",
"family": "Dumars",
"address": {
"city": "Royal Oak",
"state": "MI",
"postal": 48046,
"lines": "458 Walkman Dr.\nSuite #292\n"
}
},
"bill-to": {
"given": "Chris",
"family": "Dumars",
"address": {
"city": "Royal Oak",
"state": "MI",
"postal": 48046,
"lines": "458 Walkman Dr.\nSuite #292\n"
}
},
"invoice": 34843,
"date": "2001-01-23",
"total": 4443.5200000000004,
"tax": 251.41999999999999
}

2 Status

  • Scheduled for: Not scheduled yet (will be set by Jour Fixe)
  • Funding: Required / Interest in funding: (please indicate if you are interested to fund this feature)
  • Maintainer: (will be set by Jour Fixe)
  • Implementation of the feature is done by (company, developer)
  • Contract settled: No | Fill in "Yes" if a contract is already settled and add Institution / Organisation in "Funding" row
  • Tested by / status: (name, e-mail), (status information set after implementation)

3 Additional Information

Contact the following persons if you want to know more about this feature, its implementation or funding:

  • Information about concept: (name, e-mail)
  • Information about funding: (name, e-mail)
  • Information about implementation: (name, e-mail)

4 Discussion

5 Implementation

...

Last edited: 22. Sep 2014, 20:57, Kiegel, Colin [kiegel]