Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49579

Add a per-request directory helper

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.9
    • None
    • Administration

    Description

      The make_temp_directory() function is meant to only be used to create directories which are only present for the current request.

      Therefore it should be possible to enforce this, however it's never been enforced before, so doing so now would be light juggling razors.

      We should create a new per-request directory helper (make_request_directory()), which:

      1. does not take a dirname argument (too tempting to play silly buggers with it); and
      2. is automatically removed at the end of the process.

      We can then start to replace all uses of make_temp_directory() with this, and eventually deprecate make_temp_directory altogether.

      Since request directories should be local to individual web server (in a clustered environment), we ideally want the new directory to be in local storage, and not shared storage. To do so, we can either:

      1. create a new directory requirement and config setting; or
      2. (ab?)use localcachedir.

      For the moment, I've used the localcachedir option as I feel that it is a suitable location in this instance.

      Attachments

        Issue Links

          Activity

            People

              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: