There seems to have been an increased move for functions to support scripts to end up at the bottom of those scripts rather than in libraries, which is fine except at the moment that you want to reuse them some place else.
The latest example of this (which is what has just bitten me) is mod/data/preset.php - I want to programmatically
- create an instance of a database module
- import a preset
- do stuff (migrate entries from a glossary)
at moodle upgrade time
and all the code to deal with importing the preset (including a class!) is in preset.php which obviously I can't just include because it's not a library.
I know it's relatively trivial for me to just move stuff (although I want this in 1.8, not head), but I wonder if it's worth getting some feedback about this from the wider dev community about coding conventions.