add log support

This commit is contained in:
ghost 2023-09-16 15:23:47 +03:00
parent 1998e73515
commit 94b1ca5700
6 changed files with 106 additions and 33 deletions

View file

@ -1141,4 +1141,18 @@ $debug['db']['total']['insert'] = $db->getDebug()->query->insert->total;
$debug['db']['total']['update'] = $db->getDebug()->query->update->total;
$debug['db']['total']['delete'] = $db->getDebug()->query->delete->total;
print_r($debug);
print_r($debug);
// Debug log
if (LOG_CRONTAB_IMPORT_FEED_ENABLED)
{
@mkdir(LOG_DIRECTORY, 0770, true);
if ($handle = fopen(LOG_DIRECTORY . '/' . LOG_CRONTAB_IMPORT_FEED_FILENAME, 'a+'))
{
fwrite($handle, print_r($debug, true));
fclose($handle);
chmod(LOG_DIRECTORY . '/' . LOG_CRONTAB_IMPORT_FEED_FILENAME, 0770);
}
}