mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-09-08 11:26:15 -04:00
Merge branch 'improve_filter' into storageareas
This commit is contained in:
commit
d52a6f9a95
5 files changed
+364
-438
No files matched your search
@@ -135,9 +135,9 @@ function loadConfigFile() {
|
||||
elseif ( preg_match( '/^\s*#/', $str ))
|
||||
continue;
|
||||
elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*(.*?)\s*$/', $str, $matches )) {
|
||||
Configure::write("$matches[1]", "$matches[2]");
|
||||
define( $matches[1], $matches[2] );
|
||||
}
|
||||
Configure::write( $matches[1], $matches[2] );
|
||||
define( $matches[1], $matches[2] );
|
||||
}
|
||||
}
|
||||
fclose( $cfg );
|
||||
}
|
||||
|
||||
@@ -85,4 +85,18 @@ class DATABASE_CONFIG {
|
||||
'prefix' => '',
|
||||
//'encoding' => 'utf8',
|
||||
);
|
||||
|
||||
public function __construct() {
|
||||
if (strpos(ZM_DB_HOST, ':')):
|
||||
$array = explode(':', ZM_DB_HOST, 2);
|
||||
if (is_numeric($array[1])):
|
||||
$this->default['host'] = $array[0];
|
||||
$this->default['port'] = $array[1];
|
||||
else:
|
||||
$this->default['unix_socket'] = $array[1];
|
||||
endif;
|
||||
else:
|
||||
$this->default['host'] = ZM_DB_HOST;
|
||||
endif;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user