当前位置: 首页>>代码示例>>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;未经允许,请勿转载。