當前位置: 首頁>>代碼示例>>PHP>>正文


PHP restore_controller::add_logger方法代碼示例

本文整理匯總了PHP中restore_controller::add_logger方法的典型用法代碼示例。如果您正苦於以下問題:PHP restore_controller::add_logger方法的具體用法?PHP restore_controller::add_logger怎麽用?PHP restore_controller::add_logger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在restore_controller的用法示例。


在下文中一共展示了restore_controller::add_logger方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fulldelete

 // went really wrong in backup, throw error. Note that backup::MODE_IMPORT
 // backups don't store resulting files ever
 $tempdestination = $CFG->tempdir . '/backup/' . $backupid;
 if (!file_exists($tempdestination) || !is_dir($tempdestination)) {
     print_error('unknownbackupexporterror');
     // shouldn't happen ever
 }
 // Prepare the restore controller. We don't need a UI here as we will just use what
 // ever the restore has (the user has just chosen).
 $rc = new restore_controller($backupid, $course->id, backup::INTERACTIVE_YES, backup::MODE_IMPORT, $USER->id, $restoretarget);
 // Start a progress section for the restore, which will consist of 2 steps
 // (the precheck and then the actual restore).
 $progress->start_progress('Restore process', 2);
 $rc->set_progress($progress);
 // Set logger for restore.
 $rc->add_logger($logger);
 // Convert the backup if required.... it should NEVER happed
 if ($rc->get_status() == backup::STATUS_REQUIRE_CONV) {
     $rc->convert();
 }
 // Mark the UI finished.
 $rc->finish_ui();
 // Execute prechecks
 $warnings = false;
 if (!$rc->execute_precheck()) {
     $precheckresults = $rc->get_precheck_results();
     if (is_array($precheckresults)) {
         if (!empty($precheckresults['errors'])) {
             // If errors are found, terminate the import.
             fulldelete($tempdestination);
             echo $OUTPUT->header();
開發者ID:bobpuffer,項目名稱:moodleUCLA-LUTH,代碼行數:31,代碼來源:import.php


注:本文中的restore_controller::add_logger方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。