Work with MySQL Sockets

This passes anything that is not a valid port (0<int<65535) as a unix socket.
I tested this with unix sockets; this needs to be tested with a non-standard mysql port as well but I don't foresee any issues.

To use a unix socket, even one different than PHP's mysql.default_socket..
* Database Host = localhost:/path/to/socket
Fix variable not always being defined.
Update notes on dbhost
movie previews: use file directly when it's stored locally and encryption is not enabled, fixes #7756
Fixes based on suggestions

I use the term socket for any extension, either unix socket, or internet socket (port).

I check if the socket is all digits
* only integers 0 and larger would pass this test.
I then check if the string is less than or equal to the maximum port number.

By using "if($socket)" I make sure socket isn't false, empty, or the string '0'.

I don't believe I need to initialize $port because $port will always be set if $socket is true. Please show me if I am wrong here. Thanks
Added max heartbeat interval to prevent integer overflow

When using big session timeout values, the interval value might
overflow and cause the setInterval() call to ping the server in a loop
without any delay.

This fix adds a maximum ping interval of 24 hours.

Forward port of 00ec5fc1935c946e846a8ff28491e5b5b017b3d7 from stable6.
Added unit tests for heartbeat interval min/max values
Inline $port expression, getting rid of $port variable.
Extract common variables of $connectionParams.
Move check for : to where it belongs, getting rid of $socket = false;
Move getValue() to where required. This actually is not required "global data".
No need to check the port number as this will fail anyway.
Rename variable to indicate that it can be port and socket.
Don't specify host when using a socket.
fix some minor issues
Merge pull request #9017 from owncloud/maxheartbeatinterval

Added max heartbeat interval to prevent integer overflow
[tx-robot] updated from transifex
Merge pull request #8714 from owncloud/minor-fixes

fix some minor issues
access admin settings result message correctly
move mail template editor from core to standalone templateeditor repo