original_string: public static function get_backup_file_info($filename, $filearea, $contextid) {
          $fs = get_file_storage();
          $file = $fs->get_file($contextid, 'backup', $filearea, 0, '/', $filename);
          $filesize = display_size ($file->get_filesize());
          $fileurl = moodle_url::make_pluginfile_url(
              $file->get_contextid(),
              $file->get_component(),
              $file->get_filearea(),
              null,
              $file->get_filepath(),
              $file->get_filename(),
              true
              );
  
          $params = array();
          $params['action'] = 'choosebackupfile';
          $params['filename'] = $file->get_filename();
          $params['filepath'] = $file->get_filepath();
          $params['component'] = $file->get_component();
          $params['filearea'] = $file->get_filearea();
          $params['filecontextid'] = $file->get_contextid();
          $params['contextid'] = $contextid;
          $params['itemid'] = $file->get_itemid();
          $restoreurl = new moodle_url('/backup/restorefile.php', $params);
          $filesize = display_size ($file->get_filesize());
  
          $results = array(
              'filesize' => $filesize,
              'fileurl' => $fileurl->out(false),
              'restoreurl' => $restoreurl->out(false));
  
          return $results;
      }
code: public static function get_backup_file_info($filename, $filearea, $contextid) {
          $fs = get_file_storage();
          $file = $fs->get_file($contextid, 'backup', $filearea, 0, '/', $filename);
          $filesize = display_size ($file->get_filesize());
          $fileurl = moodle_url::make_pluginfile_url(
              $file->get_contextid(),
              $file->get_component(),
              $file->get_filearea(),
              null,
              $file->get_filepath(),
              $file->get_filename(),
              true
              );
  
          $params = array();
          $params['action'] = 'choosebackupfile';
          $params['filename'] = $file->get_filename();
          $params['filepath'] = $file->get_filepath();
          $params['component'] = $file->get_component();
          $params['filearea'] = $file->get_filearea();
          $params['filecontextid'] = $file->get_contextid();
          $params['contextid'] = $contextid;
          $params['itemid'] = $file->get_itemid();
          $restoreurl = new moodle_url('/backup/restorefile.php', $params);
          $filesize = display_size ($file->get_filesize());
  
          $results = array(
              'filesize' => $filesize,
              'fileurl' => $fileurl->out(false),
              'restoreurl' => $restoreurl->out(false));
  
          return $results;
      }
code_tokens: public static function get_backup_file_info ( $ filename , $ filearea , $ contextid ) { $ fs = get_file_storage ( ) ; $ file = $ fs -> get_file ( $ contextid , 'backup' , $ filearea , 0 , '/' , $ filename ) ; $ filesize = display_size ( $ file -> get_filesize ( ) ) ; $ fileurl = moodle_url :: make_pluginfile_url ( $ file -> get_contextid ( ) , $ file -> get_component ( ) , $ file -> get_filearea ( ) , null , $ file -> get_filepath ( ) , $ file -> get_filename ( ) , true ) ; $ params = array ( ) ; $ params [ 'action' ] = 'choosebackupfile' ; $ params [ 'filename' ] = $ file -> get_filename ( ) ; $ params [ 'filepath' ] = $ file -> get_filepath ( ) ; $ params [ 'component' ] = $ file -> get_component ( ) ; $ params [ 'filearea' ] = $ file -> get_filearea ( ) ; $ params [ 'filecontextid' ] = $ file -> get_contextid ( ) ; $ params [ 'contextid' ] = $ contextid ; $ params [ 'itemid' ] = $ file -> get_itemid ( ) ; $ restoreurl = new moodle_url ( '/backup/restorefile.php' , $ params ) ; $ filesize = display_size ( $ file -> get_filesize ( ) ) ; $ results = array ( 'filesize' => $ filesize , 'fileurl' => $ fileurl -> out ( false ) , 'restoreurl' => $ restoreurl -> out ( false ) ) ; return $ results ; }
docstring: Get the size, url and restore url for a backup file.
  
  @param string $filename The name of the file to get info for.
  @param string $filearea The file area for the file.
  @param int $contextid The context ID of the file.
  @return array $results The result array containing the size, url and restore url of the file.
docstring_tokens: Get the size url and restore url for a backup file .