directory; if (!str_ends_with($directory, "/")) $directory = $directory . "/"; $context = context_course::instance($id); if (!has_capability('local/replication:replicate', $context)) { die("User not allowed to trigger replication!"); } if (!touch($directory . $id . "-" . $course->category . ".mew")) { die("Could not touch $directory$id-{$course->category}.mew"); }