MidgardConfigFile

Posted on 2006-01-04 20:15:48 EET.

Yeah, MidgardConfigFile is the new configuration directive for midgard-apache2 module. Takes only one argument. Filename.
Full path is defined by prefix used while midgard-core was compiled.

In my case I compiled midgard-core with prefix --prefix=/usr , so this file is located in /etc/midgard/conf.d directory.

This is smallest Midgard vhost configuration I have ever used:


ServerName ppmobile
DocumentRoot /var/lib/midgard/vhosts/ppmobile/8888
MidgardPageCacheDir /var/cache/midgard
MidgardConfigFile piotras
AddDefaultCharset utf-8
Quite huge? ;)

I am not going to explain midgard configuration file because it has every directive described and besides every directive is self explanatory.

Interesting thing is that I had to rewrite configuration file "handler" and make it fully OO.

Advantages:
  • midgard-java or midgard-php bindings will be even easier to make.
  • Internal functions like mgd_connect or midgard_get_database_connection may be methods of MidgardConnection object and take MidgardConfig object as parameter. Notice that data like username or password could be hidden even for midgard-core API!
  • MidgardConfig object can be used as global runtime loghandler, Gerror handler, etc, etc.
Disadvantages:
  • none
( Except the fact that some day we have to drop midgard *mgd structure and change API a bit ;)

MidgardConfigFile automagically sets midgard-root file and Midgard engine.
Unfortunatelly this can not be done in midgard-apache1 module ( or I couldn't find DEFAULT_EXP_LIBEXECDIR for Apache1 ).

Back

Layout Copyright © 2006 Finnish Teleservice Center Ltd Oy - Site Powered by Midgard CMS