本文整理汇总了PHP中upload_manager::delete_other_files方法的典型用法代码示例。如果您正苦于以下问题:PHP upload_manager::delete_other_files方法的具体用法?PHP upload_manager::delete_other_files怎么用?PHP upload_manager::delete_other_files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类upload_manager
的用法示例。
在下文中一共展示了upload_manager::delete_other_files方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wiki_upload_deldir
function wiki_upload_deldir(&$WS)
{
//cheack if the folder exists
if (file_exists($WS->dfdir->name)) {
//delete all folder files
$upd = new upload_manager();
$upd->delete_other_files($WS->dfdir->name);
rmdir($WS->dfdir->name);
return true;
} else {
return true;
}
}
示例2: notify
} else {
// Process the resubmission
$dir = $assignmentinstance->file_area_name($userid);
require_once $CFG->dirroot . '/lib/uploadlib.php';
$um = new upload_manager('newfile', true, false, $assignmentinstance->course, false, $assignmentinstance->assignment->maxbytes);
if ($um->preprocess_files()) {
//Check the file extension
$submittedFilename = $um->get_original_filename();
$extension = $assignmentinstance->assignment->fileextension;
if (strtolower(substr($submittedFilename, strlen($submittedFilename) - strlen($extension))) != $extension) {
notify(get_string("incorrectfileextension", "assignment_peerreview", $extension));
} else {
if ($um->save_files($dir)) {
$newfile_name = $um->get_new_filename();
$um->config->silent = true;
$um->delete_other_files($dir, $dir . '/' . $newfile_name);
$submission = $assignmentinstance->get_submission($userid);
if (set_field('assignment_submissions', 'timemodified', time(), 'id', $submission->id)) {
add_to_log($assignmentinstance->course->id, 'assignment', 'upload', 'view.php?a=' . $assignmentinstance->assignment->id, $assignmentinstance->assignment->id, $assignmentinstance->cm->id);
notify(get_string('resubmissionsuccessful', 'assignment_peerreview'), 'notifysuccess');
} else {
notify(get_string("uploadnotregistered", "assignment", $newfile_name));
}
}
}
}
}
print_continue($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $assignmentinstance->cm->id);
} else {
if (isset($assignmentinstance->assignment->var3) && $assignmentinstance->assignment->var3 == assignment_peerreview::ONLINE_TEXT) {
notify(get_string("resubmissionwarning", "assignment_peerreview"));