Yii::app()->setModules()

When modules are defined in a database table,

where is the best place to call Yii::app()->setModules()?

There are probably better ways, but I usually perform those application level preps in index.php:





$app = Yii::createWebApplication($config);


// we need to set this to UTC, regardless of default timezone 

// which is only for display. UTC is what timestamps etc. are using.

Yii::app()->setTimeZone("UTC");

// Do other global app stuff..

$app->run();



comes to my mind at first, too

I blogged my simple solution, see

http://blog.mbischof.de/module-aus-datenbank-laden