protected function replace_tempdir() {
        global $CFG;

        $tempdir = $this->get_tempdir_path();

        if (empty($CFG->keeptempdirectoriesonbackup)) {
            fulldelete($tempdir);
        } else {
            if (!rename($tempdir, $tempdir . '_' . $this->get_name() . '_' . $this->id . '_source')) {
                throw new convert_exception('failed_rename_source_tempdir');
            }
        }

        if (!rename($this->get_workdir_path(), $tempdir)) {
            throw new convert_exception('failed_move_converted_into_place');
        }
    }
protected function replace_tempdir() {
        global $CFG;

        $tempdir = $this->get_tempdir_path();

        if (empty($CFG->keeptempdirectoriesonbackup)) {
            fulldelete($tempdir);
        } else {
            if (!rename($tempdir, $tempdir . '_' . $this->get_name() . '_' . $this->id . '_source')) {
                throw new convert_exception('failed_rename_source_tempdir');
            }
        }

        if (!rename($this->get_workdir_path(), $tempdir)) {
            throw new convert_exception('failed_move_converted_into_place');
        }
    }
protected function replace_tempdir ( ) { global $ CFG ; $ tempdir = $ this -> get_tempdir_path ( ) ; if ( empty ( $ CFG -> keeptempdirectoriesonbackup ) ) { fulldelete ( $ tempdir ) ; } else { if ( ! rename ( $ tempdir , $ tempdir . '_' . $ this -> get_name ( ) . '_' . $ this -> id . '_source' ) ) { throw new convert_exception ( 'failed_rename_source_tempdir' ) ; } } if ( ! rename ( $ this -> get_workdir_path ( ) , $ tempdir ) ) { throw new convert_exception ( 'failed_move_converted_into_place' ) ; } }
Replaces the source backup directory with the converted version

If $CFG->keeptempdirectoriesonbackup is defined, the original source
source backup directory is kept for debugging purposes.
Replaces the source backup directory with the converted version