MDL-24321 switching to stdClass in /backup/
authorPetr Skoda <skodak@moodle.org>
Tue, 21 Sep 2010 08:47:01 +0000 (08:47 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 21 Sep 2010 08:47:01 +0000 (08:47 +0000)
backup/backup_scheduled.php
backup/backupfilesedit.php
backup/backuplib.php
backup/lib.php
backup/restorelib.php
backup/util/dbops/restore_dbops.class.php

index 87ab3a1..cf396c0 100644 (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;
index 25a819c..dc27fde 100755 (executable)
@@ -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));
index a5e6128..3fa5f3d 100644 (file)
                 //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;
index ec23bf0..a256b66 100644 (file)
         //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;
     }
     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;
index 9ee0a66..cd4209f 100644 (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;
index c087fde..0711874 100644 (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;