To improve database updater please see some suggestions by @daniel Kinzler. His suggestion is to instead of using a hook in mediawiki to get the database updater working why not register the hook in the extension or skin itself. It would fix using $GLOBALS.
But things to make sure with this is to make sure it works both in the main php file or extension.json.