Created
October 15, 2019 18:52
-
-
Save mudrd8mz/14f1a8144dbd9cc8d9357300c42ca985 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
$done = 0; | |
foreach ($courses as $course) { | |
if ($options['skip-recycle-bin']) { | |
// This is a hack, we pretend to be executed by the restore process | |
// so that the recycle bin hook is skipped. | |
$course->deletesource = 'restore'; | |
} | |
if (!delete_course($course, false)) { | |
throw new moodle_exception('cannotdeletecategorycourse', '', '', $course->shortname); | |
} | |
$done++; | |
cli_write("\r".$done."/".$count." (".floor($done / $count * 100)."%) "); | |
} | |
cli_writeln("done!"); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment