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


PHP logger::potential_dot方法代码示例

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


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

示例1: restore

 /**
  * Takes backupid and original course object as arguments and returns a new courseid.
  *
  * @param string $backupid The backupid
  * @param object $newcourse Target course object
  * @throws coding_exception Moodle coding exception
  */
 private function restore($backupid, $newcourse)
 {
     global $CFG, $DB, $USER;
     // Call restore.
     $rc = new \restore_controller($backupid, $newcourse->id, \backup::INTERACTIVE_NO, \backup::MODE_GENERAL, $USER->id, \backup::TARGET_EXISTING_ADDING);
     // Setup custom logger that prints dots.
     $logger = new logger(\backup::LOG_INFO, false, true);
     self::$currentlogger = $logger;
     $logger->potential_dot();
     $rc->get_logger()->set_next($logger);
     $rc->set_progress(new progress());
     foreach ($rc->get_plan()->get_tasks() as $taskindex => $task) {
         $settings = $task->get_settings();
         foreach ($settings as $settingindex => $setting) {
             // Set userinfo true for activity, since we controlled it
             // more accurately (i.e. true only for glossary) in backup.
             if (preg_match('/^glossary_([0-9])*_userinfo$$/', $setting->get_name())) {
                 $setting->set_value(true);
             }
             if ($taskindex == 0 && isset($this->backupsettings[$setting->get_name()])) {
                 $setting->set_value($this->backupsettings[$setting->get_name()]);
             }
         }
     }
     if (!$rc->execute_precheck()) {
         if (empty($CFG->keeptempdirectoriesonbackup)) {
             fulldelete($this->backupbasepath);
         }
         $results = print_r($rc->get_precheck_results(), true);
         print \html_writer::tag('pre', s($results));
         throw new \coding_exception('Restore precheck error.');
     }
     $logger->potential_dot();
     $rc->execute_plan();
     $rc->destroy();
     // Delete backup file.
     if (empty($CFG->keeptempdirectoriesonbackup)) {
         fulldelete($this->backupbasepath);
     }
 }
开发者ID:ninelanterns,项目名称:moodle-mod_subpage,代码行数:47,代码来源:lib.php


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