Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-14589 META: Develop new File API
  3. MDL-18754

Suggested file API function name improvements

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0
    • 2.0
    • Files API
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      I may be being overly fussy, but I think it is important to get the file API function names as clear as possible before it is too late. It will make it much easier for people trying to learn.

      Fortunately, grepping the code for 'draft' only finds 13 matches, so I think we can still change it.

      I suggest

      get_draftarea_info -> file_get_draft_area_info
      file_prepare_draftarea -> file_prepare_draft_area
      file_convert_draftarea -> file_save_files_from_draft_area

      Or even, since this is an important core library, we could drop the 'file_' prefix. The funciton names are sufficiently unique without it.

      I also think we should rename all the other functions the run words together in function names (for example pluginfiles, draftitemid). The File API should all be nice new code. I think we should be exemplary in following the coding guidelines.

      If there is agreement on this I am happy to make the changes.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.