当前位置: 首页>>代码示例>>PHP>>正文


PHP restore_controller::finish_ui方法代码示例

本文整理汇总了PHP中restore_controller::finish_ui方法的典型用法代码示例。如果您正苦于以下问题:PHP restore_controller::finish_ui方法的具体用法?PHP restore_controller::finish_ui怎么用?PHP restore_controller::finish_ui使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在restore_controller的用法示例。


在下文中一共展示了restore_controller::finish_ui方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
 // 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();
             echo $renderer->precheck_notices($precheckresults);
             echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id' => $course->id)));
             echo $OUTPUT->footer();
             die;
         }
         if (!empty($precheckresults['warnings'])) {
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:import.php

示例2: restore_to_course

function restore_to_course($courseid, $backupid, $restoretarget, $admin) {
    global $CFG; 

    // Check whether the backup directory still exists. If missing, something
    // 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
    }
 
    $rc = new restore_controller($backupid, $courseid, backup::INTERACTIVE_YES, 
                                backup::MODE_IMPORT,$admin->id,$restoretarget);
 
    // 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
    $rc->execute_precheck();
    
    //if ($restoretarget == backup::TARGET_CURRENT_DELETING || $restoretarget == backup::TARGET_EXISTING_DELETING) {
    //    restore_dbops::delete_course_content($courseid);
    //}
    // Execute the restore.
    $rc->execute_plan();
    $rc->destroy();
    unset($rc);
    
    // Delete the temp directory now
    fulldelete($tempdestination);
}
开发者ID:rm77,项目名称:pd1tt_module,代码行数:34,代码来源:fungsi_moodle.php


注:本文中的restore_controller::finish_ui方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。