original_string: 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');
          }
      }
code: 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');
          }
      }
code_tokens: 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' ) ; } }
docstring: 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.
docstring_tokens: Replaces the source backup directory with the converted version