Hi Petr, it is unclear to me the advantage of such defaults.php: this file looks like it changes the Default value shown in Admin pages, but it does not seems to affect the setting itself. For example:
$defaults['moodle']['cronclionly'] = 1;
It changes the Default value displayed, but does not set the cron from cli command only, so the cron can still be run from http requests. I also tested forceloginforprofiles, profilesforenrolledusersonly, registerauth and many other settings.
None of the values inserted in defaults.php changed the settings, the only value changed is the "Default: xx" text.
Probably I'm missing something? Are those defaults set only during setup ? As far as I can understand, defaults.php cannot substitute $CFG->somesetting in config.php, something very handy if you need to mass-change settings on large deployments.