General Wikka Configuration

What do we need config files for? Why do we need additional table columns in the database?

These were the questions I had, browsing through some of the extensions for Wikka. Most time I noticed, that the config file is abused for storing settings that should be user configurable but seemingly the author hesitated to add an additional column in wikka_users -- resulting in a mere globally configurable option.

In the most extreme minimilization of file stored configuration there would only be the database access stored -- any other configuration might be stored as a wiki page. And why shouldn't we? Configuration is passive data, there's no logic inside, that requires PHP's built-in source acquisition mechanisms (include and require). We could even store the configuration in the form we have today as a wiki page and access it via the /raw page handler -- currently it's little more than a string. Actually, at the moment Wikka's configuration is stored as a PHP array, thus including it suffices to use it. This process would be a little bit more complicated if we were to use wiki config pages: First we had to access the config page and afterwards evaluate it.

But there's more benefit: Once we store Wikka's configuration as a wiki page we have almost all we need to store user configuration as a wiki page. 'Almost' because there must be some thinking about which global settings might be overridable by users and how to tell Wikka which ones are allowed to override. There are different ways of doing such:
First, Wikka would apply its own configuration then it would look for user's config. It should ever check, which settings might be overridden -- I don't trust us getting it done in a way, where such thing might not happen :-).

Of course, Wikka config page should only be writable by Wikka admin, and user config pages should only be writable by admins and the corresponding user. If those pages can be read by the public might be up to admin and user.

Clean definitions

I'd suggest (completely altruistic of course ;-)) to define config pages using TypedPages.

More uses

Page specific configurations are imaginable. Currently the process of a wikka_pages row looks like:
  1. Get row
  1. Call actions/header.php
  1. Call formatters/wakka.php
    1. Call any action that resides on the requested page
    1. Check for every internal link if page exists
  1. Call actions/footer.php
  1. Send HTML output
This forbids to specify any page-specific modification of the delivered HTML page's -- and there are a lot of uses:
  1. Custom CSS
  1. Meta data:
  1. Page related JavaScript

The best about this is, that it doesn't clutter up the page source with obscure and most boring techno-babble (you know: {{action para1="obscuresetting" para2="pathtostrangefile" para3="TLA"}}) if we'd move such stuff to a dedicated page.
Comments
Comment by MasinAlDujaili
2007-03-21 09:36:15
One more idea: page specific menu bar! We could add navigational links specific to the delivered page and simply maintain such menus as a wiki page.
Comment by DarTar
2007-03-22 08:22:13
Masin, thanks for posting this.

As far as I understand you are proposing three different things:

- Store global and user configuration in the DB
This is a sensible idea that has come up several times in our discussions. I think we all agree that the current config file is a mess and it should only store the minimal information needed to run the wiki.

- Store wiki configuration in a typed page
I'm less happy with this solution. Although I see the potential of typed pages, I don't think it's a good idea in terms of performance to use admin-only wiki pages to store config settings. I'd rather use a dedicated table with a dedicated interface (an admin module) to be used within Wikka, but I don't quite see the benefits of using actual wiki pages.

- Typed pages for page specific settings
You know I like this, but I'd try to keep the different proposals on distinct pages so we can discuss them separately.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki