This will require significant changes to a great many files, since it's possible that any number of them can be loaded during a cron process (like clean-up). The fact that $vbulletin->db is not used consistently throughout vBulletin, yet they destroy $db in cron processing to "force" use of an object they don't even use elsewhere, is a very annoying aspect of vBulletin.