How to extend CWebApplication component?


I want to preload website settings model from database to $settings property of CWebApplication(Yii::app()),

so i could access and manipulate it like so Yii::app()->settings->getAttribute(…), Yii::app()->settings->setAttribute(…), Yii::app()->settings->save() and so on…

To do that i need to extend from CWebApplication, and somehow tell Yii to use my extended class instead of Yiis core.

Any ideas on how to do that?