[extension]Settings

@Pentium10 - i figured out your problem.

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.

Doing




echo Yii::app()->settings->get('system', 'email_help_form_email_to');  

        echo "\r\n";

        Yii::app()->settings->delete('system', 'email_help_form_email_to');  

        //Yii::app()->settings->deleteCache();

        echo Yii::app()->settings->get('system', 'email_help_form_email_to');  

        echo "\r\n";

        Yii::app()->end();



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)

@twisted1919

Thank you for the Settings extension. It has proved to be very useful.

@Gustavo

The model class SettingsModel comes in handy, too! I say thank you to you as well.

bilijen

Some other extensions adds some stuff we do not need, you assumption was correct.

However I took that out, and still no luck to delete key’s from the database, if running in a console app.