本文整理汇总了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);
}
}