MDL-17847 moev backup_config to config_plugin table

This commit is contained in:
skodak
2009-01-11 15:49:35 +00:00
parent db5af9346a
commit eb6a973cdf
6 changed files with 29 additions and 56 deletions
+4 -20
View File
@@ -4,30 +4,14 @@
require_once($CFG->dirroot.'/lib/uploadlib.php');
//Sets a name/value pair in backup_config table
//Sets a name/value pair in config_plugin table
function backup_set_config($name, $value) {
global $DB;
if ($DB->get_field("backup_config", "name", array("name"=>$name))) {
return $DB->set_field("backup_config", "value", $value, array("name"=>$name));
} else {
$config = new object();
$config->name = $name;
$config->value = $value;
return $DB->insert_record("backup_config", $config);
}
return set_config($name, $value, 'backup');
}
//Gets all the information from backup_config table
//Gets all the information from config_plugin table
function backup_get_config() {
global $DB;
$backup_config = null;
if ($configs = $DB->get_records("backup_config")) {
foreach ($configs as $config) {
$backup_config[$config->name] = $config->value;
}
}
$backup_config = get_config('backup');
return (object)$backup_config;
}