本文整理汇总了PHP中fulldelete函数的典型用法代码示例。如果您正苦于以下问题:PHP fulldelete函数的具体用法?PHP fulldelete怎么用?PHP fulldelete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fulldelete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
global $CFG;
if (empty($CFG->keeptempdirectoriesonbackup)) {
fulldelete("{$CFG->dataroot}/temp/backup/{$this->tempdir}");
}
}
示例2: importpostprocess
/**
* Does any post-processing that may be desired
* Clean the temporary directory if a zip file was imported
* @return bool success
*/
public function importpostprocess()
{
if ($this->tempdir != '') {
fulldelete($this->tempdir);
}
return true;
}
示例3: theme_reset_all_caches
/**
* Invalidate all server and client side caches.
* @return void
*/
function theme_reset_all_caches() {
global $CFG;
require_once("$CFG->libdir/filelib.php");
set_config('themerev', empty($CFG->themerev) ? 1 : $CFG->themerev+1);
fulldelete("$CFG->dataroot/cache/theme");
}
示例4: webquest_upgrade
function webquest_upgrade($oldversion)
{
/// This function does anything necessary to upgrade
/// older versions to match current functionality
$status = true;
global $CFG;
if ($oldversion < 2007081222) {
require_once $CFG->dirroot . '/backup/lib.php';
//make the change into each course
$courses = get_records("course");
foreach ($courses as $course) {
$newdir = "{$course->id}/{$CFG->moddata}/webquest";
if (make_upload_directory($newdir)) {
$olddir = "{$CFG->dataroot}/{$course->id}/{$CFG->moddata}/webquest/submissions";
//chec k if the old directory exists
if (is_dir($olddir)) {
$status = backup_copy_file($olddir, $CFG->dataroot . "/" . $newdir);
}
if ($status) {
fulldelete($olddir);
}
}
}
}
return $status;
}
示例5: tearDown
protected function tearDown()
{
global $CFG;
if (empty($CFG->keeptempdirectoriesonbackup)) {
fulldelete("{$CFG->tempdir}/backup/{$this->tempdir}");
}
}
示例6: delete_certificate_files
function delete_certificate_files($certificate = '')
{
global $CFG;
require_once $CFG->libdir . '/filelib.php';
$dir = $CFG->dataroot . '/' . $certificate->course . '/' . $CFG->moddata . '/certificate/' . $certificate->id . '/' . $user->id;
if ($certificateid) {
$dir .= '/' . $certificateid;
}
return fulldelete($dir);
}
示例7: theme_reset_all_caches
/**
* Invalidate all server and client side caches.
*
* This method deletes the physical directory that is used to cache the theme
* files used for serving.
* Because it deletes the main theme cache directory all themes are reset by
* this function.
*/
function theme_reset_all_caches()
{
global $CFG;
require_once "{$CFG->libdir}/filelib.php";
$next = time();
if (isset($CFG->themerev) and $next <= $CFG->themerev and $CFG->themerev - $next < 60 * 60) {
// This resolves problems when reset is requested repeatedly within 1s,
// the < 1h condition prevents accidental switching to future dates
// because we might not recover from it.
$next = $CFG->themerev + 1;
}
set_config('themerev', $next);
// time is unique even when you reset/switch database
fulldelete("{$CFG->cachedir}/theme");
}
示例8: webquest_delete_instance
function webquest_delete_instance($id)
{
/// Given an ID of an instance of this module,
/// delete the instance and any data that depends on it.
global $CFG;
if (!($webquest = get_record("webquest", "id", "{$id}"))) {
return false;
}
$result = true;
if (!delete_records("webquest", "id", "{$webquest->id}")) {
$result = false;
}
if (!delete_records("webquest_resources", "webquestid", "{$webquest->id}")) {
$result = false;
}
if (!delete_records("webquest_tasks", "webquestid", "{$webquest->id}")) {
$result = false;
}
if (!delete_records("webquest_rubrics", "webquestid", "{$webquest->id}")) {
$result = false;
}
if (!delete_records("webquest_grades", "webquestid", "{$webquest->id}")) {
$result = false;
}
if (!delete_records("webquest_teams", "webquestid", "{$webquest->id}")) {
$result = false;
}
if (!delete_records("webquest_team_members", "webquestid", "{$webquest->id}")) {
$result = false;
}
if ($submissions = get_records("webquest_submissions", "webquestid", "{$webquest->id}")) {
foreach ($submissions as $submission) {
$dirpath = "{$CFG->dataroot}/{$webquest->course}/{$CFG->moddata}/webquest/{$submission->id}";
fulldelete($dirpath);
}
}
if (!delete_records("webquest_submissions", "webquestid", "{$webquest->id}")) {
$result = false;
}
return $result;
}
示例9: execute
public function execute()
{
global $CFG, $DB;
if ($this->expandedOptions['flush']) {
if (isset($CFG->trashdir)) {
$trashdir = $CFG->trashdir;
} else {
$trashdir = $CFG->dataroot . '/trashdir';
}
require_once $CFG->libdir . '/filelib.php';
fulldelete($trashdir);
exit(0);
}
if ($this->expandedOptions['stdin']) {
while ($line = fgets(STDIN)) {
$this->fileDelete($line);
}
} else {
foreach ($this->arguments as $argument) {
$this->fileDelete($argument);
}
}
}
示例10: delete_instance
/**
* Deletes an assignment activity
*
* Deletes all database records, files and calendar events for this assignment.
* @param $assignment object The assignment to be deleted
* @return boolean False indicates error
*/
function delete_instance($assignment)
{
global $CFG;
$assignment->courseid = $assignment->course;
$result = true;
if (!delete_records('assignment_submissions', 'assignment', $assignment->id)) {
$result = false;
}
if (!delete_records('assignment', 'id', $assignment->id)) {
$result = false;
}
if (!delete_records('event', 'modulename', 'assignment', 'instance', $assignment->id)) {
$result = false;
}
// delete file area with all attachments - ignore errors
require_once $CFG->libdir . '/filelib.php';
fulldelete($CFG->dataroot . '/' . $assignment->course . '/' . $CFG->moddata . '/assignment/' . $assignment->id);
assignment_grade_item_delete($assignment);
return $result;
}
示例11: foreach
// restored copy of the module
$newcmid = null;
$tasks = $rc->get_plan()->get_tasks();
foreach ($tasks as $task) {
if (is_subclass_of($task, 'restore_activity_task')) {
if ($task->get_old_contextid() == $cmcontext->id) {
$newcmid = $task->get_moduleid();
break;
}
}
}
// if we know the cmid of the new course module, let us move it
// right below the original one. otherwise it will stay at the
// end of the section
if ($newcmid) {
$newcm = get_coursemodule_from_id('', $newcmid, $course->id, true, MUST_EXIST);
moveto_module($newcm, $section, $cm);
moveto_module($cm, $section, $newcm);
}
$rc->destroy();
if (empty($CFG->keeptempdirectoriesonbackup)) {
fulldelete($backupbasepath);
}
echo $output->header();
if ($newcmid) {
echo $output->confirm(get_string('duplicatesuccess', 'core', $a), new single_button(new moodle_url('/course/modedit.php', array('update' => $newcmid, 'sr' => $sectionreturn)), get_string('duplicatecontedit'), 'get'), new single_button(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)), get_string('duplicatecontcourse'), 'get'));
} else {
echo $output->notification(get_string('duplicatesuccess', 'core', $a), 'notifysuccess');
echo $output->continue_button(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
}
echo $output->footer();
示例12: html_footer
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
echo " <input type=\"hidden\" name=\"id\" value=\"{$id}\" />\n";
echo " <input type=\"hidden\" name=\"wdir\" value=\"{$wdir}\" />\n";
echo " <input type=\"hidden\" name=\"action\" value=\"cancel\" />\n";
echo " <input type=\"submit\" value=\"{$strcancel}\" />\n";
echo "</form>\n";
echo "</td>\n</tr>\n</table>\n";
}
html_footer();
break;
case "delete":
if ($confirm and confirm_sesskey()) {
html_header($course, $wdir);
foreach ($USER->filelist as $file) {
$fullfile = $basedir . $file;
if (!fulldelete($fullfile)) {
echo "<br />Error: Could not delete: {$fullfile}";
}
}
clearfilelist();
displaydir($wdir);
html_footer();
} else {
html_header($course, $wdir);
if (setfilelist($_POST)) {
echo "<p align=center>" . get_string("deletecheckwarning") . ":</p>";
print_simple_box_start("center");
printfilelist($USER->filelist);
print_simple_box_end();
echo "<br />";
$frameold = $CFG->framename;
示例13: cleanup
public function cleanup() {
return fulldelete($this->directory);
}
示例14: process
/**
* Processes this restore stage
* @return bool
* @throws restore_ui_exception
*/
public function process()
{
global $CFG;
if ($this->filename) {
$archivepath = $CFG->tempdir . '/backup/' . $this->filename;
if (!file_exists($archivepath)) {
throw new restore_ui_exception('invalidrestorefile');
}
$outcome = $this->extract_file_to_dir($archivepath);
if ($outcome) {
fulldelete($archivepath);
}
} else {
$fs = get_file_storage();
$storedfile = $fs->get_file_by_hash($this->pathnamehash);
if (!$storedfile || $storedfile->get_contenthash() !== $this->contenthash) {
throw new restore_ui_exception('invalidrestorefile');
}
$outcome = $this->extract_file_to_dir($storedfile);
}
return $outcome;
}
示例15: js_reset_all_caches
/**
* Invalidate all server and client side JS caches.
* @return void
*/
function js_reset_all_caches()
{
global $CFG;
require_once "{$CFG->libdir}/filelib.php";
set_config('jsrev', empty($CFG->jsrev) ? 1 : $CFG->jsrev + 1);
fulldelete("{$CFG->dataroot}/cache/js");
}