Skip to content

PPI v2 Configuration

dragoonis edited this page Feb 17, 2012 · 2 revisions

We require a config class to parse and merge configs from multiple files. The main app will have a config file: App/Config/site.ini

The modules aka 'extensions' shortened to 'ext' will have their own config file too. Ext/<ExtName>/Config/ext.ini

So for example:

  • Ext/Users/Config/ext.ini
  • Ext/Courses/Config/ext.ini
  • Ext/Admin/Config/ext.ini

The naming of things is open to revision.

Some key functionality points are

  • Parsing of PHP and YML for sure. Since PHP is the most pragmatic choice whereas YML is also popular and convenient.
  • Merging of the config (write access) so that extensions can have their own config file and have that part of the main application config. Perhaps an extensions job is not to be MVC but just to manipulate some config values.
  • Grouping config blocks by a key name, for example the extensions name. This means a particular extension named user can access a key from the config called auth.algorithm, then in the config it wont go global it will look at [user]->auth->algorithm.
  • When an extension is reading from the config it can choose to read a key from its local config block only, or go global to the main app's config where everything is aggregated together.