Improve PHP logging
expose mysql database
changed to support fusioninvoice