本文整理汇总了PHP中backup_helper::delete_old_backup_dirs方法的典型用法代码示例。如果您正苦于以下问题:PHP backup_helper::delete_old_backup_dirs方法的具体用法?PHP backup_helper::delete_old_backup_dirs怎么用?PHP backup_helper::delete_old_backup_dirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backup_helper
的用法示例。
在下文中一共展示了backup_helper::delete_old_backup_dirs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
}
示例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
}
}
示例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();
}
}
示例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();
}