Hello devs,
Curently there is no public file API function to get a filepath to a local file stored in Moodle data, path_from_hash is private.
I need the access to the filepath for my Global Search work (see MDL-31989). Having a file handle is not enough, because I will be processing files with external utilities (e.g. to extract text from PDF).
I know there are some strong opinions here that path_from_hash should stay private. I don't agree with it as this is not protecting anything: from any Moodle code you have full rights to delete whole Moodle data directory if you wish. You can also calculate where the real file is easily.
So the way I see it we have two options to get that for Global Search:
- I will introduce some code duplication and calculate the path myself
- we will make that funcion public
Am I missing anything? I don't really have strong preference one way or another, I would just like us to reach the conclusion, so I can finish Global Search work without any surprises .
cheers,
Tomek