General developer forum
1. I'm not really sure what cache you are wanting to disable - when using that function on a settings page, saving the form will clear the cache.
2. If you want to insert a record in config_plugins, then call set_config('setting name', 'value', 'mypluginname') - don't insert directly in the database as that will break the caching of variables.
Thanks for your reply .
for the first part i must say , i manually update it (configtext) field in DB , and when i check the field in setting , its still show previous data which is belong cache , (when i purge cache , will be fine), as i need to update a field , is that any method to update like "set_config" as you have said for inserting?
so what ,if we want to update a record?
let say when we insert a setting by text field [admin_setting_configtext] , since we dont change first argument of this method , it will update same record, so let say i want to do same thing in the code, instead of inserting , just updating the record ? does moodle provide any function? otherwise i should manually update and clear cache.
I'm not really sure how many other ways I can put this.
If you want to insert / update / delete a record in mdl_config_plugins, use set_config() - don't manually access that DB table as this will mean the cache will be out of date.
You can look at the code for it if you really want - it's all available here: https://github.com/moodle/moodle/blob/master/lib/moodlelib.php#L1383
As you can clearly see from the code - if there is no entry for that config setting, then a new record will be inserted, if there is an existing value, then it will be updated and if the value you are setting is null, then the existing record will be deleted or not inserted (as appropriate).