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


PHP backup_helper::delete_backup_dir方法代码示例

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


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

示例1: define_execution

 protected function define_execution() {
     global $CFG;
     restore_controller_dbops::drop_restore_temp_tables($this->get_restoreid()); // Drop ids temp table
     backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60));              // Delete > 4 hours temp dirs
     if (empty($CFG->keeptempdirectoriesonbackup)) { // Conditionally
         backup_helper::delete_backup_dir($this->task->get_tempdir()); // Empty restore dir
     }
 }
开发者ID:nottmoo,项目名称:moodle,代码行数:8,代码来源:restore_stepslib.php

示例2: define_execution

    protected function define_execution() {
        global $CFG;

        backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
        backup_helper::delete_old_backup_dirs(time() - (4 * 60 * 60));              // Delete > 4 hours temp dirs
        // Delete temp dir conditionally:
        // 1) If $CFG->keeptempdirectoriesonbackup is not enabled
        // 2) If backup temp dir deletion has been marked to be avoided
        if (empty($CFG->keeptempdirectoriesonbackup) && !$this->skipcleaningtempdir) {
            backup_helper::delete_backup_dir($this->get_backupid()); // Empty backup dir
        }
    }
开发者ID:nuckey,项目名称:moodle,代码行数:12,代码来源:backup_stepslib.php

示例3: define_execution

    protected function define_execution() {
        global $CFG;

        backup_controller_dbops::drop_backup_ids_temp_table($this->get_backupid()); // Drop ids temp table
        backup_helper::delete_old_backup_dirs(strtotime('-1 week'));                // Delete > 1 week old temp dirs.
        // Delete temp dir conditionally:
        // 1) If $CFG->keeptempdirectoriesonbackup is not enabled
        // 2) If backup temp dir deletion has been marked to be avoided
        if (empty($CFG->keeptempdirectoriesonbackup) && !$this->skipcleaningtempdir) {
            $progress = $this->task->get_progress();
            $progress->start_progress('Deleting backup dir');
            backup_helper::delete_backup_dir($this->get_backupid(), $progress); // Empty backup dir
            $progress->end_progress();
        }
    }
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:15,代码来源:backup_stepslib.php

示例4: define_execution

 protected function define_execution()
 {
     global $CFG;
     restore_controller_dbops::drop_restore_temp_tables($this->get_restoreid());
     // Drop ids temp table
     $progress = $this->task->get_progress();
     $progress->start_progress('Deleting backup dir');
     backup_helper::delete_old_backup_dirs(strtotime('-1 week'), $progress);
     // Delete > 1 week old temp dirs.
     if (empty($CFG->keeptempdirectoriesonbackup)) {
         // Conditionally
         backup_helper::delete_backup_dir($this->task->get_tempdir(), $progress);
         // Empty restore dir
     }
     $progress->end_progress();
 }
开发者ID:Jinelle,项目名称:moodle,代码行数:16,代码来源:restore_stepslib.php

示例5: required_param

            $courseids = required_param('targetid', PARAM_INT);
            $transaction = $DB->start_delegated_transaction();
            foreach ($courseids as $key => $courseid) {
                if ($target == backup::TARGET_EXISTING_DELETING) {
                    $options = array();
                    $options['keep_roles_and_enrolments'] = new restore_course_generic_setting('keep_roles_and_enrolments', base_setting::IS_BOOLEAN, true);
                    $options['keep_groups_and_groupings'] = new restore_course_generic_setting('keep_groups_and_groupings', base_setting::IS_BOOLEAN, true);
                    restore_dbops::delete_course_content($courseid, $options);
                }
                $controller = new restore_controller($filepath, $courseid, backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id, $target);
                $controller->execute_precheck();
                $controller->execute_plan();
            }
            $transaction->allow_commit();
        }
        backup_helper::delete_backup_dir($filepath);
    }
}
echo $OUTPUT->header();
if ($restore) {
    $heading = $course->fullname;
    $PAGE->set_title($heading . ': ' . $restore->get_stage_name());
    $PAGE->set_heading($heading);
    $outcome = $restore->process();
    $PAGE->navbar->add($restore->get_stage_name());
    $renderer = $PAGE->get_renderer('core', 'backup');
    if (!$restore->is_independent() && $restore->enforce_changed_dependencies()) {
        echo $renderer->dependency_notification(get_string('dependenciesenforced', 'backup'));
    }
    echo $renderer->progress_bar($restore->get_progress_bar());
    echo $restore->display($renderer);
开发者ID:renatosousafilho,项目名称:moodle-restore,代码行数:31,代码来源:restore.php


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