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

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Files API
    • None
    • MOODLE_20_STABLE
    • 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

            timhunt Tim Hunt
            timhunt Tim Hunt
            Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10