As far as i can see, from what i tested, your issue appears because you call exit() therefore, the onEndRequest event doesn’t get triggered anymore so the settings class routine never happens.
will work just fine, and it is the recommended way to end the application life cycle, because in this way any event that needs to run on application end gets triggered too.
So just switch from exit() to Yii::app()->end() and you will be fine.
How to trigger the stuff from your extension manually?
It looks like Yii end() doesn’t work out for me because it ads some unwanted characters to the file I download, so I must use exit() instead as adviced elsewhere on forum. So I need to trigger some stuff from your extension. An Event maybe?
Please tell me what exactly do you want to trigger, so that i know what event handlers to add.
It’s pretty odd that you have problems with end() method, that method only raises the events binded to the onEndRequest event handler, so beside my extension, is it possible that you have other one that uses that event handler and triggers your problem ? (just wondering, no need to answer)