Error to start Mailwatch : Class 'database' not found
|
if (isset($_COOKIE['MW_LANG']) && checkLangCode($_COOKIE['MW_LANG'])) { |
|
require_once __DIR__ . '/database.php'; |
The code in line 69 of the functions.php file indirectly uses the database class that comes from importing the database.php file.
The checkLangCode() function makes use of the audit_log() function, which requires the dbconn() function, which would only work with the database class already imported, but it is still called on line 103, causing the error "PHP Fatal error: Uncaught Error : Class 'database' not found in /var/www/html/mailscanner/functions.php"
The workaround is to move the database.php file import to the top (after conf.php import: line 41)
require_once __DIR__ . '/conf.php';
require_once __DIR__ . '/database.php';
Error to start Mailwatch : Class 'database' not found
MailWatch/mailscanner/functions.php
Line 69 in 247d92f
MailWatch/mailscanner/functions.php
Line 103 in 247d92f
The code in line 69 of the functions.php file indirectly uses the database class that comes from importing the database.php file.
The checkLangCode() function makes use of the audit_log() function, which requires the dbconn() function, which would only work with the database class already imported, but it is still called on line 103, causing the error "PHP Fatal error: Uncaught Error : Class 'database' not found in /var/www/html/mailscanner/functions.php"
The workaround is to move the database.php file import to the top (after conf.php import: line 41)