protected function set_include_files() {
        // We normally include files.
        $includefiles = true;

        // In an import, we don't need to include files.
        if ($this->get_mode() === backup::MODE_IMPORT) {
            $includefiles = false;
        }

        // When a backup is intended for the same site, we don't need to include the files.
        // Note, this setting is only used for duplication of an entire course.
        if ($this->get_mode() === backup::MODE_SAMESITE) {
            $includefiles = false;
        }

        $this->includefiles = (int) $includefiles;
        $this->log("setting file inclusion to {$this->includefiles}", backup::LOG_DEBUG);
        return $this->includefiles;
    }