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

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Files API
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Participants:
              Component watchers:
              Matteo Scaramuccia, Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10