correct use of Database use

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-12-19 16:57:03 +01:00
parent 2c893fef25
commit 8e84a4ff44
55 changed files with 795 additions and 816 deletions

View File

@@ -302,7 +302,7 @@ class Database
);
if ($socket != null) {
$dbconf["dsn"]['unix_socket'] = makeCorrectFile($socket);
$dbconf["dsn"]['unix_socket'] = \Froxlor\FileDir::makeCorrectFile($socket);
} else {
$dbconf["dsn"]['host'] = $host;
$dbconf["dsn"]['port'] = $port;
@@ -390,7 +390,7 @@ class Database
* log to a file, so we can actually ask people for the error
* (no one seems to find the stuff in the syslog)
*/
$sl_dir = makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . "/logs/");
$sl_dir = \Froxlor\FileDir::makeCorrectDir(\Froxlor\Froxlor::getInstallDir() . "/logs/");
if (! file_exists($sl_dir)) {
@mkdir($sl_dir, 0755);
}
@@ -403,7 +403,7 @@ class Database
* log error for reporting
*/
$errid = substr(md5(microtime()), 5, 5);
$err_file = makeCorrectFile($sl_dir . "/" . $errid . "_sql-error.log");
$err_file = \Froxlor\FileDir::makeCorrectFile($sl_dir . "/" . $errid . "_sql-error.log");
$errlog = @fopen($err_file, 'w');
@fwrite($errlog, "|CODE " . $error->getCode() . "\n");
@fwrite($errlog, "|MSG " . $error_message . "\n");