Allow MySQL configuration from an URL (from config file or environment)

It is really convenient to be able to configure its application from
the environment, by this way there is no hard reference to crendentials
in the files of the application itself, everything can be managed during the
deployment.

My pull request is probably not perfect, I'm not really used to PHP "best
practices" (but I've tried to find inspiration in the code of the project),
just tell me what to change/fix. Thanks!