I recently had this idea of a Moodle "health center", accessible only by the admin, which in essence would be a script that:
- Detects common (or maybe uncommong) problems that we know about and cause confusion to the admins and/or users of a site.
- Notifies the admin of said problems.
- Provides instruction on how to solve them.
A classic example is the "whitespace present after ?> in config.php breaks redirects etc" problem. Another issue could be the php memory_limit. Or maybe the use of blank or weak passwords for MySQL.
For Phase One of this project, I would like to gather a few ideas of such problems (problems that admins could easily solve by themselves if only they knew what the cause is) to incorporate into this script so that I can post a working example. Can you guys brainstorm and fling a few candidates at me please?
After this, we pass into the realm of "could that be???" features... obviously these would take a little time to get implemented, but please read along and imagine the end result.
In Phase Two, we can substitute the PHP error_handler() with one of our own. This handler would, in addition to normal behavior, log PHP's notices and warnings somewhere (db?), and would give the admin a summary like:
- There were 522 notices and 78 warnings generated by Moodle code.
- Click here to view the warnings (a simple list stating file, line, message for start; later we can have some more complex manipulation for our convenience).
- Click here to reset the counters (i.e., "I fixed those, let's see what else there is").
This would obviously let people give the developers lots and lots of feedback, because the error_handler can save any information we tell it to save at the time the error is generated, and people can just copy paste it to us without needing to understand or reproduce the problem (have you seen what kind of info a debug_backtrace() gives? ). I believe this would be a big step towards a rock-solid Moodle. But it gets even better...
In Phase Three, it's possible that we will have worked out a system for Moodle to "communicate" with the servers at Moodle.org, for example "click here to install Klingon language pack", or maybe "click here to install Excellent New Module", or "click here to update your copy of Moodle" (OK, this is excessive ). If I 'm not mistaken there is already some preliminary support for doing this for the language packs.
Well, what prevents us then from extending this communication and making it bilateral? We can have a "click here to submit debugging information to moodle.org" button, or even an option for automating this through cron.php. Result? Once this system penetrates to end users, if there is a PHP warning somewhere we get to know about it immediately! Plus, by keeping simple statistics like "X out of Y Moodle installations reported this problem, click here to break down by Moodle version"... do I need to continue?
In Phase Four, we will have integrated this system with the update procedure so that it can actually update itself! (my preliminary design is built in such a way that those "problems" that the health center detects do not need to be hard-coded).
What this means is that as soon as we find a serious bug or something like that, Martin can update moodle.org's servers with the info. Then, administrators around the world can have Moodle itself alert them to the fact that there is an issue they should address ASAP, and provide instructions to do that (or even say "click here to download and install this patch").
update.moodle.org anyone?
So, to wrap this up: I 'd like to get some feedback from people (both end users and of course MD and developers) regarding this idea. I 'd also like anyone who can think of something appropriate for Phase One to suggest it, so that I can gather a few issues and present an initial version of this feature.
Jon