First, am not a developer ... more like a 'wanniebe' ... but thought this forum the 'best' place to ask ...
In moodle there is a settings script for System Paths.
One of which is du (disk usage) and the comment under the box says:
"Path to du. Probably something like /usr/bin/du. If you enter this, pages that display directory contents will run much faster for directories with a lot of files"
Have installed an add-on for course sizes and it uses du. When using 'course sizes' have been watching live processes on a linux box with top and have seen du 'kick in'.
The question:
I'd like to inspect any moodle code that uses du. Where can I find that code?
Reason: I'd like to work on a local plugin (not an official Moodle local plugin, but a 'home grown' one that doesn't hack moodle core code) that allows a moodle user to take a 'snapshot' of the moodle code and get a mysqldump.
Extending the reason why ...
There are a few things which, IMHO, Moodle desperately needs to address. Among those, taking a 'snapshot' of the code directory and DB dump via Moodle Admin UI screens.
Why? Let's take, for example, a 'sandbox' Moodle implmentation that's purpose is to try out plugins and addons (not a production site). When one steps through acquiring an addon and is about to install, one hits an 'Acknowledgement' screen which says:
"I understand that it is my responsibility to have full backups of this site prior to installing additional plugins. I accept and understand that plugins (especially but not only those originating in unofficial sources) may contain security holes, can make the site unavailable, or cause private data leaks or loss."
That's a fair warning and is justified.
But, for noobies, that is also daunting, to say the least. 'Roll the dice' and 'go for it'!
What if there was a link <a href="site/local/snapshot/" target="_new">RUN SNAPSHOT</a> that ran a php exec bash shell script which backs up the code directory AND does a mysqldump of the DB? A 'snapshot'!!!
The user in the sandbox then is assured that no matter what they install, the sandbox can be restored to the point just before they began to 'play'.
Actually, I have such a local plugin (uses php exec) and have tested it ... it works, but I'd like to investigate just how difficult it might be to bring it into Moodle as a 'valid'/true local plugin.
Thanks, in advance, for any pointers.
'spirit of sharing', Ken