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