-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
2.9
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:
- does not take a dirname argument (too tempting to play silly buggers with it); and
- 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:
- create a new directory requirement and config setting; or
- (ab?)use localcachedir.
For the moment, I've used the localcachedir option as I feel that it is a suitable location in this instance.