Table of Contents

Attachment API Refactoring (RFC)


The current attachment API requires the client to explicitly check for the type of API used and then perform the actions by itself. This is sub-optimal for two reasons:

  1. Adding one extra attachment type will break all the existing code;
  2. It is cumbersome to use and leads to duplication.




Implementation considerations

The API should hide all details from the user and offer convenience methods such as

bug_attachment_get_contents ( $t_attachment_id )

bug_attachment_download_contents ( $t_attachment_id )

bug_attachment_put( $t_attachment_data )