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


PHP backup_controller::finish_ui方法代码示例

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


在下文中一共展示了backup_controller::finish_ui方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

    if ($options['courseshortname']) {
        $course = $DB->get_record('course', array('shortname' => $options['courseshortname']), '*', MUST_EXIST);
    }
}
cli_heading('Performing backup...');
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_YES, backup::MODE_GENERAL, $admin->id);
// Set the default filename.
$format = $bc->get_format();
$type = $bc->get_type();
$id = $bc->get_id();
$users = $bc->get_plan()->get_setting('users')->get_value();
$anonymised = $bc->get_plan()->get_setting('anonymize')->get_value();
$filename = backup_plan_dbops::get_default_backup_filename($format, $type, $id, $users, $anonymised);
$bc->get_plan()->get_setting('filename')->set_value($filename);
// Execution.
$bc->finish_ui();
$bc->execute_plan();
$results = $bc->get_results();
$file = $results['backup_destination'];
// May be empty if file already moved to target location.
// Do we need to store backup somewhere else?
if (!empty($dir)) {
    if ($file) {
        mtrace("Writing " . $dir . '/' . $filename);
        if ($file->copy_content_to($dir . '/' . $filename)) {
            $file->delete();
            mtrace("Backup completed.");
        } else {
            mtrace("Destination directory does not exist or is not writable. Leaving the backup in the course backup file area.");
        }
    }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:31,代码来源:backup.php

示例2: foreach

 function backup_template($courseid_from,$settings,$config,$admin) {
    $bc = new backup_controller(backup::TYPE_1COURSE, $courseid_from, backup::FORMAT_MOODLE,
                                backup::INTERACTIVE_YES, backup::MODE_IMPORT,$admin->id);
    $backupid = $bc->get_backupid();
    $bc->get_plan()->get_setting('users')->set_status(backup_setting::LOCKED_BY_CONFIG);
    
    foreach ($settings as $setting => $configsetting) {
        if ($bc->get_plan()->setting_exists($setting)) {
            $bc->get_plan()->get_setting($setting)->set_value($config->{$configsetting});
        }
    }
 
    $bc->finish_ui();
    $bc->execute_plan();
    $bc->destroy();
    unset($bc);
 
    return $backupid;
}
开发者ID:rm77,项目名称:pd1tt_module,代码行数:19,代码来源:fungsi_moodle.php


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