Updates for Legacy compatibility and 1 minor bug change.

Now use getConnection for Doctrine connection and getDatabaseConnection
for legacy connection.  Converted XMF assignments for this and added
global $xoopsDB to search.php
Small change to define legacy $xoopsDB global in installer when needed.