MDL-24321 switching to stdClass in /backup/

This commit is contained in:
Petr Skoda 2010-09-21 08:47:01 +00:00
parent a226a972f7
commit e894efc31c
6 changed files with 12 additions and 12 deletions

View File

@ -201,7 +201,7 @@ function schedule_backup_cron() {
$subject = $prefix.get_string("scheduledbackupstatus");
//Send the message
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = $admin;
$eventdata->userto = $admin;

View File

@ -50,7 +50,7 @@ $PAGE->set_heading(get_string('managefiles', 'backup'));
$PAGE->set_pagelayout('admin');
$browser = get_file_browser();
$data = new object();
$data = new stdClass();
$options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
file_prepare_standard_filemanager($data, 'files', $options, $filecontext, $component, $filearea, 0);
$form = new backup_files_edit_form(null, array('data'=>$data, 'contextid'=>$contextid, 'currentcontext'=>$currentcontext, 'filearea'=>$filearea, 'component'=>$component, 'returnurl'=>$returnurl));

View File

@ -232,7 +232,7 @@
//Check it isn't backupdata_dir
if (strpos($dir,$backupdata_dir)!==0) {
//Insert them into backup_files
$file = new object();
$file = new stdClass();
$file->backup_code = $backup_unique_code;
$file->file_type = 'course';
$file->path = $dir;

View File

@ -358,7 +358,7 @@
//Now, insert the record
if ($status) {
//Build the record
$rec = new object();
$rec = new stdClass();
$rec->backup_code = $backup_unique_code;
$rec->table_name = $table;
$rec->old_id = $old_id;
@ -820,7 +820,7 @@
}
function add_to_backup_log($starttime,$courseid,$message, $backuptype) {
global $DB;
$log = new object();
$log = new stdClass();
$log->courseid = $courseid;
$log->time = time();
$log->laststarttime = $starttime;

View File

@ -191,7 +191,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
$data = backup_getid($restore->backup_unique_code,'grade_letters',$rec->old_id);
if ($data) {
$info = $data->info;
$dbrec = new object();
$dbrec = new stdClass();
$dbrec->contextid = $context->id;
$dbrec->lowerboundary = backup_todb($info['GRADE_LETTER']['#']['LOWERBOUNDARY']['0']['#']);
$dbrec->letter = backup_todb($info['GRADE_LETTER']['#']['LETTER']['0']['#']);
@ -315,7 +315,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
continue;
}
$dbrec = new object();
$dbrec = new stdClass();
$dbrec->courseid = $restore->course_id;
$dbrec->itemtype = backup_todb($info['GRADE_ITEM']['#']['ITEMTYPE']['0']['#'], false);
@ -939,7 +939,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
//Now build the MESSAGE record structure
$dbrec = new object();
$dbrec = new stdClass();
$dbrec->useridfrom = backup_todb($info['MESSAGE']['#']['USERIDFROM']['0']['#']);
$dbrec->useridto = backup_todb($info['MESSAGE']['#']['USERIDTO']['0']['#']);
$dbrec->message = backup_todb($info['MESSAGE']['#']['MESSAGE']['0']['#']);
@ -1163,7 +1163,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
//Now build the BLOG record structure
$dbrec = new object();
$dbrec = new stdClass();
$dbrec->module = backup_todb($info['BLOG']['#']['MODULE']['0']['#']);
$dbrec->userid = backup_todb($info['BLOG']['#']['USERID']['0']['#']);
$dbrec->courseid = backup_todb($info['BLOG']['#']['COURSEID']['0']['#']);
@ -1451,7 +1451,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
//print_object ($GLOBALS['traverse_array']); //Debug
//$GLOBALS['traverse_array']=""; //Debug
//Now build the LOG record structure
$dblog = new object();
$dblog = new stdClass();
$dblog->time = backup_todb($info['LOG']['#']['TIME']['0']['#']);
$dblog->userid = backup_todb($info['LOG']['#']['USERID']['0']['#']);
$dblog->ip = backup_todb($info['LOG']['#']['IP']['0']['#']);
@ -1957,7 +1957,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
//We compare Moodle's versions
if ($status && $CFG->version < $info->backup_moodle_version) {
$message = new object();
$message = new stdClass();
$message->serverversion = $CFG->version;
$message->serverrelease = $CFG->release;
$message->backupversion = $info->backup_moodle_version;

View File

@ -434,7 +434,7 @@ abstract class restore_dbops {
if ($udata->field_data) {
if ($field = $DB->get_record('user_info_field', array('shortname'=>$udata->field_name, 'datatype'=>$udata->field_type))) {
/// Insert the user_custom_profile_field
$rec = new object();
$rec = new stdClass();
$rec->userid = $newuserid;
$rec->fieldid = $field->id;
$rec->data = $udata->field_data;