add support for connect options
This commit is contained in:
parent
d24d151f53
commit
4973d8c74c
|
@ -75,6 +75,8 @@ sub zmDbConnect {
|
|||
if ( $force ) {
|
||||
zmDbDisconnect();
|
||||
}
|
||||
my $options = shift;
|
||||
|
||||
if ( ( ! defined( $dbh ) ) or ! $dbh->ping() ) {
|
||||
my ( $host, $portOrSocket ) = ( $ZoneMinder::Config::Config{ZM_DB_HOST} =~ /^([^:]+)(?::(.+))?$/ );
|
||||
my $socket;
|
||||
|
@ -89,7 +91,7 @@ sub zmDbConnect {
|
|||
$socket = ";host=".$Config{ZM_DB_HOST};
|
||||
}
|
||||
$dbh = DBI->connect( "DBI:mysql:database=".$Config{ZM_DB_NAME}
|
||||
.$socket
|
||||
.$socket . ($options?'.'.join(';', map { $_.'='.$$options{$_} } keys %{$options} ))
|
||||
, $Config{ZM_DB_USER}
|
||||
, $Config{ZM_DB_PASS}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue